[Libreoffice-commits] core.git: oox/source sw/qa

Regényi Balázs (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 11 13:36:57 UTC 2020


 oox/source/export/drawingml.cxx                              |   19 ++++++-----
 sw/qa/extras/ooxmlexport/data/tdf77236_MissingSolidFill.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport10.cxx                   |    9 +++++
 sw/qa/extras/ooxmlexport/ooxmlexport6.cxx                    |    2 -
 4 files changed, 21 insertions(+), 9 deletions(-)

New commits:
commit 83c30743eaf44d8eded4a73e3ac2585b5bdbaffc
Author:     Regényi Balázs <regenyi.balazs at nisz.hu>
AuthorDate: Mon Sep 7 19:54:19 2020 +0200
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Fri Sep 11 15:36:15 2020 +0200

    tdf#77236 DOCX shape export: fix missing solidFill
    
    (resulting for example, invisible shapes).
    
    Co-authored-by: Szabolcs Tóth
    
    Change-Id: I328514022f4a594c374d5a97db39d1cf3a954e02
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102195
    Tested-by: László Németh <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 06bbfea85d61..605e85ffa087 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -926,14 +926,17 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Referenc
             // the line had a scheme color and the user didn't change it
             WriteSolidFill( sColorFillScheme, aTransformations );
         }
-        else if( aStyleProperties.hasElements() )
-        {
-            if( nColor != nStyleColor )
-                // the line style defines some color but it wasn't being used
-                WriteSolidFill( nColor );
-            // in case the shape used the style color and the user didn't change it,
-            // we must not write a <a: solidFill> tag.
-        }
+        // tdf#77236: I do not understand why this condition is required.
+        // The original docx document of bug tdf#77236 includes the native colors in both places,
+        // so, I think, we can export this color too (not only schema ones).
+        //else if( aStyleProperties.hasElements() )
+        //{
+        //    if( nColor != nStyleColor )
+        //        // the line style defines some color but it wasn't being used
+        //        WriteSolidFill( nColor );
+        //    // in case the shape used the style color and the user didn't change it,
+        //    // we must not write a <a: solidFill> tag.
+        //}
         else
         {
             WriteSolidFill( nColor, nColorAlpha );
diff --git a/sw/qa/extras/ooxmlexport/data/tdf77236_MissingSolidFill.docx b/sw/qa/extras/ooxmlexport/data/tdf77236_MissingSolidFill.docx
new file mode 100644
index 000000000000..2bb2c097838d
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf77236_MissingSolidFill.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index da998b01bb5f..4f77681d2eaf 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -1338,6 +1338,15 @@ DECLARE_OOXMLEXPORT_TEST( testTdf107359, "tdf107359-char-pitch.docx" )
     CPPUNIT_ASSERT_EQUAL( sal_Int32(convertTwipToMm100(24 * 20)), nBaseWidth );
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf77236_MissingSolidFill, "tdf77236_MissingSolidFill.docx")
+{
+    // tdf#77236: solidFill of VML shape was not exported if the colors of line and style were the same
+    xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+    if (!pXmlDoc)
+        return;
+    assertXPath(pXmlDoc, "//mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill", 1);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
index d1091c949bb6..eafdf88ea788 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
@@ -783,7 +783,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testShapeThemePreservation, "shape-theme-pre
             0);
     assertXPath(pXmlDocument,
             "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill",
-            0);
+            1);
 
     // check direct theme assignments have been preserved
     assertXPath(pXmlDocument,


More information about the Libreoffice-commits mailing list