diff options
author | nd101 <Fong@nd.com.cn> | 2019-09-02 10:29:12 +0800 |
---|---|---|
committer | Xisco Faulí <xiscofauli@libreoffice.org> | 2019-12-06 22:41:35 +0100 |
commit | 6e873fd94a192f503fd1aff205bdfb5ad465c7ef (patch) | |
tree | 76faea5f4cce4be680f9591af3c8c847d63158c1 /oox | |
parent | f74e51bff52a29bea359243bcb741ed32149282c (diff) |
tdf#127237 fix table background color in Impress import
When the background color is set at the table level in PPTX,
instead of at cell level, the background color fails to
show up in Impress.
Change-Id: I2838e5b56e4a2414494ee99c0f8975b7256ac6dc
Reviewed-on: https://gerrit.libreoffice.org/78377
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 4c2254cbebca53c34fa48a1dd90cebe434f24274)
Reviewed-on: https://gerrit.libreoffice.org/84644
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/inc/drawingml/table/tableproperties.hxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/table/tablecell.cxx | 6 | ||||
-rw-r--r-- | oox/source/drawingml/table/tablecontext.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/table/tableproperties.cxx | 1 |
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 f27117fd2b42..50dda7080bb0 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 b6f9a8a59cfc..a32353d52f1f 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 ) |