diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-06-23 12:34:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-06-26 13:12:31 +0200 |
commit | 0193b284e880a659ab73160e42238e1d5fe5cf8f (patch) | |
tree | da09299838a6afb43d7c601803a6bab787489854 /svx/source/tbxctrls | |
parent | 2ef138de767c312188d41a7f206234eafac3108b (diff) |
new loplugin:constexprliteral
OUStringLiteral should be declared constexpr, to enforce
that it is initialised at compile-time and not runtime.
This seems to make a different at least on Visual Studio
Change-Id: I1698f5fa22ddb480347c2f4d444530c2e0e88d92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153499
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/tbxctrls')
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbunosearchcontrollers.cxx | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index eb7ab2e61410..8833ed524d01 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -4213,7 +4213,7 @@ void SvxCurrencyToolBoxControl::inner_GetCurrencySymbols( CollatorWrapper aCollator( ::comphelper::getProcessComponentContext() ); aCollator.loadDefaultCollator( Application::GetSettings().GetLanguageTag().getLocale(), 0 ); - static const OUStringLiteral aTwoSpace(u" "); + static constexpr OUStringLiteral aTwoSpace(u" "); // appending "long symbol" list for( sal_uInt16 i = 1; i < nCount; ++i ) diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 9ae446b50346..aaa7cddb4fd4 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -296,7 +296,7 @@ IMPL_LINK(FindTextFieldControl, KeyInputHdl, const KeyEvent&, rKeyEvent, bool) aValue >>= xLayoutManager; if (xLayoutManager.is()) { - static const OUStringLiteral sResourceURL( u"private:resource/toolbar/findbar" ); + static constexpr OUStringLiteral sResourceURL( u"private:resource/toolbar/findbar" ); xLayoutManager->hideElement( sResourceURL ); xLayoutManager->destroyElement( sResourceURL ); } @@ -1126,7 +1126,7 @@ void SAL_CALL ExitSearchToolboxController::execute( sal_Int16 /*KeyModifier*/ ) aValue >>= xLayoutManager; if (xLayoutManager.is()) { - static const OUStringLiteral sResourceURL( u"private:resource/toolbar/findbar" ); + static constexpr OUStringLiteral sResourceURL( u"private:resource/toolbar/findbar" ); xLayoutManager->hideElement( sResourceURL ); xLayoutManager->destroyElement( sResourceURL ); } @@ -1371,7 +1371,7 @@ void SAL_CALL FindbarDispatcher::dispatch( const css::util::URL& aURL, const css if (!xLayoutManager.is()) return; - static const OUStringLiteral sResourceURL( u"private:resource/toolbar/findbar" ); + static constexpr OUStringLiteral sResourceURL( u"private:resource/toolbar/findbar" ); css::uno::Reference< css::ui::XUIElement > xUIElement = xLayoutManager->getElement(sResourceURL); if (!xUIElement.is()) { |