summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYogeshBharate <yogesh.bharate@synerzip.com>2013-11-29 18:02:54 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-12-13 12:09:50 +0100
commit0f6240fa92c443f66441545438821c02b3412486 (patch)
tree286d4ac0aadd76d56a01b4648cdeae7f056d6bea
parentf658b7dfd6d23e4a179917245d6e6d4653d6678e (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 Change-Id: Iacc185780c14760056a7d690eb113d4dde1de034
-rw-r--r--sw/qa/extras/ooxmlexport/data/fdo71785.docxbin0 -> 54366 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx5
-rw-r--r--sw/source/filter/ww8/docxtablestyleexport.cxx20
3 files changed, 23 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 a7e28cf31b3c..d5946273dd8f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2123,6 +2123,11 @@ DECLARE_OOXMLEXPORT_TEST(testGlossary, "testGlossary.docx")
assertXPath(pXmlDoc, "/w:glossaryDocument", "Ignorable", "w14 wp14");
}
+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 fb1ddbdeaeac..255791cec4ee 100644
--- a/sw/source/filter/ww8/docxtablestyleexport.cxx
+++ b/sw/source/filter/ww8/docxtablestyleexport.cxx
@@ -345,7 +345,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)
{
@@ -370,7 +371,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);
@@ -380,6 +390,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(),