summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-08-18 17:25:17 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2017-08-24 23:31:15 +0200
commitb99f9c9559b9a3a2aa6337bb87be0ea1767ee7a7 (patch)
treeee1342a02d712cdaa8ea5c6a7686e2f19e5c773e
parenta2c8a955e5a0df44651e01be6d76a9ecdcf37a94 (diff)
tdf#99692 sw: fix the fix: don't set bNullContent if node was split
When showing the redlines in rhbz908615-13.odt, the following assertion happens: Assertion `IDocumentMarkAccess::IsLegalPaMForCrossRefHeadingBookmark(rPaM) && "<CrossRefBookmark::CrossRefBookmark(..)>" "- creation of cross-reference bookmark with an illegal PaM that does not expand over exactly one whole paragraph."' failed. This is because in DocumentContentOperationsManager::MoveRange() the flag bNullContent is set after the node has been split; in this case the nContent is of course always 0. Later the function then restores aSavePam to the index 0 of the next node, when it actually shouldn't do anything because the JoinNext() already positioned it correctly at the merge-index of the re-joined node. (regression from 850795942b3e168cab8ce88b4f2b421945ff29ca) Change-Id: I64d50e70b19e2fd81537a9771fa8706898b17642 (cherry picked from commit 6a018363791945b6fd7f04f2aa311e4f4753f6aa) Reviewed-on: https://gerrit.libreoffice.org/41304 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit cac440fd5a76f4a76565466cd9df363f5634e8bd) Reviewed-on: https://gerrit.libreoffice.org/41464 Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--sw/source/core/doc/DocumentContentOperationsManager.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 32f7da7e99de..cfc4f4fe9605 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -2039,7 +2039,8 @@ bool DocumentContentOperationsManager::MoveRange( SwPaM& rPaM, SwPosition& rPos,
// the manipulated range.
// tdf#99692 don't Move() back if that would end up in another node
// because moving backward is not necessarily the inverse of forward then.
- const bool bNullContent = aSavePam.GetPoint()->nContent == 0;
+ // (but do Move() back if we have split the node)
+ const bool bNullContent = !bSplit && aSavePam.GetPoint()->nContent == 0;
if( bNullContent )
{
aSavePam.GetPoint()->nNode--;