diff options
Diffstat (limited to 'oox/source/vml/vmlshapecontainer.cxx')
-rw-r--r-- | oox/source/vml/vmlshapecontainer.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/oox/source/vml/vmlshapecontainer.cxx b/oox/source/vml/vmlshapecontainer.cxx index 0309839a9817..144aa78f7c28 100644 --- a/oox/source/vml/vmlshapecontainer.cxx +++ b/oox/source/vml/vmlshapecontainer.cxx @@ -118,11 +118,14 @@ const ShapeBase* ShapeContainer::getShapeById( const OUString& rShapeId, bool bD return 0; } -const ShapeBase* ShapeContainer::getFirstShape() const +const ShapeBase* ShapeContainer::takeLastShape() { - OSL_ENSURE( mrDrawing.getType() == VMLDRAWING_WORD, "ShapeContainer::getFirstShape - illegal call, Word filter only" ); - OSL_ENSURE( maShapes.size() == 1, "ShapeContainer::getFirstShape - single shape expected" ); - return maShapes.get( 0 ).get(); + assert( mrDrawing.getType() == VMLDRAWING_WORD ); + if( maShapes.empty()) + return NULL; + const ShapeBase* ret = maShapes.back().get(); + maShapes.pop_back(); + return ret; } void ShapeContainer::convertAndInsert( const Reference< XShapes >& rxShapes, const ShapeParentAnchor* pParentAnchor ) const |