diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2021-11-24 12:23:10 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-11-24 22:22:44 +0100 |
commit | 87d8d435f2e3f43d28727b657ecbfb7b81d3f943 (patch) | |
tree | f42891797e4c4b0acb0f807e3c5d90089676e7ad /sw | |
parent | 8b9c9af2996704abc6d5655f4eae1c645560f0a2 (diff) |
tdf#145621 sw: fix crash pasting paragraph with cross-reference mark
At last, a case where copying a mark fails for legitimate reasons.
(regression from 4bf04dea9afb30a9395e80b07a81d1908937ee8b)
Change-Id: I7a318e03c0b0d30e204eadb5012f190edbbba486
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125767
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 36a005bb546e5ba68d2e7a57e0453999c7167e41)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125722
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/DocumentContentOperationsManager.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 0390ad42b6d3..4d0891a725fe 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -300,6 +300,12 @@ namespace sw ::sw::mark::InsertMode::CopyText); // Explicitly try to get exactly the same name as in the source // because NavigatorReminders, DdeBookmarks etc. ignore the proposed name + if (pNewMark == nullptr) + { + assert(IDocumentMarkAccess::GetType(*pMark) == IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK + || IDocumentMarkAccess::GetType(*pMark) == IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK); + continue; // can't insert duplicate cross reference mark + } rDestDoc.getIDocumentMarkAccess()->renameMark(pNewMark, pMark->GetName()); // copying additional attributes for bookmarks or fieldmarks |