summaryrefslogtreecommitdiff
path: root/sc/qa
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 /sc/qa
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 'sc/qa')
-rw-r--r--sc/qa/extras/macros-test.cxx8
-rw-r--r--sc/qa/unit/screenshots/screenshots.cxx2
2 files changed, 5 insertions, 5 deletions
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index b35266db5b03..5adf672a7915 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -269,9 +269,9 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf89920)
CPPUNIT_TEST_FIXTURE(ScMacrosTest, testPasswordProtectedUnicodeString)
{
const OUString sCorrectString(u"English Русский 中文");
- static const OUStringLiteral sMacroURL(
+ static constexpr OUStringLiteral sMacroURL(
u"vnd.sun.Star.script:Protected.Module1.TestUnicodeString?language=Basic&location=document");
- static const OUStringLiteral sLibName(u"Protected");
+ static constexpr OUStringLiteral sLibName(u"Protected");
createScDoc("tdf57113.ods");
@@ -309,9 +309,9 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testPasswordProtectedUnicodeString)
CPPUNIT_TEST_FIXTURE(ScMacrosTest, testPasswordProtectedArrayInUserType)
{
- static const OUStringLiteral sMacroURL(
+ static constexpr OUStringLiteral sMacroURL(
u"vnd.sun.Star.script:Protected.Module1.TestMyType?language=Basic&location=document");
- static const OUStringLiteral sLibName(u"Protected");
+ static constexpr OUStringLiteral sLibName(u"Protected");
createScDoc("ProtectedArrayInCustomType.ods");
diff --git a/sc/qa/unit/screenshots/screenshots.cxx b/sc/qa/unit/screenshots/screenshots.cxx
index b22eb2a3ed46..68752e6cab35 100644
--- a/sc/qa/unit/screenshots/screenshots.cxx
+++ b/sc/qa/unit/screenshots/screenshots.cxx
@@ -132,7 +132,7 @@ VclPtr<VclAbstractDialog> ScScreenshotTest::createDialogByID(sal_uInt32 nID)
{
VclPtr<VclAbstractDialog> pReturnDialog;
////FIXME: translatable string here
- static const OUStringLiteral aDefaultSheetName(u"Sheet1");
+ static constexpr OUStringLiteral aDefaultSheetName(u"Sheet1");
switch ( nID )
{