summaryrefslogtreecommitdiff
path: root/sfx2/source/view
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-12 11:52:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-12 18:03:46 +0200
commitd03e7a8fba5494dc10433f33d902683eaae639bb (patch)
tree5ecd804d7330efbd0854235638d76fd504a1ccdd /sfx2/source/view
parente5c33076ab2a4d995e312908ca482b56dd502189 (diff)
speed up simple use of NamedValueCollection
where instantiating and allocating a whole map just to extract a single key is way inefficient Change-Id: I55248bc71a9e8826cab9b76fa6916bfa888efa0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134226 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/view')
-rw-r--r--sfx2/source/view/frmload.cxx3
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx4
2 files changed, 2 insertions, 5 deletions
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index 7c1db6f8b4ac..b3830914adf2 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -544,8 +544,7 @@ SfxInterfaceId SfxFrameLoader_Impl::impl_determineEffectiveViewId_nothrow( const
if ( !( xViewData->getByIndex( 0 ) >>= aViewData ) )
break;
- ::comphelper::NamedValueCollection aNamedViewData( aViewData );
- OUString sViewId = aNamedViewData.getOrDefault( "ViewId", OUString() );
+ OUString sViewId = ::comphelper::NamedValueCollection::getOrDefault( aViewData, u"ViewId", OUString() );
if ( sViewId.isEmpty() )
break;
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 63e787be6b4c..e7c098fcda27 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -1225,9 +1225,7 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect )
if ( i_eConnect == E_CONNECT )
{
css::uno::Reference<css::frame::XModel3> xModel(getModel(), css::uno::UNO_QUERY_THROW);
- ::comphelper::NamedValueCollection aDocumentArgs( xModel->getArgs2( { "PluginMode" } ) );
-
- const sal_Int16 nPluginMode = aDocumentArgs.getOrDefault( "PluginMode", sal_Int16( 0 ) );
+ const sal_Int16 nPluginMode = ::comphelper::NamedValueCollection::getOrDefault( xModel->getArgs2( { "PluginMode" } ), u"PluginMode", sal_Int16( 0 ) );
const bool bHasPluginMode = ( nPluginMode != 0 );
SfxFrame& rFrame = pViewFrame->GetFrame();