[Libreoffice-commits] core.git: Branch 'distro/suse/suse-3.6' - oox/inc oox/source sc/source

Noel Power noel.power at suse.com
Wed Mar 13 06:57:20 PDT 2013


 oox/inc/oox/drawingml/shape.hxx                     |    5 ++++-
 oox/source/drawingml/chart/chartdrawingfragment.cxx |    2 +-
 oox/source/drawingml/shape.cxx                      |   15 +++++++++++----
 oox/source/ppt/dgmimport.cxx                        |    2 +-
 oox/source/ppt/pptshape.cxx                         |    2 +-
 oox/source/ppt/slidepersist.cxx                     |    2 +-
 oox/source/shape/ShapeContextHandler.cxx            |    6 +++---
 sc/source/filter/oox/drawingfragment.cxx            |    2 +-
 8 files changed, 23 insertions(+), 13 deletions(-)

New commits:
commit c7cecd5aa84d7c3db0691221c298139cb6b849a8
Author: Noel Power <noel.power at suse.com>
Date:   Wed Mar 13 13:55:46 2013 +0000

    bnc#798309 inherit group style from parent
    
    Change-Id: Ic689a0a17f1d88466feba0cba0d5e96a13ddb99f

diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index b93469d..4ec9455 100644
--- a/oox/inc/oox/drawingml/shape.hxx
+++ b/oox/inc/oox/drawingml/shape.hxx
@@ -158,6 +158,7 @@ public:
                             const Theme* pTheme,
                             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
                             basegfx::B2DHomMatrix& aTransformation,
+                            FillProperties& rShapeOrParentShapeFillProps,
                             const ::com::sun::star::awt::Rectangle* pShapeRect = 0,
                             ShapeIdMap* pShapeMap = 0 );
 
@@ -192,7 +193,9 @@ protected:
                             const ::com::sun::star::awt::Rectangle* pShapeRect,
                             sal_Bool bClearText,
                             sal_Bool bDoNotInsertEmptyTextBody,
-                            basegfx::B2DHomMatrix& aTransformation );
+                            basegfx::B2DHomMatrix& aTransformation,
+                            FillProperties& rShapeOrParentShapeFillProps
+                             );
 
     void                addChildren(
                             ::oox::core::XmlFilterBase& rFilterBase,
diff --git a/oox/source/drawingml/chart/chartdrawingfragment.cxx b/oox/source/drawingml/chart/chartdrawingfragment.cxx
index 4d0109b..6d0540f 100644
--- a/oox/source/drawingml/chart/chartdrawingfragment.cxx
+++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx
@@ -226,7 +226,7 @@ void ChartDrawingFragment::onEndElement()
                     getLimitedValue< sal_Int32, sal_Int64 >( aShapeRectEmu.Width, 0, SAL_MAX_INT32 ),
                     getLimitedValue< sal_Int32, sal_Int64 >( aShapeRectEmu.Height, 0, SAL_MAX_INT32 ) );
                 basegfx::B2DHomMatrix aMatrix;
-                mxShape->addShape( getFilter(), getFilter().getCurrentTheme(), mxDrawPage, aMatrix, &aShapeRectEmu32 );
+                mxShape->addShape( getFilter(), getFilter().getCurrentTheme(), mxDrawPage, aMatrix, mxShape->getFillProperties(), &aShapeRectEmu32 );
             }
         }
         mxShape.reset();
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index fbe1553..295987d 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -204,6 +204,7 @@ void Shape::addShape(
         const Theme* pTheme,
         const Reference< XShapes >& rxShapes,
         basegfx::B2DHomMatrix& aTransformation,
+        FillProperties& rShapeOrParentShapeFillProps,
         const awt::Rectangle* pShapeRect,
         ShapeIdMap* pShapeMap )
 {
@@ -215,7 +216,7 @@ void Shape::addShape(
         if( !sServiceName.isEmpty() )
         {
             basegfx::B2DHomMatrix aMatrix( aTransformation );
-            Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, pShapeRect, sal_False, sal_False, aMatrix ) );
+            Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, pShapeRect, sal_False, sal_False, aMatrix, rShapeOrParentShapeFillProps ) );
 
             if( pShapeMap && !msId.isEmpty() )
             {
@@ -320,7 +321,7 @@ void Shape::addChildren(
     std::vector< ShapePtr >::iterator aIter( rMaster.maChildren.begin() );
     while( aIter != rMaster.maChildren.end() ) {
         (*aIter)->setMasterTextListStyle( mpMasterTextListStyle );
-        (*aIter++)->addShape( rFilterBase, pTheme, rxShapes, aChildTransformation, NULL, pShapeMap );
+        (*aIter++)->addShape( rFilterBase, pTheme, rxShapes, aChildTransformation, getFillProperties(), NULL, pShapeMap );
     }
 }
 
@@ -332,7 +333,8 @@ Reference< XShape > Shape::createAndInsert(
         const awt::Rectangle* /* pShapeRect */,
         sal_Bool bClearText,
         sal_Bool bDoNotInsertEmptyTextBody,
-        basegfx::B2DHomMatrix& aParentTransformation )
+        basegfx::B2DHomMatrix& aParentTransformation,
+        FillProperties& rShapeOrParentShapeFillProps )
 {
     bool bIsEmbMedia = false;
     SAL_INFO("oox", OSL_THIS_FUNC << " id: " << msId);
@@ -527,7 +529,12 @@ Reference< XShape > Shape::createAndInsert(
         }
 
         aLineProperties.assignUsed( getLineProperties() );
-        aFillProperties.assignUsed( getFillProperties() );
+
+        // group fill inherits from parent
+        if ( getFillProperties().moFillType.has() && getFillProperties().moFillType.get() == XML_grpFill )
+            aFillProperties.assignUsed( rShapeOrParentShapeFillProps );
+        else
+            aFillProperties.assignUsed( getFillProperties() );
         aEffectProperties.assignUsed ( getEffectProperties() );
 
         ShapePropertyMap aShapeProps( rFilterBase.getModelObjectHelper() );
diff --git a/oox/source/ppt/dgmimport.cxx b/oox/source/ppt/dgmimport.cxx
index 004c09f..a196286 100644
--- a/oox/source/ppt/dgmimport.cxx
+++ b/oox/source/ppt/dgmimport.cxx
@@ -88,7 +88,7 @@ bool QuickDiagrammingImport::importDocument() throw()
     pShape->addShape( *this,
                       pTheme.get(),
                       xParentShape,
-                      aMatrix );
+                      aMatrix, pShape->getFillProperties() );
 
     return true;
 }
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index bbe12cb..77d943e 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -367,7 +367,7 @@ void PPTShape::addShape(
             } else
                 setMasterTextListStyle( aMasterTextListStyle );
 
