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

Dinesh Patil dinesh.patil at synerzip.com
Fri Jun 6 01:25:08 PDT 2014


 oox/source/export/drawingml.cxx             |    5 +++++
 sw/qa/extras/ooxmlexport/data/fdo79256.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx |   14 ++++++++++++++
 3 files changed, 19 insertions(+)

New commits:
commit 80ef7a645a8118976a4366135faa41bceda423be
Author: Dinesh Patil <dinesh.patil at synerzip.com>
Date:   Thu May 29 15:26:46 2014 +0530

    fdo#79256 Line Style with Long Dashes and dots is getting corrupt after RT
    
    Description:
    In RT file the dash length (d) is going out of range,
    as after RT the dashing scheme changes to custom dash
    which was causing the corruption. Changed code at export,
    which will divide the DashLen, DotLen and Distance by
    base line width.
    
    Reviewed on:
    	https://gerrit.libreoffice.org/9559
    
    Change-Id: I0e644b5a2b692a9e717026a14d1f0058199f53b1

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 6703669..42d007a 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -628,6 +628,11 @@ void DrawingML::WriteOutline( Reference< XPropertySet > rXPropSet )
         // line style is a dash and it was not set by the shape style
         // TODO: the XML_d and XML_sp values seem insane
         mpFS->startElementNS( XML_a, XML_custDash, FSEND );
+
+        aLineDash.DotLen = aLineDash.DotLen / nLineWidth;
+        aLineDash.DashLen = aLineDash.DashLen / nLineWidth;
+        aLineDash.Distance = aLineDash.Distance / nLineWidth;
+
         int i;
         for( i = 0; i < aLineDash.Dots; i ++ )
             mpFS->singleElementNS( XML_a, XML_ds,
diff --git a/sw/qa/extras/ooxmlexport/data/fdo79256.docx b/sw/qa/extras/ooxmlexport/data/fdo79256.docx
new file mode 100644
index 0000000..2358abb
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo79256.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
index ad5b49b..0eccae3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
@@ -1628,6 +1628,20 @@ DECLARE_OOXMLEXPORT_TEST(testFdo78957, "fdo78957.docx")
     CPPUNIT_ASSERT(cy >= 0 );
 }
 
+DECLARE_OOXMLEXPORT_TEST(testfdo79256, "fdo79256.docx")
+{
+    /* Corruption issue containing Line Style with Long Dashes and Dots
+     * After RT checking the Dash Length value. Dash Length value should not be greater than 2147483.
+     */
+    xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+    if (!pXmlDoc)
+        return;
+
+    const sal_Int32 maxLimit = 2147483;
+    sal_Int32 d = getXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[1]","d").toInt32();
+    CPPUNIT_ASSERT(d <= maxLimit );
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();


More information about the Libreoffice-commits mailing list