From 54c8a62d630b67847528f82402d802a4da48eac2 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Mon, 14 Oct 2019 16:07:14 +0200 Subject: tdf#128096: only use CharBackColor for highlight if exporting to pptx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just in case, making sure highlight in docx export works as before Change-Id: Ied42da1c5f286b80fc754a06357960e8334a765f Reviewed-on: https://gerrit.libreoffice.org/80780 Tested-by: Jenkins Reviewed-by: Tamás Zolnai --- oox/source/export/drawingml.cxx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'oox/source') diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 168bb53e8217..fb5f6ed7a4cd 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1874,14 +1874,19 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool } } - if (GetProperty(rXPropSet, "CharBackColor")) + // tdf#128096, exporting XML_highlight to docx already works fine, + // so make sure this code is only run when exporting to pptx, just in case + if (GetDocumentType() == DOCUMENT_PPTX) { - ::Color color(*o3tl::doAccess(mAny)); - if( color != COL_AUTO ) + if (GetProperty(rXPropSet, "CharBackColor")) { - mpFS->startElementNS(XML_a, XML_highlight); - WriteColor( color ); - mpFS->endElementNS( XML_a, XML_highlight ); + ::Color color(*o3tl::doAccess(mAny)); + if( color != COL_AUTO ) + { + mpFS->startElementNS(XML_a, XML_highlight); + WriteColor( color ); + mpFS->endElementNS( XML_a, XML_highlight ); + } } } -- cgit