[Libreoffice-commits] core.git: sw/qa sw/source

PriyankaGaikwad priyanka.gaikwad at synerzip.com
Mon Nov 25 03:15:19 PST 2013


 sw/qa/extras/ooxmlimport/data/file_crash.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx      |    5 +++++
 sw/source/core/doc/doctxm.cxx                 |    2 +-
 3 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit c6e333e73b811a65526628effb21636f4f420cc5
Author: PriyankaGaikwad <priyanka.gaikwad at synerzip.com>
Date:   Fri Nov 22 19:05:32 2013 +0530

    Fixed for libreoffice crashes while opening file.
    
    Change-Id: I85a16e4ef8d75f19250115d5522046a968d5fc91
    Reviewed-on: https://gerrit.libreoffice.org/6760
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/qa/extras/ooxmlimport/data/file_crash.docx b/sw/qa/extras/ooxmlimport/data/file_crash.docx
new file mode 100644
index 0000000..7a233ab
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/file_crash.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index ea6f8e6..8f6e931 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -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();
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index e28617d..bece385 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -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);
                 }


More information about the Libreoffice-commits mailing list