[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - oox/source sd/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Tue Oct 15 09:23:13 UTC 2019


 oox/source/export/drawingml.cxx    |   16 ++++++++++++++++
 sd/qa/unit/data/odp/tdf128096.odp  |binary
 sd/qa/unit/export-tests-ooxml2.cxx |   16 ++++++++++++++++
 3 files changed, 32 insertions(+)

New commits:
commit 63fff549e05e6007d9692996274982afeb34cd7f
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Fri Oct 11 17:43:46 2019 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Tue Oct 15 11:21:50 2019 +0200

    tdf#128096: pptx: export highlight
    
    Reviewed-on: https://gerrit.libreoffice.org/80670
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
    (cherry picked from commit 3e0811660ba4cecd0ab27918c27a5ddab47cc5c5)
    
    Change-Id: If3084f7ffaceb774dba1b1f195229313a8f1d04a
    Reviewed-on: https://gerrit.libreoffice.org/80740
    Tested-by: Jenkins
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index de0c65cbcd8d..2d7b300e51e3 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1839,6 +1839,22 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
         }
     }
 
+    // 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)
+    {
+        if (GetProperty(rXPropSet, "CharBackColor"))
+        {
+            ::Color color(*o3tl::doAccess<sal_uInt32>(mAny));
+            if( color != COL_AUTO )
+            {
+                mpFS->startElementNS(XML_a, XML_highlight);
+                WriteColor( color );
+                mpFS->endElementNS( XML_a, XML_highlight );
+            }
+        }
+    }
+
     if (underline
         && ((bCheckDirect
              && GetPropertyAndState(rXPropSet, rXPropState, "CharUnderlineColor", eState)
diff --git a/sd/qa/unit/data/odp/tdf128096.odp b/sd/qa/unit/data/odp/tdf128096.odp
new file mode 100644
index 000000000000..827239973c84
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf128096.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 6d29d075c62d..239a362514d9 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -195,6 +195,7 @@ public:
     void testTdf118768();
     void testTdf118836();
     void testTdf116350TextEffects();
+    void testTdf128096();
     void testTdf120573();
     void testTdf118825();
     void testTdf119118();
@@ -286,6 +287,7 @@ public:
     CPPUNIT_TEST(testTdf118768);
     CPPUNIT_TEST(testTdf118836);
     CPPUNIT_TEST(testTdf116350TextEffects);
+    CPPUNIT_TEST(testTdf128096);
     CPPUNIT_TEST(testTdf120573);
     CPPUNIT_TEST(testTdf118825);
     CPPUNIT_TEST(testTdf119118);
@@ -2060,6 +2062,20 @@ void SdOOXMLExportTest2::testTdf116350TextEffects()
     xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest2::testTdf128096()
+{
+    ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf128096.odp"), ODP);
+    utl::TempFile tempFile;
+    xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+    xDocShRef->DoClose();
+
+    xmlDocPtr pXmlDocContent1 = parseExport(tempFile, "ppt/slides/slide1.xml");
+    assertXPath(pXmlDocContent1, "//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr/a:highlight/a:srgbClr", "val", "ffff00");
+
+    // Check that underlined content is also highlighted
+    xmlDocPtr pXmlDocContent2 = parseExport(tempFile, "ppt/slides/slide2.xml");
+    assertXPath(pXmlDocContent2, "//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr/a:highlight/a:srgbClr", "val", "ffff00");
+}
 void SdOOXMLExportTest2::testTdf120573()
 {
     ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc( "sd/qa/unit/data/pptx/tdf120573.pptx" ), PPTX );


More information about the Libreoffice-commits mailing list