Kaydet (Commit) 2b17ec21 authored tarafından Noel Grandin's avatar Noel Grandin

uno:Sequence->std::vector in SmartTagMgr

Change-Id: I163f7d6c0f30ac2929df1cae202e695d21bb49fc
üst e6721d2d
......@@ -172,7 +172,7 @@ public:
@param rActionIndicesSequence
Output parameter
*/
void GetActionSequences( css::uno::Sequence < OUString >& rSmartTagTypes,
void GetActionSequences( std::vector< OUString >& rSmartTagTypes,
css::uno::Sequence < css::uno::Sequence< css::uno::Reference< css::smarttags::XSmartTagAction > > >& rActionComponentsSequence,
css::uno::Sequence < css::uno::Sequence< sal_Int32 > >& rActionIndicesSequence ) const;
......
......@@ -152,14 +152,14 @@ void SmartTagMgr::RecognizeTextRange(const Reference< text::XTextRange>& xRange,
typedef std::multimap < OUString, ActionReference >::const_iterator SmartTagMapIter;
void SmartTagMgr::GetActionSequences( Sequence < OUString >& rSmartTagTypes,
void SmartTagMgr::GetActionSequences( std::vector< OUString >& rSmartTagTypes,
Sequence < Sequence< Reference< smarttags::XSmartTagAction > > >& rActionComponentsSequence,
Sequence < Sequence< sal_Int32 > >& rActionIndicesSequence ) const
{
rActionComponentsSequence.realloc( rSmartTagTypes.getLength() );
rActionIndicesSequence.realloc( rSmartTagTypes.getLength() );
rActionComponentsSequence.realloc( rSmartTagTypes.size() );
rActionIndicesSequence.realloc( rSmartTagTypes.size() );
for ( sal_Int32 j = 0; j < rSmartTagTypes.getLength(); ++j )
for ( size_t j = 0; j < rSmartTagTypes.size(); ++j )
{
const OUString& rSmartTagType = rSmartTagTypes[j];
......
......@@ -772,7 +772,7 @@ public:
void GetSmartTagRect( const Point& rPt, SwRect& rSelectRect );
// get smart tags at current cursor position
void GetSmartTagTerm( css::uno::Sequence< OUString >& rSmartTagTypes,
void GetSmartTagTerm( std::vector< OUString >& rSmartTagTypes,
css::uno::Sequence< css::uno::Reference< css::container::XStringKeyMap > >& rStringKeyMaps,
css::uno::Reference<css::text::XTextRange>& rRange ) const;
......
......@@ -3365,12 +3365,11 @@ void SwCursorShell::dumpAsXml(xmlTextWriterPtr pWriter) const
xmlTextWriterEndElement(pWriter);
}
static void lcl_FillRecognizerData( uno::Sequence< OUString >& rSmartTagTypes,
static void lcl_FillRecognizerData( std::vector< OUString >& rSmartTagTypes,
uno::Sequence< uno::Reference< container::XStringKeyMap > >& rStringKeyMaps,
const SwWrongList& rSmartTagList, sal_Int32 nCurrent )
{
// Insert smart tag information
std::vector< OUString > aSmartTagTypes;
std::vector< uno::Reference< container::XStringKeyMap > > aStringKeyMaps;
for ( sal_uInt16 i = 0; i < rSmartTagList.Count(); ++i )
......@@ -3383,24 +3382,18 @@ static void lcl_FillRecognizerData( uno::Sequence< OUString >& rSmartTagTypes,
const SwWrongArea* pArea = rSmartTagList.GetElement( i );
if ( pArea )
{
aSmartTagTypes.push_back( pArea->maType );
rSmartTagTypes.push_back( pArea->maType );
aStringKeyMaps.push_back( pArea->mxPropertyBag );
}
}
}
if ( !aSmartTagTypes.empty() )
if ( !rSmartTagTypes.empty() )
{
rSmartTagTypes.realloc( aSmartTagTypes.size() );
rStringKeyMaps.realloc( aSmartTagTypes.size() );
std::vector< OUString >::const_iterator aTypesIter = aSmartTagTypes.begin();
sal_uInt16 i = 0;
for ( aTypesIter = aSmartTagTypes.begin(); aTypesIter != aSmartTagTypes.end(); ++aTypesIter )
rSmartTagTypes[i++] = *aTypesIter;
rStringKeyMaps.realloc( rSmartTagTypes.size() );
std::vector< uno::Reference< container::XStringKeyMap > >::const_iterator aMapsIter = aStringKeyMaps.begin();
i = 0;
sal_uInt16 i = 0;
for ( aMapsIter = aStringKeyMaps.begin(); aMapsIter != aStringKeyMaps.end(); ++aMapsIter )
rStringKeyMaps[i++] = *aMapsIter;
}
......@@ -3423,7 +3416,7 @@ static void lcl_FillTextRange( uno::Reference<text::XTextRange>& rRange,
rRange = xRange;
}
void SwCursorShell::GetSmartTagTerm( uno::Sequence< OUString >& rSmartTagTypes,
void SwCursorShell::GetSmartTagTerm( std::vector< OUString >& rSmartTagTypes,
uno::Sequence< uno::Reference< container::XStringKeyMap > >& rStringKeyMaps,
uno::Reference< text::XTextRange>& rRange ) const
{
......
......@@ -1780,13 +1780,13 @@ void SwTextShell::GetState( SfxItemSet &rSet )
break;
case SID_OPEN_SMARTTAGMENU:
{
uno::Sequence< OUString > aSmartTagTypes;
std::vector< OUString > aSmartTagTypes;
uno::Sequence< uno::Reference< container::XStringKeyMap > > aStringKeyMaps;
uno::Reference<text::XTextRange> xRange;
rSh.GetSmartTagTerm( aSmartTagTypes, aStringKeyMaps, xRange );
if ( xRange.is() && aSmartTagTypes.getLength() )
if ( xRange.is() && !aSmartTagTypes.empty() )
{
uno::Sequence < uno::Sequence< uno::Reference< smarttags::XSmartTagAction > > > aActionComponentsSequence;
uno::Sequence < uno::Sequence< sal_Int32 > > aActionIndicesSequence;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment