summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/drawingml/table/tableproperties.hxx2
-rw-r--r--oox/source/drawingml/table/tablecell.cxx6
-rw-r--r--oox/source/drawingml/table/tablecontext.cxx2
-rw-r--r--oox/source/drawingml/table/tableproperties.cxx1
4 files changed, 11 insertions, 0 deletions
diff --git a/oox/inc/drawingml/table/tableproperties.hxx b/oox/inc/drawingml/table/tableproperties.hxx
index dd50cd7a694d..010fc67df416 100644
--- a/oox/inc/drawingml/table/tableproperties.hxx
+++ b/oox/inc/drawingml/table/tableproperties.hxx
@@ -54,6 +54,7 @@ public:
void setBandRow(bool b) { mbBandRow = b; };
bool isBandCol() const { return mbBandCol; };
void setBandCol(bool b) { mbBandCol = b; };
+ Color& getBgColor(){ return maBgColor; };
void pushToPropSet( const ::oox::core::XmlFilterBase& rFilterBase,
const css::uno::Reference < css::beans::XPropertySet > & xPropSet,
@@ -70,6 +71,7 @@ private:
std::shared_ptr< TableStyle > mpTableStyle; // or the complete TableStyle
std::vector< sal_Int32 > mvTableGrid;
std::vector< TableRow > mvTableRows;
+ Color maBgColor;
bool mbFirstRow;
bool mbFirstCol;
diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx
index 48f73b269e6a..24e1a5f89c1c 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -424,6 +424,12 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesTopLeftToBottomRight, PROP_DiagonalTLBR );
applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesBottomLeftToTopRight, PROP_DiagonalBLTR );
+ if (rProperties.getBgColor().isUsed() && !maFillProperties.maFillColor.isUsed() && maFillProperties.moFillType.get() == XML_noFill)
+ {
+ maFillProperties.moFillType = XML_solidFill;
+ maFillProperties.maFillColor = rProperties.getBgColor();
+ }
+
aFillProperties.assignUsed( maFillProperties );
ShapePropertyMap aPropMap( rFilterBase.getModelObjectHelper() );
diff --git a/oox/source/drawingml/table/tablecontext.cxx b/oox/source/drawingml/table/tablecontext.cxx
index 3371e105f691..90191f615d4d 100644
--- a/oox/source/drawingml/table/tablecontext.cxx
+++ b/oox/source/drawingml/table/tablecontext.cxx
@@ -57,6 +57,8 @@ TableContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList& r
mrTableProperties.setBandCol( rAttribs.getBool( XML_bandCol, false ) );
}
break;
+ case A_TOKEN(solidFill):
+ return new ColorContext(*this, mrTableProperties.getBgColor());
case A_TOKEN( tableStyle ): // CT_TableStyle
{
std::shared_ptr< TableStyle >& rTableStyle = mrTableProperties.getTableStyle();
diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx
index b6d8bf378127..b58439e5d714 100644
--- a/oox/source/drawingml/table/tableproperties.cxx
+++ b/oox/source/drawingml/table/tableproperties.cxx
@@ -49,6 +49,7 @@ TableProperties::TableProperties()
, mbBandRow( false )
, mbBandCol( false )
{
+ maBgColor.setUnused();
}
static void CreateTableRows( const uno::Reference< XTableRows >& xTableRows, const std::vector< TableRow >& rvTableRows )