summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-10-21 12:41:53 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-11-04 08:51:00 +0100
commit5de73f04f3db9c8fb488bf75b1860bf8378a5b45 (patch)
tree162ce145c1bec1ac5b41b5caa5bac1591c54c11a /vcl
parentdce64cc7cfd5f696ef0c030524558306687ae3c7 (diff)
new loplugin:staticconstexpr
Change-Id: Ida1996dfffa106bf95fd064e8191b8033b4002f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175336 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/pdfexport/pdfexport2.cxx12
-rw-r--r--vcl/skia/gdiimpl.cxx2
-rw-r--r--vcl/skia/salbmp.cxx24
-rw-r--r--vcl/source/app/svmain.cxx2
4 files changed, 20 insertions, 20 deletions
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx
index 72b2038b7d73..4bd91576bfec 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx
@@ -4592,7 +4592,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testRexportMediaBoxOrigin)
auto pInnerIm = aDocument.LookupObject(12);
CPPUNIT_ASSERT(pInnerIm);
- constexpr sal_Int32 aOrigin[2] = { -800, -600 };
+ static constexpr sal_Int32 aOrigin[2] = { -800, -600 };
sal_Int32 aSize[2] = { 0, 0 };
auto pBBox = dynamic_cast<vcl::filter::PDFArrayElement*>(pInnerIm->Lookup("BBox"_ostr));
@@ -4692,11 +4692,11 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf152246)
CPPUNIT_ASSERT_EQUAL(size_t(1), aPages.size());
// Position array
- constexpr double aPos[5][4] = { { 55.699, 706.701, 132.401, 722.499 },
- { 197.499, 706.701, 274.201, 722.499 },
- { 302.349, 679.101, 379.051, 694.899 },
- { 479.599, 679.101, 556.301, 694.899 },
- { 55.699, 651.501, 132.401, 667.299 } };
+ static constexpr double aPos[5][4] = { { 55.699, 706.701, 132.401, 722.499 },
+ { 197.499, 706.701, 274.201, 722.499 },
+ { 302.349, 679.101, 379.051, 694.899 },
+ { 479.599, 679.101, 556.301, 694.899 },
+ { 55.699, 651.501, 132.401, 667.299 } };
// Get page annotations.
auto pAnnots = dynamic_cast<vcl::filter::PDFArrayElement*>(aPages[0]->Lookup("Annots"_ostr));
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index f6c7d21374bf..c97a1bebca5e 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -1521,7 +1521,7 @@ void SkiaSalGraphicsImpl::invert(basegfx::B2DPolygon const& rPoly, SalInvert eFl
// by clipping.
getDrawCanvas()->clipRect(aPath.getBounds(), SkClipOp::kIntersect, false);
aPaint.setStrokeWidth(2);
- constexpr float intervals[] = { 4.0f, 4.0f };
+ static constexpr float intervals[] = { 4.0f, 4.0f };
aPaint.setStyle(SkPaint::kStroke_Style);
aPaint.setPathEffect(SkDashPathEffect::Make(intervals, std::size(intervals), 0));
}
diff --git a/vcl/skia/salbmp.cxx b/vcl/skia/salbmp.cxx
index bba67fcbc439..d517d425eaf1 100644
--- a/vcl/skia/salbmp.cxx
+++ b/vcl/skia/salbmp.cxx
@@ -529,10 +529,10 @@ bool SkiaSalBitmap::ConvertToGreyscale()
// values from Bitmap::ImplMakeGreyscales(). Do not use kGray_8_SkColorType,
// Skia would use its gray conversion formula.
// NOTE: The matrix is 4x5 organized as columns (i.e. each line is a column, not a row).
- constexpr SkColorMatrix toGray(77 / 256.0, 151 / 256.0, 28 / 256.0, 0, 0, // R column
- 77 / 256.0, 151 / 256.0, 28 / 256.0, 0, 0, // G column
- 77 / 256.0, 151 / 256.0, 28 / 256.0, 0, 0, // B column
- 0, 0, 0, 1, 0); // don't modify alpha
+ static constexpr SkColorMatrix toGray(77 / 256.0, 151 / 256.0, 28 / 256.0, 0, 0, // R column
+ 77 / 256.0, 151 / 256.0, 28 / 256.0, 0, 0, // G column
+ 77 / 256.0, 151 / 256.0, 28 / 256.0, 0, 0, // B column
+ 0, 0, 0, 1, 0); // don't modify alpha
paint.setColorFilter(SkColorFilters::Matrix(toGray));
surface->getCanvas()->drawImage(mImage, 0, 0, SkSamplingOptions(), &paint);
mBitCount = 8;
@@ -987,10 +987,10 @@ const sk_sp<SkImage>& SkiaSalBitmap::GetAlphaSkImage(DirectImage direct) const
// Move the R channel value to the alpha channel. This seems to be the only
// way to reinterpret data in SkImage as an alpha SkImage without accessing the pixels.
// NOTE: The matrix is 4x5 organized as columns (i.e. each line is a column, not a row).
- constexpr SkColorMatrix redToAlpha(0, 0, 0, 0, 0, // R column
- 0, 0, 0, 0, 0, // G column
- 0, 0, 0, 0, 0, // B column
- 1, 0, 0, 0, 0); // A column
+ static constexpr SkColorMatrix redToAlpha(0, 0, 0, 0, 0, // R column
+ 0, 0, 0, 0, 0, // G column
+ 0, 0, 0, 0, 0, // B column
+ 1, 0, 0, 0, 0); // A column
SkPaint paint;
paint.setColorFilter(SkColorFilters::Matrix(redToAlpha));
if (scaling)
@@ -1046,10 +1046,10 @@ const sk_sp<SkImage>& SkiaSalBitmap::GetAlphaSkImage(DirectImage direct) const
// Move the R channel value to the alpha channel. This seems to be the only
// way to reinterpret data in SkImage as an alpha SkImage without accessing the pixels.
// NOTE: The matrix is 4x5 organized as columns (i.e. each line is a column, not a row).
- constexpr SkColorMatrix redToAlpha(0, 0, 0, 0, 0, // R column
- 0, 0, 0, 0, 0, // G column
- 0, 0, 0, 0, 0, // B column
- 1, 0, 0, 0, 0); // A column
+ static constexpr SkColorMatrix redToAlpha(0, 0, 0, 0, 0, // R column
+ 0, 0, 0, 0, 0, // G column
+ 0, 0, 0, 0, 0, // B column
+ 1, 0, 0, 0, 0); // A column
paint.setColorFilter(SkColorFilters::Matrix(redToAlpha));
surface->getCanvas()->drawImage(GetAsSkBitmap().asImage(), 0, 0, SkSamplingOptions(),
&paint);
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index a8a2412aa810..9ef22da996e6 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -197,7 +197,7 @@ int ImplSVMain()
#if !defined(_WIN32) && !defined(SYSTEM_OPENSSL)
if (!bWasInitVCL)
{
- OUString constexpr name(u"SSL_CERT_FILE"_ustr);
+ static constexpr OUString name(u"SSL_CERT_FILE"_ustr);
OUString temp;
if (osl_getEnvironment(name.pData, &temp.pData) == osl_Process_E_NotFound)
{