summaryrefslogtreecommitdiff
path: root/sw/source/filter/xml/xmlimp.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-06-23 12:34:31 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-06-26 13:12:31 +0200
commit0193b284e880a659ab73160e42238e1d5fe5cf8f (patch)
treeda09299838a6afb43d7c601803a6bab787489854 /sw/source/filter/xml/xmlimp.cxx
parent2ef138de767c312188d41a7f206234eafac3108b (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 'sw/source/filter/xml/xmlimp.cxx')
-rw-r--r--sw/source/filter/xml/xmlimp.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 43fe07ecff4a..4287a6848f4c 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -417,7 +417,7 @@ void SwXMLImport::startDocument()
}
bool bOverwrite = false;
- static const OUStringLiteral sStyleInsertModeOverwrite(u"StyleInsertModeOverwrite");
+ static constexpr OUStringLiteral sStyleInsertModeOverwrite(u"StyleInsertModeOverwrite");
if( xPropertySetInfo->hasPropertyByName(sStyleInsertModeOverwrite) )
{
aAny = xImportInfo->getPropertyValue(sStyleInsertModeOverwrite);
@@ -433,7 +433,7 @@ void SwXMLImport::startDocument()
}
// text insert mode?
- static const OUStringLiteral sTextInsertModeRange(u"TextInsertModeRange");
+ static constexpr OUStringLiteral sTextInsertModeRange(u"TextInsertModeRange");
if( xPropertySetInfo->hasPropertyByName(sTextInsertModeRange) )
{
aAny = xImportInfo->getPropertyValue(sTextInsertModeRange);
@@ -443,7 +443,7 @@ void SwXMLImport::startDocument()
}
// auto text mode
- static const OUStringLiteral sAutoTextMode(u"AutoTextMode");
+ static constexpr OUStringLiteral sAutoTextMode(u"AutoTextMode");
if( xPropertySetInfo->hasPropertyByName(sAutoTextMode) )
{
aAny = xImportInfo->getPropertyValue(sAutoTextMode);
@@ -455,7 +455,7 @@ void SwXMLImport::startDocument()
}
// organizer mode
- static const OUStringLiteral sOrganizerMode(u"OrganizerMode");
+ static constexpr OUStringLiteral sOrganizerMode(u"OrganizerMode");
if( xPropertySetInfo->hasPropertyByName(sOrganizerMode) )
{
aAny = xImportInfo->getPropertyValue(sOrganizerMode);
@@ -467,7 +467,7 @@ void SwXMLImport::startDocument()
}
// default document properties
- static const OUStringLiteral sDefSettings(u"DefaultDocumentSettings");
+ static constexpr OUStringLiteral sDefSettings(u"DefaultDocumentSettings");
if (xPropertySetInfo->hasPropertyByName(sDefSettings))
{
aAny = xImportInfo->getPropertyValue(sDefSettings);