diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-15 10:58:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-15 12:43:21 +0200 |
commit | 3a1a448ac4a04137705ea0aaf0163358fd2e5549 (patch) | |
tree | 0a7eeeebda959b1b8e7e1af99453c3f8b0541852 /vcl | |
parent | 88a6ac9f75a4375b72111af5a3e004bef4226455 (diff) |
loplugin:constvars
Change-Id: I9b35d6333afa6b305bf73fc55a7e60c8365674e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122134
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/backendtest/GraphicsRenderTests.cxx | 2 | ||||
-rw-r--r-- | vcl/headless/svpgdi.cxx | 4 | ||||
-rw-r--r-- | vcl/source/app/salvtables.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/button.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/imivctl1.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/printdlg.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/fontmanager/fontconfig.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtkinst.cxx | 2 |
10 files changed, 12 insertions, 12 deletions
diff --git a/vcl/backendtest/GraphicsRenderTests.cxx b/vcl/backendtest/GraphicsRenderTests.cxx index 7928c06e2fb0..dc4483442fd6 100644 --- a/vcl/backendtest/GraphicsRenderTests.cxx +++ b/vcl/backendtest/GraphicsRenderTests.cxx @@ -2125,7 +2125,7 @@ std::vector<VclTestResult>& GraphicsRenderTests::getTestResults() { return m_aTe OUString GraphicsRenderTests::getResultString() { std::vector<int> testResults(4); - for (VclTestResult& test : m_aTestResult) + for (const VclTestResult& test : m_aTestResult) { if (test.getStatus() == "PASSED") { diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index c87a90e3fbf9..316349088e9e 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -589,7 +589,7 @@ namespace // MM02 decide to use buffers or not const char* pDisableMM02Goodies(getenv("SAL_DISABLE_MM02_GOODIES")); bool bUseBuffer(nullptr == pDisableMM02Goodies); - tools::Long nMinimalSquareSizeToBuffer(64*64); + const tools::Long nMinimalSquareSizeToBuffer(64*64); void tryToUseSourceBuffer( const SalBitmap& rSourceBitmap, @@ -1627,7 +1627,7 @@ bool SvpSalGraphics::drawPolyLine( assert(!bStrokeUsed || (bStrokeUsed && pStroke)); // MM01 decide if to stroke directly - static bool bDoDirectCairoStroke(true); + static const bool bDoDirectCairoStroke(true); // MM01 activate to stroke directly if(bDoDirectCairoStroke && bStrokeUsed) diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 61eacb855af4..5a907cd45e8e 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1126,7 +1126,7 @@ IMPL_LINK(SalInstanceToolbar, MenuToggleListener, VclWindowEvent&, rEvent, void) { if (rEvent.GetId() == VclEventId::WindowEndPopupMode) { - for (auto& rFloat : m_aFloats) + for (const auto& rFloat : m_aFloats) { if (rEvent.GetWindow() == rFloat.second) { diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 0554bcfb3446..cb7581b35c76 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -2949,7 +2949,7 @@ void RadioButton::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) OUString sGroupId; std::vector<VclPtr<RadioButton>> aGroup = GetRadioButtonGroup(); - for(auto& pButton : aGroup) + for(const auto& pButton : aGroup) sGroupId += pButton->get_id(); if (!sGroupId.isEmpty()) diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 2eae406b4299..0e828a941662 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -451,7 +451,7 @@ void SvxIconChoiceCtrl_Impl::Arrange( bool bKeepPredecessors, tools::Long nSetMa void SvxIconChoiceCtrl_Impl::ImpArrange( bool bKeepPredecessors ) { - static Point aEmptyPoint; + static const Point aEmptyPoint; bool bOldUpdate = bUpdateMode; tools::Rectangle aCurOutputArea( GetOutputRect() ); diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 31aea83a9685..2aa85ce2075c 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -4461,7 +4461,7 @@ bool PDFWriterImpl::emitAnnotations() bool PDFWriterImpl::emitEmbeddedFiles() { - for (auto& rEmbeddedFile : m_aEmbeddedFiles) + for (const auto& rEmbeddedFile : m_aEmbeddedFiles) { if (!updateObject(rEmbeddedFile.m_nObject)) continue; diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 1a4d179e1809..a3ae03980540 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -1678,7 +1678,7 @@ void Dialog::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) { auto aResponses = rJsonWriter.startArray("responses"); - for (auto& rResponse : mpDialogImpl->maResponses) + for (const auto& rResponse : mpDialogImpl->maResponses) { auto aResponse = rJsonWriter.startStruct(); rJsonWriter.put("id", rResponse.first->get_id()); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index c6fde48ef28c..6f1e2a008c2d 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -379,7 +379,7 @@ void PrintDialog::PrintPreviewWindow::preparePreviewBitmap() // gets really bad for FormControls starting by a scale factor // smaller than 0.2 - that makes the ClipRegion overlap start. // So - for now - try not to go below that. - static double fMinimumScale(0.2); + static const double fMinimumScale(0.2); double fFactor(0.0); if(fScale < fMinimumScale) { @@ -395,7 +395,7 @@ void PrintDialog::PrintPreviewWindow::preparePreviewBitmap() // necessary, also empirically estimated to // avoid the quality from collapsing (using a direct // in-between , ceil'd result) - static double fMaximumQualitySquare(1396221.0); + static const double fMaximumQualitySquare(1396221.0); if(fNewNeededPixels > fMaximumQualitySquare) { diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 18a0408d34ae..9ae5004d5256 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -668,7 +668,7 @@ void PrintFontManager::countFontconfigFonts( std::unordered_map<OString, int>& o if( eIndexRes == FcResultMatch && nEntryId != -1 ) { int nCollectionEntry = GetCollectionIndex(nEntryId); - for (auto & font : aFonts) + for (const auto & font : aFonts) { if( font.m_nCollectionEntry == nCollectionEntry ) { diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 79e22ea4fb3d..3899bb35c29f 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -10913,7 +10913,7 @@ private: void signal_item_toggled(GtkToggleButton* pItem) { - for (auto& a : m_aMenuButtonMap) + for (const auto& a : m_aMenuButtonMap) { if (a.second->getWidget() == GTK_WIDGET(pItem)) { |