diff options
| author | Muthu Subramanian <sumuthu@suse.com> | 2012-05-08 13:03:38 +0530 |
|---|---|---|
| committer | Petr Mladek <pmladek@suse.cz> | 2012-06-12 14:23:30 +0200 |
| commit | 1f68d8f644e5b961cd44c549b2dd18176bec6ccd (patch) | |
| tree | e0925fe05d628309cd76ee01ceb692d147c131c5 | |
| parent | ab25d4c548408cfaeec8a61a0d17252d3085a6a1 (diff) | |
n759212: Text over images.
Default text may not make sense to be copied from the
master slide to the slides when there is an image.
Signed-off-by: Petr Mladek <pmladek@suse.cz>
| -rw-r--r-- | oox/inc/oox/drawingml/shape.hxx | 2 | ||||
| -rw-r--r-- | oox/inc/oox/ppt/pptshape.hxx | 2 | ||||
| -rw-r--r-- | oox/source/drawingml/shape.cxx | 4 | ||||
| -rw-r--r-- | oox/source/ppt/pptgraphicshapecontext.cxx | 8 | ||||
| -rw-r--r-- | oox/source/ppt/pptshape.cxx | 6 |
5 files changed, 13 insertions, 9 deletions
diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx index 772f6993289d..51ddc89b5451 100644 --- a/oox/inc/oox/drawingml/shape.hxx +++ b/oox/inc/oox/drawingml/shape.hxx @@ -173,7 +173,7 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & getXShape() const { return mxShape; } - virtual void applyShapeReference( const Shape& rReferencedShape ); + virtual void applyShapeReference( const Shape& rReferencedShape, bool bUseText = true ); const ::std::vector<rtl::OUString>& getExtDrawings() { return maExtDrawings; } void addExtDrawingRelId( const ::rtl::OUString &rRelId ) { maExtDrawings.push_back( rRelId ); } diff --git a/oox/inc/oox/ppt/pptshape.hxx b/oox/inc/oox/ppt/pptshape.hxx index e06fda634af9..e5552f2496b6 100644 --- a/oox/inc/oox/ppt/pptshape.hxx +++ b/oox/inc/oox/ppt/pptshape.hxx @@ -57,7 +57,7 @@ public: const com::sun::star::awt::Rectangle* pShapeRect = 0, ::oox::drawingml::ShapeIdMap* pShapeMap = 0 ); - virtual void applyShapeReference( const oox::drawingml::Shape& rReferencedShape ); + virtual void applyShapeReference( const oox::drawingml::Shape& rReferencedShape, bool bUseText = true ); void setShapeLocation( const oox::ppt::ShapeLocation eShapeLocation ) { meShapeLocation = eShapeLocation; }; ShapeLocation getShapeLocation() const { return meShapeLocation; }; diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index f551b85ce757..102ea91d8ceb 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -234,11 +234,11 @@ void Shape::addShape( } } -void Shape::applyShapeReference( const Shape& rReferencedShape ) +void Shape::applyShapeReference( const Shape& rReferencedShape, bool bUseText ) { OSL_TRACE("apply shape reference: %s to shape id: %s", rtl::OUStringToOString(rReferencedShape.msId, RTL_TEXTENCODING_UTF8 ).getStr(), rtl::OUStringToOString(msId, RTL_TEXTENCODING_UTF8 ).getStr()); - if ( rReferencedShape.mpTextBody.get() ) + if ( rReferencedShape.mpTextBody.get() && bUseText ) mpTextBody = TextBodyPtr( new TextBody( *rReferencedShape.mpTextBody.get() ) ); else mpTextBody.reset(); diff --git a/oox/source/ppt/pptgraphicshapecontext.cxx b/oox/source/ppt/pptgraphicshapecontext.cxx index dd5820aa9925..9efa3e367fca 100644 --- a/oox/source/ppt/pptgraphicshapecontext.cxx +++ b/oox/source/ppt/pptgraphicshapecontext.cxx @@ -198,10 +198,14 @@ Reference< XFastContextHandler > PPTGraphicShapeContext::createFastChildContext( } if ( pPlaceholder.get() ) { - mpShapePtr->applyShapeReference( *pPlaceholder.get() ); + bool bUseText = true; + // TODO: Check if pPlaceholder->getSubType is none (i.e. none explicitly specified) + if( pPlaceholder->getSubType() == XML_obj ) + bUseText = false; + mpShapePtr->applyShapeReference( *pPlaceholder.get(), bUseText ); PPTShape* pPPTShape = dynamic_cast< PPTShape* >( pPlaceholder.get() ); if ( pPPTShape ) - pPPTShape->setReferenced( sal_True ); + pPPTShape->setReferenced( sal_True ); pPPTShapePtr->setPlaceholder( pPlaceholder ); } } diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx index e7a0a4187280..206662956c7b 100644 --- a/oox/source/ppt/pptshape.cxx +++ b/oox/source/ppt/pptshape.cxx @@ -318,7 +318,7 @@ void PPTShape::addShape( aCombinedTextListStyle->apply( *aMasterTextListStyle.get() ); if( mpPlaceholder.get() && mpPlaceholder->getTextBody().get() ) - aCombinedTextListStyle->apply( mpPlaceholder->getTextBody()->getTextListStyle() ); + aCombinedTextListStyle->apply( mpPlaceholder->getTextBody()->getTextListStyle() ); aCombinedTextListStyle->apply( getTextBody()->getTextListStyle() ); setMasterTextListStyle( aCombinedTextListStyle ); @@ -361,9 +361,9 @@ void PPTShape::addShape( } } -void PPTShape::applyShapeReference( const oox::drawingml::Shape& rReferencedShape ) +void PPTShape::applyShapeReference( const oox::drawingml::Shape& rReferencedShape, bool bUseText ) { - Shape::applyShapeReference( rReferencedShape ); + Shape::applyShapeReference( rReferencedShape, bUseText ); } oox::drawingml::ShapePtr PPTShape::findPlaceholder( const sal_Int32 nMasterPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes ) |
