diff options
author | Andrzej Hunt <andrzej@ahunt.org> | 2015-11-21 08:14:05 -0800 |
---|---|---|
committer | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2016-07-20 01:25:51 -0400 |
commit | 5e24489d2f1016b5cf83cacb1f4a85d3777c4cc4 (patch) | |
tree | e75007673501ef74f52f9fc4f58fc3588a4c0b0e /sc | |
parent | cfe9fcbedd38e62d16c0a1bfff90c040efd6c1d1 (diff) |
new loplugin rangedforcopy - use reference in range based for
Inspired by 6e6ae9803796b120e95f6e89575e03c5fd0ed3c2
Change-Id: Ia0f264d3a6bbf076aa5080e3398683e50bc6ef01
Reviewed-on: https://gerrit.libreoffice.org/20190
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit 9d0b06e9f728d01a2d2908e1e56cb4220cd414d5)
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/oox/worksheetbuffer.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/dbgui/pfiltdlg.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/optsolver.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 5 |
4 files changed, 12 insertions, 9 deletions
diff --git a/sc/source/filter/oox/worksheetbuffer.cxx b/sc/source/filter/oox/worksheetbuffer.cxx index e4319194e785..8104f367ead7 100644 --- a/sc/source/filter/oox/worksheetbuffer.cxx +++ b/sc/source/filter/oox/worksheetbuffer.cxx @@ -234,7 +234,7 @@ void WorksheetBuffer::finalizeImport( sal_Int16 nActiveSheet ) { ScDocument& rDoc = getScDocument(); - for ( auto aSheetInfo: maSheetInfos ) + for ( const auto& aSheetInfo: maSheetInfos ) { // make sure at least 1 sheet (the active one) is visible if ( aSheetInfo->mnCalcSheet == nActiveSheet) diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx index c7c8b758c9ca..6de187cfe378 100644 --- a/sc/source/ui/dbgui/pfiltdlg.cxx +++ b/sc/source/ui/dbgui/pfiltdlg.cxx @@ -107,9 +107,9 @@ void ScPivotFilterDlg::dispose() m_pBtnRegExp.clear(); m_pBtnUnique.clear(); m_pFtDbArea.clear(); - for (auto a : aValueEdArr) a.clear(); - for (auto a : aFieldLbArr) a.clear(); - for (auto a : aCondLbArr) a.clear(); + for (auto& a : aValueEdArr) a.clear(); + for (auto& a : aFieldLbArr) a.clear(); + for (auto& a : aCondLbArr) a.clear(); ModalDialog::dispose(); } diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx index 76eac3a7538b..0744602ca764 100644 --- a/sc/source/ui/miscdlgs/optsolver.cxx +++ b/sc/source/ui/miscdlgs/optsolver.cxx @@ -346,13 +346,13 @@ void ScOptSolverDlg::dispose() m_pBtnCancel.clear(); m_pBtnSolve.clear(); mpEdActive.clear(); - for (auto p : mpLeftButton) + for (auto& p : mpLeftButton) p.clear(); - for (auto p : mpRightButton) + for (auto& p : mpRightButton) p.clear(); - for (auto p : mpOperator) + for (auto& p : mpOperator) p.clear(); - for (auto p : mpDelButton) + for (auto& p : mpDelButton) p.clear(); ScAnyRefDlg::dispose(); } diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 127ef26b4ec4..16339d106aa8 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5995,8 +5995,11 @@ static void updateLibreOfficeKitSelection(ScViewData* pViewData, ScDrawLayer* pD Rectangle aBoundingBox; std::vector<OString> aRectangles; - for (auto aRectangle : rRectangles) + for (const auto& rRectangle : rRectangles) { + // We explicitly create a copy, since we need to expand + // the rectangle before coordinate conversion + Rectangle aRectangle(rRectangle); aRectangle.Right() += 1; aRectangle.Bottom() += 1; |