summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/querydesign/QueryTableView.cxx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-02-24 17:09:03 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-02-25 08:06:57 +0100
commit435b64ecb6289a5ebfb8474f81dac032aaccfa4c (patch)
treeb105af973d612852dded93c5ed07ca4600ecd332 /dbaccess/source/ui/querydesign/QueryTableView.cxx
parent970ca8de0be4c4cd9485170f3c56a34b4069eec2 (diff)
Simplify containers iterations in dbaccess
Use range-based loop or replace with STL functions Change-Id: I01b4d97fa77ef8daf88e8e006b9523a6b71786cf Reviewed-on: https://gerrit.libreoffice.org/68286 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess/source/ui/querydesign/QueryTableView.cxx')
-rw-r--r--dbaccess/source/ui/querydesign/QueryTableView.cxx12
1 files changed, 4 insertions, 8 deletions
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index 9f5c8a1520b9..79ebb89fc69d 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -738,14 +738,10 @@ void OQueryTableView::HideTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc
getDesignView()->SaveTabWinUIConfig(pTabWin);
// (I need to go via the parent, as only the parent knows the position of the scrollbars)
// and then out of the TabWins list and hide
- OTableWindowMap::const_iterator aIter = rTabWins.begin();
- OTableWindowMap::const_iterator aEnd = rTabWins.end();
- for ( ;aIter != aEnd ; ++aIter )
- if ( aIter->second == pTabWin )
- {
- rTabWins.erase( aIter );
- break;
- }
+ OTableWindowMap::const_iterator aIter = std::find_if(rTabWins.begin(), rTabWins.end(),
+ [&pTabWin](const OTableWindowMap::value_type& rEntry) { return rEntry.second == pTabWin; });
+ if (aIter != rTabWins.end())
+ rTabWins.erase( aIter );
pTabWin->Hide(); // do not destroy it, as it is still in the undo list!!