From 9d0b06e9f728d01a2d2908e1e56cb4220cd414d5 Mon Sep 17 00:00:00 2001 From: Andrzej Hunt Date: Sat, 21 Nov 2015 08:14:05 -0800 Subject: 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 Reviewed-by: Stephan Bergmann --- dbaccess/source/ui/dlg/queryorder.cxx | 4 ++-- dbaccess/source/ui/querydesign/JoinTableView.cxx | 2 +- dbaccess/source/ui/querydesign/QueryTableView.cxx | 4 ++-- dbaccess/source/ui/querydesign/TableWindowTitle.cxx | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'dbaccess') diff --git a/dbaccess/source/ui/dlg/queryorder.cxx b/dbaccess/source/ui/dlg/queryorder.cxx index 9d7ff34d15c9..13fb716b4296 100644 --- a/dbaccess/source/ui/dlg/queryorder.cxx +++ b/dbaccess/source/ui/dlg/queryorder.cxx @@ -138,8 +138,8 @@ void DlgOrderCrit::dispose() m_pLB_ORDERVALUE2.clear(); m_pLB_ORDERFIELD3.clear(); m_pLB_ORDERVALUE3.clear(); - for (auto a : m_aColumnList) a.clear(); - for (auto a : m_aValueList) a.clear(); + for (auto& a : m_aColumnList) a.clear(); + for (auto& a : m_aValueList) a.clear(); ModalDialog::dispose(); } diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index 70379a872a0f..bfff9a8874a0 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -950,7 +950,7 @@ void OJoinTableView::InvalidateConnections() void OJoinTableView::DrawConnections(vcl::RenderContext& rRenderContext, const Rectangle& rRect) { // draw Joins - for(auto connection : m_vTableConnection) + for(const auto& connection : m_vTableConnection) connection->Draw(rRenderContext, rRect); // finally redraw the selected one above all others if (GetSelectedConn()) diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx index fb53cd47acb2..40f43aae2b7b 100644 --- a/dbaccess/source/ui/querydesign/QueryTableView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx @@ -893,7 +893,7 @@ bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc // the Connections auto rTableCon = pUndoAction->GetTabConnList(); - for(auto conn : rTableCon) + for(const auto& conn : rTableCon) addConnection(conn); // add all connections from the undo action rTableCon.clear(); @@ -935,7 +935,7 @@ void OQueryTableView::InsertField(const OTableFieldDescRef& rInfo) bool OQueryTableView::ExistsAVisitedConn(const OQueryTableWindow* pFrom) const { - for(auto conn : getTableConnections()) + for(const auto& conn : getTableConnections()) { OQueryTableConnection* pTemp = static_cast(conn.get()); if (pTemp->IsVisited() && diff --git a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx index 9db6d52b979c..8da722265150 100644 --- a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx @@ -142,7 +142,7 @@ void OTableWindowTitle::MouseButtonDown( const MouseEvent& rEvt ) OJoinTableView* pView = static_cast(m_pTabWin->getTableView()); OSL_ENSURE(pView,"No OJoinTableView!"); - for (auto conn : pView->getTableConnections()) + for (auto& conn : pView->getTableConnections()) conn->RecalcLines(); pView->InvalidateConnections(); -- cgit