summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-04-20 15:04:47 +0200
committerMiklos Vajna <vmiklos@collabora.com>2022-04-26 11:09:37 +0200
commit46268343a49b8c14f89b3ef0a2f1f4260ff7a490 (patch)
tree27226faa42e63620ae6d3a5bd721c52a2361a704
parentcecf7ae35e4e23e27480d441c3bd66ddfab342c4 (diff)
tdf#147723 sw_fieldmarkhide: fix crash when copying multiple fieldmarks
The problem is the UpdateFramesForAddDeleteRedline() call in makeMark(), this is called in a loop for multiple fieldmarks and when it's called for the first one, of course the other ones aren't in the document yet, so HideIterator::Next() can't find them. But this is only needed when inserting a new fieldmark anyway, so just disable for copying. (regression from commit 92384a813176b964a67bcbeb2fa617c554dbc4a2) Change-Id: Ic1b34d469a553cf7bbf2d1a99edaea900bdd7417 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133215 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 2f726fa41cbd249f2fb30222b29d5f30bce52e6e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133148 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit 93234133477d5f3268ffd441b1e2b7758c809dd4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133274 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--sw/source/core/doc/docbm.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 35d016c93ac0..e3c87f5ea065 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -687,8 +687,9 @@ namespace sw::mark
// no special array for these
break;
}
- if (eType == IDocumentMarkAccess::MarkType::TEXT_FIELDMARK
- || eType == IDocumentMarkAccess::MarkType::DATE_FIELDMARK)
+ if (eMode == InsertMode::New
+ && (eType == IDocumentMarkAccess::MarkType::TEXT_FIELDMARK
+ || eType == IDocumentMarkAccess::MarkType::DATE_FIELDMARK))
{
// due to SwInsText notifications everything is visible now - tell
// layout to hide as appropriate