diff options
author | Dinesh Patil <dinesh.patil@synerzip.com> | 2014-05-21 19:32:54 +0530 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-05-26 11:38:03 +0200 |
commit | 55b197700b1ceb2e64b5f7c2bb227afbcad525b6 (patch) | |
tree | c8896979b7dbd8cfddab2b94e03e030d74c03d3e | |
parent | 309bd58c9721495fe9aeeb0a9be9726cf5f748f8 (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)
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo79008.docx | bin | 0 -> 53143 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 2 |
3 files changed, 11 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo79008.docx b/sw/qa/extras/ooxmlexport/data/fdo79008.docx Binary files differnew file mode 100644 index 000000000000..2b1758776b14 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79008.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 608f11f94354..ff3e138c664c 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3115,6 +3115,16 @@ DECLARE_OOXMLEXPORT_TEST(testfdo76589 , "fdo76589.docx") assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText","val","%1" ); } +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; +} + DECLARE_OOXMLEXPORT_TEST(testAuthorPropertySdt, "author-property.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 0e0b14111da9..858a721bf79b 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -1134,8 +1134,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 ); } } } |