diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-23 13:16:31 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-26 14:51:15 +0100 |
commit | a3d0091d185f39eddabf4d372ebe0ac3061dbb89 (patch) | |
tree | 4d70cedc274972ccc21b6b8e7105f042090cf5d6 /basegfx | |
parent | af791fb775e35c11ad01c42a7085dd121ab9c7a6 (diff) |
New loplugin:stringliteralvar
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for
details.
(Turned some affected variables in included files into inline variables, to
avoid GCC warnings about unused variables.)
Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basegfx')
-rw-r--r-- | basegfx/test/SvgPathImportExport.cxx | 16 | ||||
-rw-r--r-- | basegfx/test/boxclipper.cxx | 2 | ||||
-rw-r--r-- | basegfx/test/clipstate.cxx | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/basegfx/test/SvgPathImportExport.cxx b/basegfx/test/SvgPathImportExport.cxx index 59f87e735815..7fa0468e7042 100644 --- a/basegfx/test/SvgPathImportExport.cxx +++ b/basegfx/test/SvgPathImportExport.cxx @@ -116,7 +116,7 @@ public: CPPUNIT_ASSERT_MESSAGE("importing simple rectangle from SVG-D", utils::importFromSvgD( aPoly, aPath0, false, nullptr )); aExport = utils::exportToSvgD( aPoly, true, true, false ); - const char sExportString[] = "m10 10h-20v-20h20z"; + static const OUStringLiteral sExportString = u"m10 10h-20v-20h20z"; CPPUNIT_ASSERT_EQUAL_MESSAGE("exporting rectangle to SVG-D", OUString(sExportString), aExport ); CPPUNIT_ASSERT_MESSAGE("importing simple rectangle from SVG-D (round-trip", @@ -143,8 +143,8 @@ public: // so for correct unit test i add the new exported string here as sExportStringSimpleBezier // and compare to it. - const char sExportStringSimpleBezier[] = - "m11430 0c-8890 3810 5715 6985 5715 6985" + static const OUStringLiteral sExportStringSimpleBezier = + u"m11430 0c-8890 3810 5715 6985 5715 6985" "l-17145-1905c0 0 22860-10160 16510 6350" "s-3810-11430-3810-11430z"; CPPUNIT_ASSERT_EQUAL_MESSAGE("exporting bezier polygon to SVG-D", OUString(sExportStringSimpleBezier), aExport); @@ -164,8 +164,8 @@ public: // same here, the corrected export with the corrected B2DPolygon is simply more efficient, // so i needed to change the compare string. Also adding the re-import comparison below. - const char sExportString1[] = - "m1917 1114c-89-189-233-284-430-284-167 0-306 91-419 273s-170 370-17" + static const OUStringLiteral sExportString1 = + u"m1917 1114c-89-189-233-284-430-284-167 0-306 91-419 273s-170 370-17" "0 564c0 145 33 259 98 342 65 84 150 126 257 126q115.5 0 231-57s147-97 210-176 99-143 109-190c38-199 76-398 114" "-598zm840 1646c-133 73-312 139-537 197-225 57-440 86-644 87-483-1-866-132-1150-392-284-261-426-619-426-1076 0-" "292 67-560 200-803s321-433 562-569 514-204 821-204c405 0 739 125 1003 374 264 250 396 550 396 899 0 313-88 576" @@ -187,8 +187,8 @@ public: CPPUNIT_ASSERT_MESSAGE("importing complex polygon from SVG-D", utils::importFromSvgD( aPoly, aPath3, false, nullptr )); aExport = utils::exportToSvgD( aPoly, true, true, false ); - const char sExportString2[] = - "m1598 125h306v2334h-306v-1105h-1293v1105h-305v-2334h305v973h1293" + static const OUStringLiteral sExportString2 = + u"m1598 125h306v2334h-306v-1105h-1293v1105h-305v-2334h305v973h1293" "zm2159 1015 78-44 85 235-91 47-91 40-90 34-90 29-89 21-88 16-88 10-88 3-102-4-97" "-12-91-19-85-26-40-16-39-18-38-20-36-22-34-24-33-26-32-27-30-30-29-31-27-33-25-3" "3-23-36-21-36-19-38-18-40-16-40-26-86-18-91-11-97-4-103 3-98 11-94 17-89 24-84 3" @@ -220,7 +220,7 @@ public: utils::createPolygonFromRect( B2DRange(0.0,0.0,4000.0,4000.0) )); aExport = utils::exportToSvgD( B2DPolyPolygon(aRect), false, false, false ); - const char sExportStringRect[] = "M0 0H4000V4000H0Z"; + static const OUStringLiteral sExportStringRect = u"M0 0H4000V4000H0Z"; CPPUNIT_ASSERT_EQUAL_MESSAGE("exporting to rectangle svg-d string", OUString(sExportStringRect), aExport); } diff --git a/basegfx/test/boxclipper.cxx b/basegfx/test/boxclipper.cxx index 47d3584df06e..cca5cabf3766 100644 --- a/basegfx/test/boxclipper.cxx +++ b/basegfx/test/boxclipper.cxx @@ -155,7 +155,7 @@ public: aRandomIntersections.appendElement( aRandomRange, B2VectorOrientation::Negative ); } #else - const char randomSvg[]="m394 783h404v57h-404zm-197-505h571v576h-571zm356-634h75v200h-75zm-40-113h403v588h-403zm93-811h111v494h-111zm-364-619h562v121h-562zm-134-8h292v27h-292zm110 356h621v486h-621zm78-386h228v25h-228zm475-345h201v201h-201zm-2-93h122v126h-122zm-417-243h567v524h-567zm-266-738h863v456h-863zm262-333h315v698h-315zm-328-826h43v393h-43zm830-219h120v664h-120zm-311-636h221v109h-221zm-500 137h628v19h-628zm681-94h211v493h-211zm-366-646h384v355h-384zm-189-199h715v247h-715zm165-459h563v601h-563zm258-479h98v606h-98zm270-517h65v218h-65zm-44-259h96v286h-96zm-599-202h705v468h-705zm216-803h450v494h-450zm-150-22h26v167h-26zm-55-599h50v260h-50zm190-278h490v387h-490zm-290-453h634v392h-634zm257 189h552v300h-552zm-151-690h136v455h-136zm12-597h488v432h-488zm501-459h48v39h-48zm-224-112h429v22h-429zm-281 102h492v621h-492zm519-158h208v17h-208zm-681-563h56v427h-56zm126-451h615v392h-615zm-47-410h598v522h-598zm-32 316h79v110h-79zm-71-129h18v127h-18zm126-993h743v589h-743zm211-430h428v750h-428zm61-554h100v220h-100zm-353-49h658v157h-658zm778-383h115v272h-115zm-249-541h119v712h-119zm203 86h94v40h-94z"; + static const OUStringLiteral randomSvg=u"m394 783h404v57h-404zm-197-505h571v576h-571zm356-634h75v200h-75zm-40-113h403v588h-403zm93-811h111v494h-111zm-364-619h562v121h-562zm-134-8h292v27h-292zm110 356h621v486h-621zm78-386h228v25h-228zm475-345h201v201h-201zm-2-93h122v126h-122zm-417-243h567v524h-567zm-266-738h863v456h-863zm262-333h315v698h-315zm-328-826h43v393h-43zm830-219h120v664h-120zm-311-636h221v109h-221zm-500 137h628v19h-628zm681-94h211v493h-211zm-366-646h384v355h-384zm-189-199h715v247h-715zm165-459h563v601h-563zm258-479h98v606h-98zm270-517h65v218h-65zm-44-259h96v286h-96zm-599-202h705v468h-705zm216-803h450v494h-450zm-150-22h26v167h-26zm-55-599h50v260h-50zm190-278h490v387h-490zm-290-453h634v392h-634zm257 189h552v300h-552zm-151-690h136v455h-136zm12-597h488v432h-488zm501-459h48v39h-48zm-224-112h429v22h-429zm-281 102h492v621h-492zm519-158h208v17h-208zm-681-563h56v427h-56zm126-451h615v392h-615zm-47-410h598v522h-598zm-32 316h79v110h-79zm-71-129h18v127h-18zm126-993h743v589h-743zm211-430h428v750h-428zm61-554h100v220h-100zm-353-49h658v157h-658zm778-383h115v272h-115zm-249-541h119v712h-119zm203 86h94v40h-94z"; B2DPolyPolygon randomPoly; CPPUNIT_ASSERT(utils::importFromSvgD(randomPoly, randomSvg, false, nullptr)); for (auto const& aPolygon : randomPoly) diff --git a/basegfx/test/clipstate.cxx b/basegfx/test/clipstate.cxx index 44e64b8c23d8..94c0246d8312 100644 --- a/basegfx/test/clipstate.cxx +++ b/basegfx/test/clipstate.cxx @@ -127,7 +127,7 @@ public: { utils::B2DClipState aMixedClip; - const char unionSvg[]="m100 10v90h-90v10h-20v-10h-90v-90h-10v-20h10v-90h90v-10h20v10h90v90h10v20z"; + static const OUStringLiteral unionSvg=u"m100 10v90h-90v10h-20v-10h-90v-90h-10v-20h10v-90h90v-10h20v10h90v90h10v20z"; B2DPolyPolygon aTmp1; CPPUNIT_ASSERT(utils::importFromSvgD(aTmp1, unionSvg, false, nullptr)); |