sw/qa/extras/ooxmlexport/data/testOuterShdw.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx         |    8 ++++++++
 sw/source/filter/ww8/docxsdrexport.cxx           |    2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit fa9d574ae1656b64670fbbac64ddd85461698149
Author: YogeshBharate <yogesh.bhar...@synerzip.com>
Date:   Wed Feb 5 19:27:09 2014 +0530

    Code changes for fdo#74107:File Corruption - Issue with outerShdw
    
    Problem Description:
    - In document.xml, outerShdw dist contains the negative value after 
roundtrip.
    - Due to negative value file get corrupted.
    
    XML difference:
     Roundtrip: Before fix
     <a:outerShdw dist="-1363652116480" dir="2700000">
    
     Roundtrip: After fix
     <a:outerShdw dist="57811035" dir="2700000">
    
    Conflicts:
        sw/qa/extras/ooxmlexport/ooxmlexport.cxx
    Reviewed on:
        https://gerrit.libreoffice.org/7880
    
    Change-Id: Ied752672244d5768dee554e907f2f4d7a9d077d5

diff --git a/sw/qa/extras/ooxmlexport/data/testOuterShdw.docx 
b/sw/qa/extras/ooxmlexport/data/testOuterShdw.docx
new file mode 100644
index 0000000..cc559a3
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/testOuterShdw.docx 
differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 5a0b817..ccbdc63 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3182,6 +3182,14 @@ DECLARE_OOXMLEXPORT_TEST(testCaption4, 
"TableWithAboveCaptions.docx")
     CPPUNIT_ASSERT(contents.match(" SEQ Table \\* ARABIC"));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testOuterShdw,"testOuterShdw.docx")
+{
+    xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+    if (!pXmlDoc)
+        return;
+    assertXPath(pXmlDoc, 
"/w:document[1]/w:body[1]/w:p[1]/w:r[3]/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:effectLst[1]/a:outerShdw[1]",
 "dist", "57811035");
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index 7abc92a..ad86205 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -571,7 +571,7 @@ void DocxSdrExport::writeDMLEffectLst(const SwFrmFmt& 
rFrmFmt)
     if (aShadowItem.GetLocation() != SVX_SHADOW_NONE)
     {
         // Distance is measured diagonally from corner
-        double nShadowDist = 
sqrt((aShadowItem.GetWidth()*aShadowItem.GetWidth())*2.0);
+        double nShadowDist = 
sqrt((double)aShadowItem.GetWidth()*aShadowItem.GetWidth()*2.0);
         OString aShadowDist(OString::number(TwipsToEMU(nShadowDist)));
         OString aShadowColor = 
msfilter::util::ConvertColor(aShadowItem.GetColor());
         OString aShadowAlpha = lcl_ConvertTransparency(aShadowItem.GetColor());
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to