[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.1' - sw/qa sw/source

Jan Holesovsky kendy at collabora.com
Wed Nov 13 01:06:48 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 efc58a791d9df1aa9787aa7f8da957551ef7329c
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 709431d..2eaa994 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -123,6 +123,7 @@ public:
     void testN820509();
     void testN820788();
     void testN820504();
+    void testN830205();
     void testFdo43641();
     void testFdo46361();
     void testFdo65632();
@@ -226,6 +227,7 @@ void Test::run()
         {"n820509.docx", &Test::testN820509},
         {"n820788.docx", &Test::testN820788},
         {"n820504.docx", &Test::testN820504},
+        {"n830205.docx", &Test::testN830205},
         {"fdo43641.docx", &Test::testFdo43641},
         {"fdo46361.docx", &Test::testFdo46361},
         {"fdo65632.docx", &Test::testFdo65632},
@@ -1514,6 +1516,12 @@ void Test::testN820504()
     CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(xDraws->getByIndex(0), "AnchorType"));
 }
 
+void Test::testN830205()
+{
+    // Previously import just crashed (due to infinite recursion).
+    getParagraph(1, "XXX");
+}
+
 void Test::testFdo43641()
 {
     uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index a6a92a1..7a1fcf9 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -2690,7 +2690,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