diff options
author | Andrzej Hunt <andrzej@ahunt.org> | 2015-11-21 08:14:05 -0800 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-01-05 11:06:52 +0000 |
commit | 9d0b06e9f728d01a2d2908e1e56cb4220cd414d5 (patch) | |
tree | 072f69061281445cf3591f55592b87402dcd14d9 /sc/source/ui | |
parent | d202f851717bb5a8fe5fed98f747a1fd164d3225 (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>
Diffstat (limited to 'sc/source/ui')
-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 |
3 files changed, 11 insertions, 8 deletions
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 ecfd538ad142..bb1ae4311d43 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5953,8 +5953,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; |