[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - sw/qa sw/source

YogeshBharate yogesh.bharate at synerzip.com
Tue Apr 22 10:20:03 PDT 2014


 sw/qa/extras/ooxmlexport/data/fdo71785.docx   |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx      |    6 ++++++
 sw/source/filter/ww8/docxtablestyleexport.cxx |   20 ++++++++++++++++++--
 3 files changed, 24 insertions(+), 2 deletions(-)

New commits:
commit d6e66af53ccbb6e15925a14c9283a8ada92ebc5f
Author: YogeshBharate <yogesh.bharate at synerzip.com>
Date:   Fri Nov 29 18:02:54 2013 +0530

    fdo#71785:  File hangs LibreOffice on Save
    
    Problem Description: While saving the file LO shows the error
    "This file could not be save".
    The root cause was memory leak.
    
    Conflicts:
    	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
    Reviewed on:
    	https://gerrit.libreoffice.org/6850
    
    (cherry picked from commit 0f6240fa92c443f66441545438821c02b3412486)
    Signed-off-by: Andras Timar <andras.timar at collabora.com>
    
    Conflicts:
    	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
    
    Change-Id: Iacc185780c14760056a7d690eb113d4dde1de034

diff --git a/sw/qa/extras/ooxmlexport/data/fdo71785.docx b/sw/qa/extras/ooxmlexport/data/fdo71785.docx
new file mode 100644
index 0000000..e155e83
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo71785.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index b8b104b..7095ea2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2042,6 +2042,12 @@ DECLARE_OOXMLEXPORT_TEST(testExtraSectionBreak, "1_page.docx")
     CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCursor->getPage());
 }
 
+
+DECLARE_OOXMLEXPORT_TEST(testFdo71785, "fdo71785.docx")
+{
+    // crashtest
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxtablestyleexport.cxx b/sw/source/filter/ww8/docxtablestyleexport.cxx
index af96d5f..663898e4 100644
--- a/sw/source/filter/ww8/docxtablestyleexport.cxx
+++ b/sw/source/filter/ww8/docxtablestyleexport.cxx
@@ -342,7 +342,8 @@ void DocxTableStyleExport::Impl::tableStyleRPr(uno::Sequence<beans::PropertyValu
 
     m_pSerializer->startElementNS(XML_w, XML_rPr, FSEND);
 
-    uno::Sequence<beans::PropertyValue> aRFonts, aLang, aColor;
+    uno::Sequence<beans::PropertyValue> aRFonts, aLang, aColor, aSpacingSequence;
+    bool bSequenceFlag = false ;
     OUString aB, aBCs, aI, aSz, aSzCs, aCaps, aSmallCaps, aSpacing;
     for (sal_Int32 i = 0; i < rRPr.getLength(); ++i)
     {
@@ -367,7 +368,16 @@ void DocxTableStyleExport::Impl::tableStyleRPr(uno::Sequence<beans::PropertyValu
         else if (rRPr[i].Name == "smallCaps")
             aSmallCaps = rRPr[i].Value.get<OUString>();
         else if (rRPr[i].Name == "spacing")
-            aSpacing = rRPr[i].Value.get<OUString>();
+        {
+            if (rRPr[i].Value.has<OUString>())
+            {
+                aSpacing = rRPr[i].Value.get<OUString>();
+            }
+            else {
+                aSpacingSequence = rRPr[i].Value.get< uno::Sequence<beans::PropertyValue> >() ;
+                bSequenceFlag = true ; // set the uno::Sequence flag.
+            }
+        }
     }
     tableStyleRRFonts(aRFonts);
     tableStyleRLang(aLang);
@@ -377,6 +387,12 @@ void DocxTableStyleExport::Impl::tableStyleRPr(uno::Sequence<beans::PropertyValu
     handleBoolean(aCaps, XML_caps);
     handleBoolean(aSmallCaps, XML_smallCaps);
     tableStyleRColor(aColor);
+    if(bSequenceFlag)
+    {
+           m_pSerializer->singleElementNS(XML_w, XML_spacing,
+                FSNS(XML_w, XML_val),OUStringToOString(aSpacingSequence[0].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr(),
+                   FSEND);
+    }
     if (!aSpacing.isEmpty())
         m_pSerializer->singleElementNS(XML_w, XML_spacing,
                 FSNS(XML_w, XML_val), OUStringToOString(aSpacing, RTL_TEXTENCODING_UTF8).getStr(),


More information about the Libreoffice-commits mailing list