summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2013-03-12 20:37:15 +0000
committerFridrich Strba <fridrich@documentfoundation.org>2013-03-13 15:09:23 +0000
commit2f13a6e26d6741688c62decdee91e821ee1bd471 (patch)
tree2cb97ea895c20d3a8d73e5b4e0102c2a9686cef4
parentee84eaa33aef7b7523ce949ad3e2ccf9bc467c6d (diff)
bnc#798309 inherit group style from parent
Change-Id: Ie4f1d244f1c9b4935305742d12cabaee3e38647c (cherry picked from commit 1dbd088e4fb9597b0e2f5e4c4db6ecf047d85da3) Reviewed-on: https://gerrit.libreoffice.org/2695 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r--oox/inc/oox/drawingml/shape.hxx5
-rw-r--r--oox/source/drawingml/chart/chartdrawingfragment.cxx2
-rw-r--r--oox/source/drawingml/shape.cxx15
-rw-r--r--oox/source/ppt/dgmimport.cxx2
-rw-r--r--oox/source/ppt/pptshape.cxx2
-rw-r--r--oox/source/ppt/slidepersist.cxx2
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx6
-rw-r--r--sc/source/filter/oox/drawingfragment.cxx2
8 files changed, 23 insertions, 13 deletions
diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index 4e2b4914f05e..b46b4efbeb40 100644
--- a/oox/inc/oox/drawingml/shape.hxx
+++ b/oox/inc/oox/drawingml/shape.hxx
@@ -149,6 +149,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 );
@@ -183,7 +184,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 be05de9675c5..702d7d842974 100644
--- a/oox/source/drawingml/chart/chartdrawingfragment.cxx
+++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx
@@ -215,7 +215,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 fa5f8e08c4b3..9200fa24278e 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -195,6 +195,7 @@ void Shape::addShape(
const Theme* pTheme,
const Reference< XShapes >& rxShapes,
basegfx::B2DHomMatrix& aTransformation,
+ FillProperties& rShapeOrParentShapeFillProps,
const awt::Rectangle* pShapeRect,
ShapeIdMap* pShapeMap )
{
@@ -206,7 +207,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() )
{
@@ -311,7 +312,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 );
}
}
@@ -323,7 +324,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);
@@ -515,7 +517,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 edb571f17ebb..1d866630b3bb 100644
--- a/oox/source/ppt/dgmimport.cxx
+++ b/oox/source/ppt/dgmimport.cxx
@@ -79,7 +79,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 e42321ed70d7..c0764e50ba90 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -332,7 +332,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 77a1601a5d2d..5567613409a3 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -145,7 +145,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 eeeae937be3f..dc38256260d3 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -290,7 +290,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
@@ -302,7 +302,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);
@@ -312,7 +312,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 d187a4f72db2..261473dfeb5d 100644
--- a/sc/source/filter/oox/drawingfragment.cxx
+++ b/sc/source/filter/oox/drawingfragment.cxx
@@ -281,7 +281,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. */