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 /cui | |
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 'cui')
-rw-r--r-- | cui/source/dialogs/hlmarkwn.cxx | 6 | ||||
-rw-r--r-- | cui/source/tabpages/chardlg.cxx | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx index 04b50b44e309..96b61a7e2806 100644 --- a/cui/source/dialogs/hlmarkwn.cxx +++ b/cui/source/dialogs/hlmarkwn.cxx @@ -293,9 +293,9 @@ int SvxHlinkDlgMarkWnd::FillTree( const uno::Reference< container::XNameAccess > const sal_Int32 nLinks = aNames.getLength(); const OUString* pNames = aNames.getConstArray(); - static const OUStringLiteral aProp_LinkDisplayName( u"LinkDisplayName" ); - static const OUStringLiteral aProp_LinkTarget( u"com.sun.star.document.LinkTarget" ); - static const OUStringLiteral aProp_LinkDisplayBitmap( u"LinkDisplayBitmap" ); + static constexpr OUStringLiteral aProp_LinkDisplayName( u"LinkDisplayName" ); + static constexpr OUStringLiteral aProp_LinkTarget( u"com.sun.star.document.LinkTarget" ); + static constexpr OUStringLiteral aProp_LinkDisplayBitmap( u"LinkDisplayBitmap" ); for( sal_Int32 i = 0; i < nLinks; i++ ) { uno::Any aAny; diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 79cb8d454e39..ae7414c5b5e5 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -3010,7 +3010,7 @@ bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet ) void SvxCharPositionPage::FillUserData() { - static const OUStringLiteral cTok( u";" ); + static constexpr OUStringLiteral cTok( u";" ); OUString sUser = OUString::number( m_nSuperEsc ) + cTok + OUString::number( m_nSubEsc ) + cTok + |