[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - sw/qa sw/source

Jan Holesovsky kendy at collabora.com
Wed Nov 13 00:08:46 PST 2013


 sw/qa/extras/ooxmlimport/data/n830205.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx   |    8 ++++++++
 sw/source/core/doc/docredln.cxx            |    2 ++
 3 files changed, 10 insertions(+)

New commits:
commit b2c54b13e347a1ffc5dc7347c531c34ebcb28b8a
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Tue Nov 12 13:35:56 2013 +0100

    bnc#830205: Stop-gap solution to avoid crash.
    
    This improves the situation, because previously, the document would just crash
    due to infinite recursion.
    
    Deeper checking why do we end up with an invalid range would be good; but it
    was impossible to check with the bugdoc, as it was too complex, and trying to
    cut it down was crashing MSO :-)  Hopefully we'll get a better document at
    some stage.
    
    Conflicts:
    
    	sw/qa/extras/ooxmlimport/ooxmlimport.cxx
    
    Change-Id: I4cd639e02aebe9027f06e8468c14969c506327b2

diff --git a/sw/qa/extras/ooxmlimport/data/n830205.docx b/sw/qa/extras/ooxmlimport/data/n830205.docx
new file mode 100644
index 0000000..89cf1d8
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n830205.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 33c0ece..2629684 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -128,6 +128,7 @@ public:
     void testN816593();
     void testN820509();
     void testN820788();
+    void testN830205();
     void testTableAutoColumnFixedSize();
     void testFdo66474();
     void testBnc780044Spacing();
@@ -215,6 +216,7 @@ void Test::run()
         {"n816593.docx", &Test::testN816593},
         {"n820509.docx", &Test::testN820509},
         {"n820788.docx", &Test::testN820788},
+        {"n830205.docx", &Test::testN830205},
         {"table-auto-column-fixed-size.docx", &Test::testTableAutoColumnFixedSize},
         {"fdo66474.docx", &Test::testFdo66474},
         {"bnc780044_spacing.docx", &Test::testBnc780044Spacing},
@@ -1293,6 +1295,12 @@ void Test::testN820788()
     CPPUNIT_ASSERT_EQUAL(text::SizeType::MIN, getProperty<sal_Int16>(xFrame, "SizeType"));
 }
 
+void Test::testN830205()
+{
+    // Previously import just crashed (due to infinite recursion).
+    getParagraph(1, "XXX");
+}
+
 void Test::testTableAutoColumnFixedSize()
 {
     uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index eed72a6..729d144 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -2694,7 +2694,9 @@ bool SwRedlineTbl::InsertWithValidRanges( SwRedline* p, sal_uInt16* pInsPos )
 #if OSL_DEBUG_LEVEL > 0
             CheckPosition( pNew->GetPoint(), pNew->GetMark() );
 #endif
+
             if( *pNew->GetPoint() != *pNew->GetMark() &&
+                pNew->HasValidRange() &&
                 Insert( pNew, nInsPos ) )
             {
                 pNew->CallDisplayFunc();


More information about the Libreoffice-commits mailing list