[Libreoffice-commits] .: Branch 'libreoffice-3-5' - oox/inc oox/source

Petr Mladek pmladek at kemper.freedesktop.org
Tue Jun 12 05:24:04 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 1f68d8f644e5b961cd44c549b2dd18176bec6ccd
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.
    
    Signed-off-by: Petr Mladek <pmladek at suse.cz>

diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index 772f699..51ddc89 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 e06fda6..e5552f2 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 f551b85..102ea91 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 dd5820a..9efa3e3 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 e7a0a41..2066629 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 )


More information about the Libreoffice-commits mailing list