sw/qa/extras/ooxmlexport/data/fdo77719.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx |    8 ++++++++
 sw/source/filter/ww8/docxsdrexport.cxx      |    3 +++
 3 files changed, 11 insertions(+)

New commits:
commit f0860625e29c18d2eca647a6cedd0ce679d5a80d
Author: Sourav <sourav.maha...@synerzip.com>
Date:   Thu Apr 24 18:18:16 2014 +0530

    fdo#77719 File containing CusGeom gets corrupted on RT.
    
    RT file gets corrupted because in presetgeometry tag shapetype is coming as 
blank.
    A check is introduced to handle that.
    
    Reviewed on:
        https://gerrit.libreoffice.org/9147
    
    Change-Id: Ie79db0f5dcadfa3cd5d3f54d4a676393b3a882c5

diff --git a/sw/qa/extras/ooxmlexport/data/fdo77719.docx 
b/sw/qa/extras/ooxmlexport/data/fdo77719.docx
new file mode 100644
index 0000000..e671b33
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo77719.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
index cc04809..06182df 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
@@ -1105,6 +1105,14 @@ DECLARE_OOXMLEXPORT_TEST(testShapeEffectPreservation, 
"shape-effect-preservation
             "val", "50000");
 }
 
+DECLARE_OOXMLEXPORT_TEST(fdo77719, "fdo77719.docx")
+{
+    xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+    if (!pXmlDoc)
+        return;
+    assertXPath(pXmlDoc, 
"/w:document[1]/w:body[1]/w:p[1]/w:r[2]/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:prstGeom[1]",
 "prst", "rect");
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index 5c5d5a2..563e124 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1164,6 +1164,9 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* 
pParentFrame, int nAnchorId)
             }
         }
     }
+    //Empty shapeType will lead to corruption so to avoid that shapeType is 
set to default i.e. "rect"
+    if (shapeType.isEmpty())
+        shapeType = "rect";
 
     pFS->singleElementNS(XML_a, XML_prstGeom,
                          XML_prst, OUStringToOString(shapeType, 
RTL_TEXTENCODING_UTF8).getStr(),
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to