[Libreoffice-commits] core.git: sw/source
Michael Stahl
mstahl at redhat.com
Wed May 20 15:03:57 PDT 2015
sw/source/core/doc/docbm.cxx | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit 27384cdf7df20d6bc46e5d028f27be41b49b0f02
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed May 20 23:04:52 2015 +0200
sw: avoid CrossRefBookmark assertion when importing ooo83574-1.doc
One of the thousands of redlines in the document contains a paragraph
that has a cross-ref bookmark on it. At the end of the import the
redlines get hidden, i.e. copied and deleted from the body.
Because this redline starts in the middle of a paragraph, the
CrossRefBookmark on its last paragraph gets its position corrected
onto the middle of a paragraph, and it becomes unhappy and asserts.
Probably this can only happen in WW8 import, since other imports insert
the redline data into the redline area in the nodes array.
Change-Id: I5bfd94cacf9c2e76fd646728a123b3297b47c255
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 9b9f143..b88bd17 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -632,6 +632,11 @@ namespace sw { namespace mark
if(&pMark->GetMarkPos().nNode.GetNode() == pOldNode)
{
SwPosition aNewPosRel(aNewPos);
+ if (dynamic_cast< ::sw::mark::CrossRefBookmark *>(pMark))
+ {
+ // ensure that cross ref bookmark always starts at 0
+ aNewPosRel.nContent = 0; // HACK for WW8 import
+ }
aNewPosRel.nContent += pMark->GetMarkPos().nContent.GetIndex();
pMark->SetMarkPos(aNewPosRel);
bChangedPos = true;
More information about the Libreoffice-commits
mailing list