summaryrefslogtreecommitdiff
path: root/slideshow/source/engine/slide/layer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'slideshow/source/engine/slide/layer.cxx')
-rw-r--r--slideshow/source/engine/slide/layer.cxx92
1 files changed, 65 insertions, 27 deletions
diff --git a/slideshow/source/engine/slide/layer.cxx b/slideshow/source/engine/slide/layer.cxx
index b51fcf3f3203..61544aff06bb 100644
--- a/slideshow/source/engine/slide/layer.cxx
+++ b/slideshow/source/engine/slide/layer.cxx
@@ -29,6 +29,9 @@
#include "layer.hxx"
+#include <boost/bind.hpp>
+
+
using namespace ::com::sun::star;
namespace slideshow
@@ -66,8 +69,10 @@ namespace slideshow
const ViewEntryVector::iterator aEnd( maViewEntries.end() );
if( (aIter=std::find_if( maViewEntries.begin(),
aEnd,
- [&rNewView]( const ViewEntry& rViewEntry )
- { return rNewView == rViewEntry.getView(); } ) ) != aEnd )
+ boost::bind<bool>(
+ std::equal_to< ViewSharedPtr >(),
+ boost::bind( &ViewEntry::getView, _1 ),
+ boost::cref( rNewView )))) != aEnd )
{
// already added - just return existing layer
return aIter->mpViewLayer;
@@ -97,8 +102,10 @@ namespace slideshow
const ViewEntryVector::iterator aEnd( maViewEntries.end() );
if( (aIter=std::find_if( maViewEntries.begin(),
aEnd,
- [&rView]( const ViewEntry& rViewEntry )
- { return rView == rViewEntry.getView(); } ) ) == aEnd )
+ boost::bind<bool>(
+ std::equal_to< ViewSharedPtr >(),
+ boost::bind( &ViewEntry::getView, _1 ),
+ boost::cref( rView )))) == aEnd )
{
// View was not added/is already removed
return ViewLayerSharedPtr();
@@ -106,8 +113,10 @@ namespace slideshow
OSL_ENSURE( std::count_if( maViewEntries.begin(),
aEnd,
- [&rView]( const ViewEntry& rViewEntry )
- { return rView == rViewEntry.getView(); } ) == 1,
+ boost::bind<bool>(
+ std::equal_to< ViewSharedPtr >(),
+ boost::bind( &ViewEntry::getView, _1 ),
+ boost::cref( rView ))) == 1,
"Layer::removeView(): view added multiple times" );
ViewLayerSharedPtr pRet( aIter->mpViewLayer );
@@ -120,16 +129,25 @@ namespace slideshow
{
rShape->clearAllViewLayers();
- for( const auto& rViewEntry : maViewEntries )
- rShape->addViewLayer( rViewEntry.getViewLayer(), false );
+ std::for_each( maViewEntries.begin(),
+ maViewEntries.end(),
+ boost::bind(&Shape::addViewLayer,
+ boost::cref(rShape),
+ boost::bind(&ViewEntry::getViewLayer,
+ _1),
+ false ));
}
void Layer::setPriority( const ::basegfx::B1DRange& rPrioRange )
{
if( !mbBackgroundLayer )
{
- for( const auto& rViewEntry : maViewEntries )
- rViewEntry.getViewLayer()->setPriority( rPrioRange );
+ std::for_each( maViewEntries.begin(),
+ maViewEntries.end(),
+ boost::bind( &ViewLayer::setPriority,
+ boost::bind( &ViewEntry::getViewLayer,
+ _1 ),
+ boost::cref(rPrioRange)));
}
}
@@ -165,12 +183,12 @@ namespace slideshow
return false;
maBounds = maNewBounds;
-
if( std::count_if( maViewEntries.begin(),
maViewEntries.end(),
- [this](const ViewEntry& rViewEntry)
- { return rViewEntry.getViewLayer()->resize( this->maBounds ); }
- ) == 0 )
+ boost::bind( &ViewLayer::resize,
+ boost::bind( &ViewEntry::getViewLayer,
+ _1 ),
+ boost::cref(maBounds)) ) == 0 )
{
return false;
}
@@ -190,8 +208,13 @@ namespace slideshow
void Layer::clearContent()
{
// clear content on all view layers
- for( const auto& rViewEntry : maViewEntries )
- rViewEntry.getViewLayer()->clearAll();
+ std::for_each( maViewEntries.begin(),
+ maViewEntries.end(),
+ boost::bind(
+ &ViewLayer::clearAll,
+ boost::bind(
+ &ViewEntry::getViewLayer,
+ _1)));
// layer content cleared, update areas are not sensible
// anymore.
@@ -227,15 +250,24 @@ namespace slideshow
// resulting clip polygon will be empty.
if( aClip.count() )
{
- for( const auto& rViewEntry : maViewEntries ) {
- ViewLayerSharedPtr pViewLayer = rViewEntry.getViewLayer();
-
- // set clip to all view layers
- pViewLayer->setClip( aClip );
-
- // clear update area of view layer
- pViewLayer->clear();
- }
+ // set clip to all view layers
+ std::for_each( maViewEntries.begin(),
+ maViewEntries.end(),
+ boost::bind(
+ &ViewLayer::setClip,
+ boost::bind(
+ &ViewEntry::getViewLayer,
+ _1),
+ boost::cref(aClip)));
+
+ // clear update area on all view layers
+ std::for_each( maViewEntries.begin(),
+ maViewEntries.end(),
+ boost::bind(
+ &ViewLayer::clear,
+ boost::bind(
+ &ViewEntry::getViewLayer,
+ _1)));
mbClipSet = true;
}
@@ -251,8 +283,14 @@ namespace slideshow
mbClipSet = false;
basegfx::B2DPolyPolygon aEmptyClip;
- for( const auto& rViewEntry : maViewEntries )
- rViewEntry.getViewLayer()->setClip( aEmptyClip );
+ std::for_each( maViewEntries.begin(),
+ maViewEntries.end(),
+ boost::bind(
+ &ViewLayer::setClip,
+ boost::bind(
+ &ViewEntry::getViewLayer,
+ _1),
+ boost::cref(aEmptyClip)));
}
clearUpdateRanges();