summaryrefslogtreecommitdiff
path: root/slideshow/source/engine/slideshowimpl.cxx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2018-11-27 22:17:40 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-29 12:06:44 +0100
commit0ded54c33f01d18d2cd06547bd8307bd140cf28f (patch)
treee250a9a8bb89b2042d9a0bc09f80bf65757eec19 /slideshow/source/engine/slideshowimpl.cxx
parent7d311ea864e7cfeb1c8f4ca417911db20d13361e (diff)
Simplify containers iterations in slideshow, sot, starmath, stoc
Use range-based loop or replace with STL functions Change-Id: I94792c28b283a0998bf813317e5beb37d93e0c23 Reviewed-on: https://gerrit.libreoffice.org/64125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'slideshow/source/engine/slideshowimpl.cxx')
-rw-r--r--slideshow/source/engine/slideshowimpl.cxx28
1 files changed, 8 insertions, 20 deletions
diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx
index 9b7eadb65cd6..b2437e4b147d 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -870,14 +870,7 @@ ActivitySharedPtr SlideShowImpl::createSlideTransition(
PolygonMap::iterator SlideShowImpl::findPolygons( uno::Reference<drawing::XDrawPage> const& xDrawPage)
{
// TODO(P2): optimize research in the map.
- PolygonMap::iterator aEnd = maPolygons.end();
- for( PolygonMap::iterator aIter = maPolygons.begin();
- aIter != aEnd;
- ++aIter )
- if( aIter->first == xDrawPage )
- return aIter;
-
- return aEnd;
+ return maPolygons.find(xDrawPage);
}
SlideSharedPtr SlideShowImpl::makeSlide(
@@ -1769,19 +1762,14 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty )
&& (aValues[1] >>= bValue))
{
// Look up the view.
- for (UnoViewVector::const_iterator
- iView (maViewContainer.begin()),
- iEnd (maViewContainer.end());
- iView!=iEnd;
- ++iView)
+ auto iView = std::find_if(maViewContainer.begin(), maViewContainer.end(),
+ [&xView](const UnoViewSharedPtr& rxView) { return rxView && rxView->getUnoView() == xView; });
+ if (iView != maViewContainer.end())
{
- if (*iView && (*iView)->getUnoView()==xView)
- {
- // Store the flag at the view so that media shapes have
- // access to it.
- (*iView)->setIsSoundEnabled(bValue);
- return true;
- }
+ // Store the flag at the view so that media shapes have
+ // access to it.
+ (*iView)->setIsSoundEnabled(bValue);
+ return true;
}
}
}