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 /editeng | |
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 'editeng')
-rw-r--r-- | editeng/source/misc/unolingu.cxx | 2 | ||||
-rw-r--r-- | editeng/source/xml/xmltxtexp.cxx | 2 | ||||
-rw-r--r-- | editeng/source/xml/xmltxtimp.cxx | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx index c0935283fbda..b8b5676099f1 100644 --- a/editeng/source/misc/unolingu.cxx +++ b/editeng/source/misc/unolingu.cxx @@ -633,7 +633,7 @@ uno::Reference< XDictionary > LinguMgr::GetStandard() if (!xTmpDicList.is()) return nullptr; - static const OUStringLiteral aDicName( u"standard.dic" ); + static constexpr OUStringLiteral aDicName( u"standard.dic" ); uno::Reference< XDictionary > xDic = xTmpDicList->getDictionaryByName( aDicName ); if (!xDic.is()) { diff --git a/editeng/source/xml/xmltxtexp.cxx b/editeng/source/xml/xmltxtexp.cxx index 40278457081f..444a435c3d5b 100644 --- a/editeng/source/xml/xmltxtexp.cxx +++ b/editeng/source/xml/xmltxtexp.cxx @@ -304,7 +304,7 @@ void SvxWriteXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection& uno::Reference<io::XOutputStream> xOut( new utl::OOutputStreamWrapper( rStream ) ); /* testcode - static const OUStringLiteral aURL( u"file:///e:/test.xml" ); + static constexpr OUStringLiteral aURL( u"file:///e:/test.xml" ); SvFileStream aStream(aURL, StreamMode::WRITE | StreamMode::TRUNC); xOut = new utl::OOutputStreamWrapper(aStream); */ diff --git a/editeng/source/xml/xmltxtimp.cxx b/editeng/source/xml/xmltxtimp.cxx index d04e37a822bf..c752a0eb70c5 100644 --- a/editeng/source/xml/xmltxtimp.cxx +++ b/editeng/source/xml/xmltxtimp.cxx @@ -169,7 +169,7 @@ EditPaM SvxReadXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection uno::Reference<io::XInputStream> xInputStream = new utl::OInputStreamWrapper( rStream ); /* testcode - static const OUStringLiteral aURL( u"file:///e:/test.xml" ); + static constexpr OUStringLiteral aURL( u"file:///e:/test.xml" ); SfxMedium aMedium( aURL, StreamMode::READ | STREAM_NOCREATE, sal_True ); uno::Reference<io::XOutputStream> xOut( new utl::OOutputStreamWrapper( *aMedium.GetOutStream() ) ); |