Kaydet (Commit) ed3fd76b authored tarafından Dinesh Patil's avatar Dinesh Patil Kaydeden (comit) Michael Stahl

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/9433Tested-by: 's avatarMichael Stahl <mstahl@redhat.com>
Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst 73f65ac3
...@@ -3124,6 +3124,16 @@ DECLARE_OOXMLEXPORT_TEST(testfdo76589 , "fdo76589.docx") ...@@ -3124,6 +3124,16 @@ DECLARE_OOXMLEXPORT_TEST(testfdo76589 , "fdo76589.docx")
assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText","val","%1" ); 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") DECLARE_OOXMLEXPORT_TEST(testAuthorPropertySdt, "author-property.docx")
{ {
xmlDocPtr pXmlDoc = parseExport("word/document.xml"); xmlDocPtr pXmlDoc = parseExport("word/document.xml");
......
...@@ -1134,8 +1134,8 @@ void MSWord_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart) ...@@ -1134,8 +1134,8 @@ void MSWord_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart)
std::find( aChrTxtAtrArr.begin(), aChrTxtAtrArr.end(), &rAttr ); std::find( aChrTxtAtrArr.begin(), aChrTxtAtrArr.end(), &rAttr );
if ( it != aChrTxtAtrArr.end() ) if ( it != aChrTxtAtrArr.end() )
{ {
aChrTxtAtrArr.erase( it );
aChrSetArr.erase( aChrSetArr.begin() + (it - aChrTxtAtrArr.begin()) ); aChrSetArr.erase( aChrSetArr.begin() + (it - aChrTxtAtrArr.begin()) );
aChrTxtAtrArr.erase( it );
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment