summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-06-10 17:21:45 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-06-24 16:22:27 +0200
commit30d6fa97743d3d79091c582865a3b7cdc470517a (patch)
treea9107cbdc6dd5bb1cb543c4ecb426ef5f7131818
parent86a3470455c92353e731979c1743657731a23e10 (diff)
crashtesting: sw: fix export of ooo24576-1.doc and ooo79410-1.sxw to odt
Crashes because an at-char fly has its anchor node deleted, and during deletion of its text frame its SwAnchoredObject is updated, which asserts because of inconsistent anchor node in the fly and mpAnchorFrame; the immediate cause of the inconsistency is that SwNodes::RemoveNode() changed the fly's anchor node. The root cause is that in the sw_JoinText(bJoinPrev=true) code, a fly anchored at the end of the deleted node isn't moved to the surviving node. SwTextNode::JoinPrev() uses different arguments to ContentIdxStore::Save(), so use the same here. The implementation of several ContentIdxStore functions, including ContentIdxStoreImpl::SaveFlys(), ignore positions that are equal to the passed nContent index, so passing in SwTextNode::Len() looks wrong. (crash is regression from 98d1622b3721fe899c4e1faa0b4cc35695253014) Change-Id: I3a4d54258611da6b15223273a187c39770caa8e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93583 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit b2b234269b13d5dfd8e7123a25d282d88fee33a0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96104 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit ef7db957b518f19ab944fcebf83ca73a18e2357c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96214 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--sw/source/core/doc/docedt.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index f6e38600f1ba..a695cca98713 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -410,7 +410,7 @@ bool sw_JoinText( SwPaM& rPam, bool bJoinPrev )
pOldTextNd->FormatToTextAttr( pTextNd );
const std::shared_ptr< sw::mark::ContentIdxStore> pContentStore(sw::mark::ContentIdxStore::Create());
- pContentStore->Save( pDoc, aOldIdx.GetIndex(), pOldTextNd->Len() );
+ pContentStore->Save(pDoc, aOldIdx.GetIndex(), SAL_MAX_INT32);
SwIndex aAlphaIdx(pTextNd);
pOldTextNd->CutText( pTextNd, aAlphaIdx, SwIndex(pOldTextNd),