[Libreoffice-commits] .: oox/inc oox/source

Muthu Subramanian sumuthu at kemper.freedesktop.org
Tue May 8 00:15:24 PDT 2012


 oox/inc/oox/drawingml/shape.hxx           |    2 +-
 oox/inc/oox/ppt/pptshape.hxx              |    2 +-
 oox/source/drawingml/shape.cxx            |    4 ++--
 oox/source/ppt/pptgraphicshapecontext.cxx |    8 ++++++--
 oox/source/ppt/pptshape.cxx               |    6 +++---
 5 files changed, 13 insertions(+), 9 deletions(-)

New commits:
commit 90352e5f1e50291960c944f9a1f44ab3e91d6503
Author: Muthu Subramanian <sumuthu at suse.com>
Date:   Tue May 8 13:03:38 2012 +0530

    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.

diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index 6989ede..f2553fb 100644
--- a/oox/inc/oox/drawingml/shape.hxx
+++ b/oox/inc/oox/drawingml/shape.hxx
@@ -174,7 +174,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 07ab723..e171f24 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 0019195..9bdb962 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -230,11 +230,11 @@ void Shape::addShape(
     }
 }
 
-void Shape::applyShapeReference( const Shape& rReferencedShape )
+void Shape::applyShapeReference( const Shape& rReferencedShape, bool bUseText )
 {
     SAL_INFO("oox", "apply shape reference: " << rReferencedShape.msId << " to shape id: " << msId);
 
-    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 70fa5dd..e174b3f 100644
--- a/oox/source/ppt/pptgraphicshapecontext.cxx
+++ b/oox/source/ppt/pptgraphicshapecontext.cxx
@@ -158,10 +158,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 2e2f4f4..d7fba77 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -331,7 +331,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 );
@@ -374,9 +374,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 )


More information about the Libreoffice-commits mailing list