diff options
author | Noel Grandin <noel@peralex.com> | 2015-12-03 12:38:01 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-12-03 13:57:23 +0200 |
commit | 2b17ec2175e288b92044092166d5b885978cecff (patch) | |
tree | f57160fe8e3987a5f51f9a6860153732c8811974 | |
parent | e6721d2d17f5f34dcac14c3379521bb7fb6b8c03 (diff) |
uno:Sequence->std::vector in SmartTagMgr
Change-Id: I163f7d6c0f30ac2929df1cae202e695d21bb49fc
-rw-r--r-- | include/svx/SmartTagMgr.hxx | 2 | ||||
-rw-r--r-- | svx/source/smarttags/SmartTagMgr.cxx | 8 | ||||
-rw-r--r-- | sw/inc/crsrsh.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 19 | ||||
-rw-r--r-- | sw/source/uibase/shells/textsh1.cxx | 4 |
5 files changed, 14 insertions, 21 deletions
diff --git a/include/svx/SmartTagMgr.hxx b/include/svx/SmartTagMgr.hxx index 744ff9cebcf8..3a3b3088601c 100644 --- a/include/svx/SmartTagMgr.hxx +++ b/include/svx/SmartTagMgr.hxx @@ -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; diff --git a/svx/source/smarttags/SmartTagMgr.cxx b/svx/source/smarttags/SmartTagMgr.cxx index 6c523cf108d0..ee99934ecdc1 100644 --- a/svx/source/smarttags/SmartTagMgr.cxx +++ b/svx/source/smarttags/SmartTagMgr.cxx @@ -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]; diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 13d8c0c9b219..85f662523ab1 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -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; diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 22afa5177178..47b90854b55e 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -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 { diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 1961204eff06..b768d058a69f 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -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; |