summaryrefslogtreecommitdiff
path: root/editeng/source/outliner/outliner.cxx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-02-20 01:10:07 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-02-20 07:17:38 +0100
commit6a143985bdc5d12d1f9e8cf8592440282986c099 (patch)
tree346e09d6ba1146b52a6a484a2883f3e898184648 /editeng/source/outliner/outliner.cxx
parentd707a5e64ba53ddb7669cca725915527aa788a6b (diff)
Simplify containers iterations in desktop, dtrans, editeng, extensions
Use range-based loop or replace with STL functions Change-Id: Ic5389d123d0a6a32a8bb46b081165e94a7c55292 Reviewed-on: https://gerrit.libreoffice.org/68036 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source/outliner/outliner.cxx')
-rw-r--r--editeng/source/outliner/outliner.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 19fb8fa0ec47..a7ec83d0837d 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -1292,16 +1292,12 @@ size_t Outliner::InsertView( OutlinerView* pView, size_t nIndex )
void Outliner::RemoveView( OutlinerView const * pView )
{
-
- for ( ViewList::iterator it = aViewList.begin(); it != aViewList.end(); ++it )
+ ViewList::iterator it = std::find(aViewList.begin(), aViewList.end(), pView);
+ if (it != aViewList.end())
{
- if ( *it == pView )
- {
- pView->pEditView->HideCursor(); // HACK
- pEditEngine->RemoveView( pView->pEditView.get() );
- aViewList.erase( it );
- break;
- }
+ pView->pEditView->HideCursor(); // HACK
+ pEditEngine->RemoveView( pView->pEditView.get() );
+ aViewList.erase( it );
}
}