diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-15 21:20:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-17 18:45:56 +0200 |
commit | 429a960e157f3375e795cdec8f265ace1c5bdc9e (patch) | |
tree | f36bea7935a5e5fb9cd6e57765fed6d8c8690928 /framework/source/uielement/uicommanddescription.cxx | |
parent | 4417c30d6aa8d415f1f63364bb5dedcd44ae5562 (diff) |
elide some OUString allocation
Change-Id: Iadd73477bf3b0edaa0fb7db10f9ffca88fe737e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134476
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source/uielement/uicommanddescription.cxx')
-rw-r--r-- | framework/source/uielement/uicommanddescription.cxx | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/framework/source/uielement/uicommanddescription.cxx b/framework/source/uielement/uicommanddescription.cxx index 793bc9db8fe0..8054cf4bff8d 100644 --- a/framework/source/uielement/uicommanddescription.cxx +++ b/framework/source/uielement/uicommanddescription.cxx @@ -266,17 +266,24 @@ Any ConfigurationAccess_UICommand::getSequenceFromCache( const OUString& aComman if ( !pIter->second.bCommandNameCreated ) fillInfoFromResult( pIter->second, pIter->second.aLabel ); + static constexpr OUStringLiteral sLabel = u"Label"; + static constexpr OUStringLiteral sName = u"Name"; + static constexpr OUStringLiteral sPopup = u"Popup"; + static constexpr OUStringLiteral sPopupLabel = u"PopupLabel"; + static constexpr OUStringLiteral sTooltipLabel = u"TooltipLabel"; + static constexpr OUStringLiteral sTargetURL = u"TargetURL"; + static constexpr OUStringLiteral sIsExperimental = u"IsExperimental"; Sequence< PropertyValue > aPropSeq{ - comphelper::makePropertyValue("Label", !pIter->second.aContextLabel.isEmpty() + comphelper::makePropertyValue(sLabel, !pIter->second.aContextLabel.isEmpty() ? Any(pIter->second.aContextLabel) : Any(pIter->second.aLabel)), - comphelper::makePropertyValue("Name", pIter->second.aCommandName), - comphelper::makePropertyValue("Popup", pIter->second.bPopup), + comphelper::makePropertyValue(sName, pIter->second.aCommandName), + comphelper::makePropertyValue(sPopup, pIter->second.bPopup), comphelper::makePropertyValue(m_aPropProperties, pIter->second.nProperties), - comphelper::makePropertyValue("PopupLabel", pIter->second.aPopupLabel), - comphelper::makePropertyValue("TooltipLabel", pIter->second.aTooltipLabel), - comphelper::makePropertyValue("TargetURL", pIter->second.aTargetURL), - comphelper::makePropertyValue("IsExperimental", pIter->second.bIsExperimental) + comphelper::makePropertyValue(sPopupLabel, pIter->second.aPopupLabel), + comphelper::makePropertyValue(sTooltipLabel, pIter->second.aTooltipLabel), + comphelper::makePropertyValue(sTargetURL, pIter->second.aTargetURL), + comphelper::makePropertyValue(sIsExperimental, pIter->second.bIsExperimental) }; return Any( aPropSeq ); } |