[Libreoffice-commits] core.git: 2 commits - sw/qa sw/source
Jan Holesovsky
kendy at collabora.com
Tue Nov 12 04:40:45 PST 2013
sw/qa/extras/ooxmlimport/data/n830205.docx |binary
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 6 ++++++
sw/source/core/doc/docredln.cxx | 10 ++++++----
3 files changed, 12 insertions(+), 4 deletions(-)
New commits:
commit c0bed3147c472acc18736b764798324880a23163
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.
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 5c072ea..f2c3b70 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1244,6 +1244,12 @@ DECLARE_OOXMLIMPORT_TEST(testN820504, "n820504.docx")
CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType"));
}
+DECLARE_OOXMLIMPORT_TEST(testN830205, "n830205.docx")
+{
+ // Previously import just crashed (due to infinite recursion).
+ getParagraph(1, "XXX");
+}
+
DECLARE_OOXMLIMPORT_TEST(testFdo43641, "fdo43641.docx")
{
uno::Reference<container::XIndexAccess> xGroupShape(getShape(1), uno::UNO_QUERY);
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index d67e9b5..3e737b0 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -2682,7 +2682,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();
commit 0385e736523b52087d96587f399fb3e61f911766
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue Nov 12 09:41:16 2013 +0100
Less confusing variable name.
Change-Id: I8a6c9a037b3863d913583f5be3d7c0c6b96f29f8
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 2620ce8..d67e9b5 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -287,7 +287,7 @@ Behaviour of Delete-Redline:
*/
bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
{
- bool bError = true;
+ bool bMerged = false;
_CHECK_REDLINE( this )
if( IsRedlineOn() && !IsShowOriginal( meRedlineMode ) &&
@@ -404,7 +404,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
mpRedlineTbl->Insert( pRedl );
}
- bError = false;
+ bMerged = true;
bDelete = true;
}
else if( (( POS_BEFORE == eCmpPos &&
@@ -420,7 +420,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
mpRedlineTbl->Remove( n );
mpRedlineTbl->Insert( pRedl );
- bError = false;
+ bMerged = true;
bDelete = true;
}
else if ( POS_OUTSIDE == eCmpPos )
@@ -1227,7 +1227,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
}
_CHECK_REDLINE( this )
- return ( 0 != pNewRedl ) || !bError;
+ return ( 0 != pNewRedl ) || bMerged;
}
void SwDoc::CompressRedlines()
More information about the Libreoffice-commits
mailing list