summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDinesh Patil <dinesh.patil@synerzip.com>2014-05-21 19:32:54 +0530
committerMichael Stahl <mstahl@redhat.com>2014-05-26 11:38:19 +0200
commitae95cdd2a1708a8e9e114dd9bcf577f57f1f5af3 (patch)
tree25bf4c11c3d18b03b5e2b951a87c42b63ba60609
parent9732b4a0045c1e72493f16d03f60a048d5fbfa9d (diff)
fdo#79008 Crash: File getting crash while saving in LO
File is getting crashed while saving in LO, as it tries to access the value of vector after erasing that value. Code changed to access the vector value first and then erase that value from vector. Change-Id: I29369b7582fdbd7363d0e6fdae091a30c79a747d Reviewed-on: https://gerrit.libreoffice.org/9433 Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit ed3fd76b65b2a281effea55b8a55101a8b740aec) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx
-rw-r--r--sw/qa/extras/ooxmlexport/data/fdo79008.docxbin0 -> 53143 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx11
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx2
3 files changed, 11 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo79008.docx b/sw/qa/extras/ooxmlexport/data/fdo79008.docx
new file mode 100644
index 000000000000..2b1758776b14
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/fdo79008.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index ee5f974e38e2..f6c3591007cd 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2057,7 +2057,16 @@ DECLARE_OOXMLEXPORT_TEST(testFDO78384,"fdo78384.docx")
}
#endif
-CPPUNIT_PLUGIN_IMPLEMENT();
+DECLARE_OOXMLEXPORT_TEST(testfdo79008, "fdo79008.docx")
+{
+ /* File getting crash while saving in LO.
+ * Checking if document.xml file is getting created after fix
+ */
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ if (!pXmlDoc)
+ return;
+}
+CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 9729d23efda1..b3b6c1109541 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1145,8 +1145,8 @@ void MSWord_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart)
std::find( aChrTxtAtrArr.begin(), aChrTxtAtrArr.end(), &rAttr );
if ( it != aChrTxtAtrArr.end() )
{
- aChrTxtAtrArr.erase( it );
aChrSetArr.erase( aChrSetArr.begin() + (it - aChrTxtAtrArr.begin()) );
+ aChrTxtAtrArr.erase( it );
}
}
}