diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-29 10:13:01 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-31 15:49:07 +0100 |
commit | 5b54ba7084d6b575814af26be30cf5af5dfca12c (patch) | |
tree | 38f1fd7bfca54886c34f6bcbdd9220d3f1a90f13 /svx/source/smarttags | |
parent | 3d469248ada8632a9d86efc80f2ac97dcb617c27 (diff) |
Prepare for removal of non-const operator[] from Sequence in svx
Change-Id: Ib5fda9469f9a1987cf9071c0e228c582cfb3dfa1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124397
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svx/source/smarttags')
-rw-r--r-- | svx/source/smarttags/SmartTagMgr.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/svx/source/smarttags/SmartTagMgr.cxx b/svx/source/smarttags/SmartTagMgr.cxx index 6b28dec427d4..913590833217 100644 --- a/svx/source/smarttags/SmartTagMgr.cxx +++ b/svx/source/smarttags/SmartTagMgr.cxx @@ -137,7 +137,9 @@ void SmartTagMgr::GetActionSequences( std::vector< OUString >& rSmartTagTypes, Sequence < Sequence< sal_Int32 > >& rActionIndicesSequence ) const { rActionComponentsSequence.realloc( rSmartTagTypes.size() ); + auto pActionComponentsSequence = rActionComponentsSequence.getArray(); rActionIndicesSequence.realloc( rSmartTagTypes.size() ); + auto pActionIndicesSequence = rActionIndicesSequence.getArray(); for ( size_t j = 0; j < rSmartTagTypes.size(); ++j ) { @@ -146,19 +148,21 @@ void SmartTagMgr::GetActionSequences( std::vector< OUString >& rSmartTagTypes, const sal_Int32 nNumberOfActionRefs = maSmartTagMap.count( rSmartTagType ); Sequence< Reference< smarttags::XSmartTagAction > > aActions( nNumberOfActionRefs ); + auto aActionsRange = asNonConstRange(aActions); Sequence< sal_Int32 > aIndices( nNumberOfActionRefs ); + auto aIndicesRange = asNonConstRange(aIndices); sal_uInt16 i = 0; auto iters = maSmartTagMap.equal_range( rSmartTagType ); for ( auto aActionsIter = iters.first; aActionsIter != iters.second; ++aActionsIter ) { - aActions[ i ] = (*aActionsIter).second.mxSmartTagAction; - aIndices[ i++ ] = (*aActionsIter).second.mnSmartTagIndex; + aActionsRange[ i ] = (*aActionsIter).second.mxSmartTagAction; + aIndicesRange[ i++ ] = (*aActionsIter).second.mnSmartTagIndex; } - rActionComponentsSequence[ j ] = aActions; - rActionIndicesSequence[ j ] = aIndices; + pActionComponentsSequence[ j ] = aActions; + pActionIndicesSequence[ j ] = aIndices; } } @@ -375,8 +379,7 @@ void SmartTagMgr::PrepareConfiguration( std::u16string_view rConfigurationGroupN beans::PropertyValue aPathArgument; aPathArgument.Name = "nodepath"; aPathArgument.Value = aAny; - Sequence< Any > aArguments( 1 ); - aArguments[ 0 ] <<= aPathArgument; + Sequence< Any > aArguments{ Any(aPathArgument) }; Reference< lang::XMultiServiceFactory > xConfProv = configuration::theDefaultProvider::get( mxContext ); // try to get read-write access to configuration: |