Fixed for libreoffice crashes while opening file.

Change-Id: I85a16e4ef8d75f19250115d5522046a968d5fc91
Reviewed-on: https://gerrit.libreoffice.org/6760
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
PriyankaGaikwad
2013-11-22 19:05:32 +05:30
committed by Caolán McNamara
parent 82b5172954
commit c6e333e73b
3 changed files with 6 additions and 1 deletions

Binary file not shown.

View File

@@ -1555,6 +1555,11 @@ DECLARE_OOXMLIMPORT_TEST(testFdo70457, "fdo70457.docx")
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
CPPUNIT_PLUGIN_IMPLEMENT();

View File

@@ -1616,7 +1616,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
case TOKEN_ENTRY_TEXT:
{
SwIndex aIdx( pTOXNd, rTxt.getLength() );
SwIndex aIdx( pTOXNd, std::min(pTOXNd->GetTxt().getLength(),rTxt.getLength()) );
rBase.FillText( *pTOXNd, aIdx );
rTxt = lcl_RemoveLineBreaks(rTxt);
}