Kaydet (Commit) 247edcf4 authored tarafından PriyankaGaikwad's avatar PriyankaGaikwad Kaydeden (comit) Caolán McNamara

Fixed for libreoffice crashes while opening file.

Change-Id: I85a16e4ef8d75f19250115d5522046a968d5fc91
Reviewed-on: https://gerrit.libreoffice.org/6760Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
(cherry picked from commit c6e333e7)
üst a987ac4a
...@@ -1540,6 +1540,11 @@ DECLARE_OOXMLIMPORT_TEST(testFdo70457, "fdo70457.docx") ...@@ -1540,6 +1540,11 @@ DECLARE_OOXMLIMPORT_TEST(testFdo70457, "fdo70457.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(4500), getProperty<sal_Int32>(getShape(1), "RotateAngle")); CPPUNIT_ASSERT_EQUAL(sal_Int32(4500), getProperty<sal_Int32>(getShape(1), "RotateAngle"));
} }
DECLARE_OOXMLIMPORT_TEST(testLOCrash,"file_crash.docx")
{
//The problem was libreoffice crash while opening the file.
getParagraph(1,"Contents");
}
#endif #endif
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
...@@ -1616,7 +1616,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, ...@@ -1616,7 +1616,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
case TOKEN_ENTRY_TEXT: case TOKEN_ENTRY_TEXT:
{ {
SwIndex aIdx( pTOXNd, rTxt.getLength() ); SwIndex aIdx( pTOXNd, std::min(pTOXNd->GetTxt().getLength(),rTxt.getLength()) );
rBase.FillText( *pTOXNd, aIdx ); rBase.FillText( *pTOXNd, aIdx );
rTxt = lcl_RemoveLineBreaks(rTxt); rTxt = lcl_RemoveLineBreaks(rTxt);
} }
......
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