summaryrefslogtreecommitdiff
path: root/sfx2/source/doc/docfac.cxx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2018-12-01 15:19:04 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-12-01 18:26:01 +0100
commit56d97cdd0af15c90c744d2ac66e879818c073ec6 (patch)
tree98278957d27659cfa9fe5e9b1a4e2e550637fd73 /sfx2/source/doc/docfac.cxx
parentfff501a3393b459c512ec155e2d2cd935e7885a2 (diff)
Simplify containers iterations in sfx2, shell
Use range-based loop or replace with STL functions Change-Id: I42361d6a73d201db8eb6dca09d79768e2d62051d Reviewed-on: https://gerrit.libreoffice.org/64389 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/doc/docfac.cxx')
-rw-r--r--sfx2/source/doc/docfac.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index 94205215ea51..ba045e50b803 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -110,11 +110,8 @@ void SfxObjectFactory::RegisterViewFactory
}
}
#endif
- SfxViewFactoryArr_Impl::iterator it = pImpl->aViewFactoryArr.begin();
- for ( ; it != pImpl->aViewFactoryArr.end() &&
- (*it)->GetOrdinal() <= rFactory.GetOrdinal();
- ++it )
- /* empty loop */;
+ auto it = std::find_if(pImpl->aViewFactoryArr.begin(), pImpl->aViewFactoryArr.end(),
+ [&rFactory](SfxViewFactory* pFactory) { return pFactory->GetOrdinal() > rFactory.GetOrdinal(); });
pImpl->aViewFactoryArr.insert(it, &rFactory);
}