summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYogeshBharate <yogesh.bharate@synerzip.com>2013-11-29 18:02:54 +0530
committerAndras Timar <andras.timar@collabora.com>2014-04-22 19:22:30 +0200
commit67702f2451f3132c93339c3471228c716c2ba02d (patch)
tree427bed08cfe877dcd50eb9c9554b2d128e879b8d
parentf0a169c8c7173d469ff628b3bd32ff0020a269e2 (diff)
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@collabora.com> Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Change-Id: Iacc185780c14760056a7d690eb113d4dde1de034
-rw-r--r--sw/qa/extras/ooxmlexport/data/fdo71785.docxbin0 -> 54366 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx6
-rw-r--r--sw/source/filter/ww8/docxtablestyleexport.cxx20
3 files changed, 24 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo71785.docx b/sw/qa/extras/ooxmlexport/data/fdo71785.docx
new file mode 100644
index 000000000000..e155e831fab9
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/fdo71785.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index b8b104b5f540..7095ea23dc8b 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 af96d5f4bfa5..663898e4a84a 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(),