-            Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, pShapeRect, bClearText, mpPlaceholder.get() != NULL, aTransformation ) );
+            Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, pShapeRect, bClearText, mpPlaceholder.get() != NULL, aTransformation, getFillProperties() ) );
                 if ( !rSlidePersist.isMasterPage() && rSlidePersist.getPage().is() && ( (sal_Int32)mnSubType == XML_title ) )
                  {
                     try
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index 77432ae..2a7de5a 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -154,7 +154,7 @@ void SlidePersist::createXShapes( XmlFilterBase& rFilterBase )
             if ( pPPTShape )
                 pPPTShape->addShape( rFilterBase, *this, getTheme().get(), xShapes, aTransformation, 0, &getShapeMap() );
             else
-                (*aChildIter)->addShape( rFilterBase, getTheme().get(), xShapes, aTransformation, 0, &getShapeMap() );
+                (*aChildIter)->addShape( rFilterBase, getTheme().get(), xShapes, aTransformation, maShapesPtr->getFillProperties(), 0, &getShapeMap() );
             aChildIter++;
         }
     }
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 418ca7c..600b957 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -299,7 +299,7 @@ ShapeContextHandler::getShape() throw (uno::RuntimeException)
             basegfx::B2DHomMatrix aMatrix;
             if (mpShape->getExtDrawings().size() == 0)
             {
-                mpShape->addShape( *mxFilterBase, mpThemePtr.get(), xShapes, aMatrix );
+                mpShape->addShape( *mxFilterBase, mpThemePtr.get(), xShapes, aMatrix, mpShape->getFillProperties() );
                 xResult = mpShape->getXShape();
             }
             else
@@ -311,7 +311,7 @@ ShapeContextHandler::getShape() throw (uno::RuntimeException)
                     rtl::OUString aFragmentPath(pDiagramGraphicDataContext->getFragmentPathFromRelId(*aIt));
                     oox::drawingml::ShapePtr pShapePtr( new Shape( "com.sun.star.drawing.GroupShape" ) );
                     mxFilterBase->importFragment(new ShapeDrawingFragmentHandler(*mxFilterBase, aFragmentPath, pShapePtr));
-                    pShapePtr->addShape( *mxFilterBase, mpThemePtr.get(), xShapes, aMatrix );
+                    pShapePtr->addShape( *mxFilterBase, mpThemePtr.get(), xShapes, aMatrix, pShapePtr->getFillProperties() );
                     xResult = pShapePtr->getXShape();
                 }
                 mpShape.reset((Shape*)0);
@@ -321,7 +321,7 @@ ShapeContextHandler::getShape() throw (uno::RuntimeException)
         else if (mpShape.get() != NULL)
         {
             basegfx::B2DHomMatrix aTransformation;
-            mpShape->addShape(*mxFilterBase, mpThemePtr.get(), xShapes, aTransformation);
+            mpShape->addShape(*mxFilterBase, mpThemePtr.get(), xShapes, aTransformation, mpShape->getFillProperties() );
             xResult.set(mpShape->getXShape());
             mxGraphicShapeContext.clear( );
         }
diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx
index 6e8dc5e..c8f6b5e 100644
--- a/sc/source/filter/oox/drawingfragment.cxx
+++ b/sc/source/filter/oox/drawingfragment.cxx
@@ -295,7 +295,7 @@ void DrawingFragment::onEndElement()
                     mxShape->setSize(Size(aShapeRectEmu.Width, aShapeRectEmu.Height));
 
                     basegfx::B2DHomMatrix aTransformation;
-                    mxShape->addShape( getOoxFilter(), &getTheme(), mxDrawPage, aTransformation, &aShapeRectEmu32 );
+                    mxShape->addShape( getOoxFilter(), &getTheme(), mxDrawPage, aTransformation, mxShape->getFillProperties(), &aShapeRectEmu32 );
 
                     /*  Collect all shape positions in the WorksheetHelper base
                         class. But first, scale EMUs to 1/100 mm. */


More information about the Libreoffice-commits mailing list