diff options
author | nd101 <Fong@nd.com.cn> | 2019-09-02 10:29:12 +0800 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-12-06 15:01:48 +0100 |
commit | 4c2254cbebca53c34fa48a1dd90cebe434f24274 (patch) | |
tree | 31c6f5ac3449dad0ff90a31c0582e5727c866ad8 /oox/source | |
parent | 77b57d8f341c7a5323bbb6ab2f2af97ac140afbc (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>
Diffstat (limited to 'oox/source')
-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 |
3 files changed, 9 insertions, 0 deletions
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 ) |