[PATCH libreoffice-3-6] bnc#798309 inherit group style from parent

Noel Power (via Code Review) gerrit at gerrit.libreoffice.org
Wed Mar 13 05:13:59 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2701

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/01/2701/1

bnc#798309 inherit group style from parent

Change-Id: Ie4f1d244f1c9b4935305742d12cabaee3e38647c
---
M oox/inc/oox/drawingml/shape.hxx
M oox/source/drawingml/chart/chartdrawingfragment.cxx
M oox/source/drawingml/shape.cxx
M oox/source/ppt/dgmimport.cxx
M oox/source/ppt/pptshape.cxx
M oox/source/ppt/slidepersist.cxx
M oox/source/shape/ShapeContextHandler.cxx
7 files changed, 22 insertions(+), 12 deletions(-)



diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index 09ea502..b1b423d 100644
--- a/oox/inc/oox/drawingml/shape.hxx
+++ b/oox/inc/oox/drawingml/shape.hxx
@@ -156,6 +156,7 @@
                             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 );
 
@@ -190,7 +191,9 @@
                             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 @@
                     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 66a1ee1..a5fead9 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -201,6 +201,7 @@
         const Theme* pTheme,
         const Reference< XShapes >& rxShapes,
         basegfx::B2DHomMatrix& aTransformation,
+        FillProperties& rShapeOrParentShapeFillProps,
         const awt::Rectangle* pShapeRect,
         ShapeIdMap* pShapeMap )
 {
@@ -212,7 +213,7 @@
         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() )
             {
@@ -316,7 +317,7 @@
     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 );
     }
 }
 
@@ -328,7 +329,8 @@
         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);
@@ -519,7 +521,12 @@
         }
 
         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() );
 
         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 @@
     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 2f2e330..d176277 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -338,7 +338,7 @@
             } 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 @@
             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 @@
             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 @@
                     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 @@
         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( );
         }

-- 
To view, visit https://gerrit.libreoffice.org/2701
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie4f1d244f1c9b4935305742d12cabaee3e38647c
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-3-6
Gerrit-Owner: Noel Power <noel.power at suse.com>



More information about the LibreOffice mailing list