slideshow/source/engine/slide/shapemanagerimpl.cxx | 17 +++++++++++++++++ slideshow/source/engine/slide/shapemanagerimpl.hxx | 5 +++++ slideshow/source/engine/slide/slideimpl.cxx | 8 ++++---- 3 files changed, 26 insertions(+), 4 deletions(-)
New commits: commit f7f8706b404b5b61856fbc3e96985b5ca70ee78c Author: Michael Jaumann <meta_...@yahoo.com> Date: Fri Mar 6 10:58:34 2015 +0000 addShape for shapemanagerimpl Change-Id: I965760aa642126cf4616e7f89b4d4859efb0823a diff --git a/slideshow/source/engine/slide/shapemanagerimpl.cxx b/slideshow/source/engine/slide/shapemanagerimpl.cxx index f364b2d..a2e68b0 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.cxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.cxx @@ -397,6 +397,23 @@ void ShapeManagerImpl::implAddShape( const ShapeSharedPtr& rShape ) notifyShapeUpdate( rShape ); } +void ShapeManagerImpl::addShape( const ShapeSharedPtr& rShape ) +{ + ENSURE_OR_THROW( rShape, "ShapeManagerImpl::addShape(): invalid Shape" ); + + // add shape to XShape hash map + if( !maXShapeHash.insert( + XShapeHash::value_type( rShape->getXShape(), + rShape) ).second ) + { + // entry already present, nothing to do + return; + } + + // add shape to appropriate layer + implAddShape( rShape ); +} + void ShapeManagerImpl::implRemoveShape( const ShapeSharedPtr& rShape ) { ENSURE_OR_THROW( rShape, "ShapeManagerImpl::implRemoveShape(): invalid Shape" ); diff --git a/slideshow/source/engine/slide/shapemanagerimpl.hxx b/slideshow/source/engine/slide/shapemanagerimpl.hxx index 05d94e2..108e58a 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.hxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.hxx @@ -68,6 +68,11 @@ public: CursorManager& rCursorManager, const ShapeEventListenerMap& rGlobalListenersMap, const ShapeCursorMap& rGlobalCursorMap ); + /** Add the shape to this object + + This method adds a shape to the page. + */ + void addShape( const ShapeSharedPtr& rShape ); /** Enables event listening. diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index 4c7f294..7d7ef62 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -1049,15 +1049,15 @@ bool SlideImpl::loadShapes() 0, /* shape num starts at 0 */ true ); - /* mpLayerManager->addShape( - aMPShapesFunctor.importBackgroundShape() );*/ + mpShapeManager->addShape( + aMPShapesFunctor.importBackgroundShape() ); while( !aMPShapesFunctor.isImportDone() ) { ShapeSharedPtr const& rShape( aMPShapesFunctor.importShape() ); if( rShape ) - /* mpLayerManager->addShape( rShape );*/; + mpShapeManager->addShape( rShape );; } addPolygons(aMPShapesFunctor.getPolygons()); @@ -1102,7 +1102,7 @@ bool SlideImpl::loadShapes() ShapeSharedPtr const& rShape( aShapesFunctor.importShape() ); if( rShape ) - /*mpLayerManager->addShape( rShape );*/; + mpShapeManager->addShape( rShape );; } addPolygons(aShapesFunctor.getPolygons()); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits