slideshow/source/engine/slide/shapemanagerimpl.cxx | 43 +-------------------- slideshow/source/engine/slide/shapemanagerimpl.hxx | 5 -- 2 files changed, 5 insertions(+), 43 deletions(-)
New commits: commit 56e5ebf66ae2ec84824f1e2c62e5540e19420619 Author: Michael Jaumann <meta_...@yahoo.com> Date: Mon Mar 9 11:13:45 2015 +0000 no more layers Change-Id: I87209817af833dcb49efc9078b368447efb624a9 diff --git a/slideshow/source/engine/slide/shapemanagerimpl.cxx b/slideshow/source/engine/slide/shapemanagerimpl.cxx index 0db4f80..db96265 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.cxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.cxx @@ -56,24 +56,14 @@ ShapeManagerImpl::ShapeManagerImpl( const UnoViewContainer& rViews, { } -template<typename LayerFunc, - typename ShapeFunc> void ShapeManagerImpl::manageViews( - LayerFunc layerFunc, +template<typename ShapeFunc> void ShapeManagerImpl::manageViews( ShapeFunc shapeFunc ) { - LayerSharedPtr pCurrLayer; ViewLayerSharedPtr pCurrViewLayer; LayerShapeMap::const_iterator aIter( maAllShapes.begin() ); const LayerShapeMap::const_iterator aEnd ( maAllShapes.end() ); while( aIter != aEnd ) { - LayerSharedPtr pLayer = aIter->second.lock(); - if( pLayer && pLayer != pCurrLayer ) - { - pCurrLayer = pLayer; - pCurrViewLayer = layerFunc(pCurrLayer); - } - if( pCurrViewLayer ) shapeFunc(aIter->first,pCurrViewLayer); @@ -283,12 +273,7 @@ void ShapeManagerImpl::viewAdded( const UnoViewSharedPtr& rView ) rView->clearAll(); // add View to all registered shapes - manageViews( - boost::bind(&Layer::addView, - _1, - boost::cref(rView)), - // repaint on view add - boost::bind(&Shape::addViewLayer, + manageViews(boost::bind(&Shape::addViewLayer, _1, _2, true) ); @@ -302,11 +287,7 @@ void ShapeManagerImpl::viewRemoved( const UnoViewSharedPtr& rView ) rView) == mrViews.end() ); // remove View from all registered shapes - manageViews( - boost::bind(&Layer::removeView, - _1, - boost::cref(rView)), - boost::bind(&Shape::removeViewLayer, + manageViews(boost::bind(&Shape::removeViewLayer, _1, _2) ); } @@ -332,8 +313,6 @@ void ShapeManagerImpl::viewsChanged() mrViews.end(), ::boost::mem_fn(&View::clearAll) ); - // TODO(F3): resize and repaint all layers - // render all shapes std::for_each( maAllShapes.begin(), maAllShapes.end(), @@ -545,27 +524,11 @@ void ShapeManagerImpl::implRemoveShape( const ShapeSharedPtr& rShape ) if( aShapeEntry == maAllShapes.end() ) return; - - const bool bShapeUpdateNotified = maUpdateShapes.erase( rShape ) != 0; - // Enter shape area to the update area, but only if shape // is visible and not in sprite mode (otherwise, updating // the area doesn't do actual harm, but costs time) // Actually, also add it if it was listed in // maUpdateShapes (might have just gone invisible). - if( bShapeUpdateNotified || - (rShape->isVisible() && - !rShape->isBackgroundDetached()) ) - { - LayerSharedPtr pLayer = aShapeEntry->second.lock(); - if( pLayer ) - { - // store area early, once the shape is removed from - // the layers, it no longer has any view references - pLayer->addUpdateRange( rShape->getUpdateArea() ); - } - } - rShape->clearAllViewLayers(); maAllShapes.erase( aShapeEntry ); } diff --git a/slideshow/source/engine/slide/shapemanagerimpl.hxx b/slideshow/source/engine/slide/shapemanagerimpl.hxx index c1b9916..797bdc6 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.hxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.hxx @@ -145,9 +145,7 @@ private: method. The only point of variation at those places are removal vs. adding. */ - template<typename LayerFunc, - typename ShapeFunc> void manageViews( LayerFunc layerFunc, - ShapeFunc shapeFunc ); + template<typename ShapeFunc> void manageViews(ShapeFunc shapeFunc ); // ShapeManager interface @@ -200,6 +198,7 @@ private: bool updateSprites(); + /** Common stuff when adding a shape */ void implAddShape( const ShapeSharedPtr& rShape ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits