From 8d74795e6e777cef0b1df64a56ea886208c87bc0 Mon Sep 17 00:00:00 2001 From: "yogesh.bharate001" Date: Fri, 17 Apr 2015 17:37:00 +0530 Subject: tdf#90672: PPTX table cell border color is not exported. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem Description : XML Difference : Original : After Roundtrip : tag is missing Solution : Added support for table cell border color. Change-Id: I2baf969d7a8e46a0c5825d9f57bf135ec479c9eb Reviewed-on: https://gerrit.libreoffice.org/15364 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- oox/source/export/shapes.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'oox/source') diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index cdeefac339c0..87c019021bea 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1059,10 +1059,10 @@ void ShapeExport::WriteTableCellProperties(Reference< XPropertySet> xCellPropSet FSEND ); // Write background fill for table cell. - DrawingML::WriteFill(xCellPropSet); // TODO // tcW : Table cell width WriteTableCellBorders(xCellPropSet); + DrawingML::WriteFill(xCellPropSet); mpFS->endElementNS( XML_a, XML_tcPr ); } @@ -1073,6 +1073,7 @@ void ShapeExport::WriteTableCellBorders(Reference< XPropertySet> xCellPropSet) // lnL - Left Border Line Properties of table cell xCellPropSet->getPropertyValue("LeftBorder") >>= aBorderLine; sal_Int32 nLeftBorder = aBorderLine.LineWidth; + util::Color aLeftBorderColor = aBorderLine.Color; // While importing the table cell border line width, it converts EMU->Hmm then divided result by 2. // To get original value of LineWidth need to multiple by 2. @@ -1082,42 +1083,49 @@ void ShapeExport::WriteTableCellBorders(Reference< XPropertySet> xCellPropSet) if(nLeftBorder > 0) { mpFS->startElementNS( XML_a, XML_lnL, XML_w, I32S(nLeftBorder), FSEND ); + DrawingML::WriteSolidFill(aLeftBorderColor); mpFS->endElementNS( XML_a, XML_lnL ); } // lnR - Right Border Line Properties of table cell xCellPropSet->getPropertyValue("RightBorder") >>= aBorderLine; sal_Int32 nRightBorder = aBorderLine.LineWidth; + util::Color aRightBorderColor = aBorderLine.Color; nRightBorder = nRightBorder * 2 ; nRightBorder = oox::drawingml::convertHmmToEmu( nRightBorder ); if(nRightBorder > 0) { mpFS->startElementNS( XML_a, XML_lnR, XML_w, I32S(nRightBorder), FSEND); + DrawingML::WriteSolidFill(aRightBorderColor); mpFS->endElementNS( XML_a, XML_lnR); } // lnT - Top Border Line Properties of table cell xCellPropSet->getPropertyValue("TopBorder") >>= aBorderLine; sal_Int32 nTopBorder = aBorderLine.LineWidth; + util::Color aTopBorderColor = aBorderLine.Color; nTopBorder = nTopBorder * 2; nTopBorder = oox::drawingml::convertHmmToEmu( nTopBorder ); if(nTopBorder > 0) { mpFS->startElementNS( XML_a, XML_lnT, XML_w, I32S(nTopBorder), FSEND); + DrawingML::WriteSolidFill(aTopBorderColor); mpFS->endElementNS( XML_a, XML_lnT); } // lnB - Bottom Border Line Properties of table cell xCellPropSet->getPropertyValue("BottomBorder") >>= aBorderLine; sal_Int32 nBottomBorder = aBorderLine.LineWidth; + util::Color aBottomBorderColor = aBorderLine.Color; nBottomBorder = nBottomBorder * 2; nBottomBorder = oox::drawingml::convertHmmToEmu( nBottomBorder ); if(nBottomBorder > 0) { mpFS->startElementNS( XML_a, XML_lnB, XML_w, I32S(nBottomBorder), FSEND); + DrawingML::WriteSolidFill(aBottomBorderColor); mpFS->endElementNS( XML_a, XML_lnB); } } -- cgit