diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-12 11:52:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-12 18:03:46 +0200 |
commit | d03e7a8fba5494dc10433f33d902683eaae639bb (patch) | |
tree | 5ecd804d7330efbd0854235638d76fd504a1ccdd /dbaccess/source/ui/app/AppController.cxx | |
parent | e5c33076ab2a4d995e312908ca482b56dd502189 (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 'dbaccess/source/ui/app/AppController.cxx')
-rw-r--r-- | dbaccess/source/ui/app/AppController.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index ec83eff76574..06508d5c2e0e 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -348,8 +348,7 @@ void SAL_CALL OApplicationController::disposing() OUString sUrl = m_xModel->getURL(); if ( !sUrl.isEmpty() ) { - ::comphelper::NamedValueCollection aArgs( m_xModel->getArgs() ); - if ( aArgs.getOrDefault( "PickListEntry", true ) ) + if ( ::comphelper::NamedValueCollection::getOrDefault( m_xModel->getArgs(), u"PickListEntry", true ) ) { OUString aFilter; INetURLObject aURL( m_xModel->getURL() ); @@ -907,8 +906,7 @@ namespace bool bHandled = false; // try handling the error with an interaction handler - ::comphelper::NamedValueCollection aArgs( _rxDocument->getArgs() ); - Reference< XInteractionHandler > xHandler( aArgs.getOrDefault( "InteractionHandler", Reference< XInteractionHandler >() ) ); + Reference< XInteractionHandler > xHandler = ::comphelper::NamedValueCollection::getOrDefault( _rxDocument->getArgs(), u"InteractionHandler", Reference< XInteractionHandler >() ); if ( xHandler.is() ) { rtl::Reference pRequest( new ::comphelper::OInteractionRequest( _rException ) ); @@ -2514,8 +2512,7 @@ void OApplicationController::OnFirstControllerConnected() { // If the migration just happened, but was not successful, the document is reloaded. // In this case, we should not show the warning, again. - ::comphelper::NamedValueCollection aModelArgs( m_xModel->getArgs() ); - if ( aModelArgs.getOrDefault( "SuppressMigrationWarning", false ) ) + if ( ::comphelper::NamedValueCollection::getOrDefault( m_xModel->getArgs(), u"SuppressMigrationWarning", false ) ) return; // also, if the document is read-only, then no migration is possible, and the |