summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2013-11-12 13:35:56 +0100
committerJan Holesovsky <kendy@collabora.com>2013-11-12 14:57:13 +0100
commitb2c54b13e347a1ffc5dc7347c531c34ebcb28b8a (patch)
tree1387d225d74fbd3045a3f955ffc0120329e4e6e6
parent6abf5fbd2501538d0b0af89d39b13287273c9936 (diff)
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
-rw-r--r--sw/qa/extras/ooxmlimport/data/n830205.docxbin0 -> 33186 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx8
-rw-r--r--sw/source/core/doc/docredln.cxx2
3 files changed, 10 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/n830205.docx b/sw/qa/extras/ooxmlimport/data/n830205.docx
new file mode 100644
index 000000000000..89cf1d8434a1
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/n830205.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 33c0ecebceac..262968471b8c 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 eed72a6dfddf..729d144d6ba8 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();