summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/docbm.cxx
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-11-25 15:51:24 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-11-26 10:01:13 +0100
commitfbb3514aee8261211790b23586752d5be9ac2f34 (patch)
tree60ce1571ce6a6896fdb1d1cccd49fcd530815aac /sw/source/core/doc/docbm.cxx
parent85ed301feee92f799bcb9ddd54660a9f52ff5a2a (diff)
ofz#19065 sw: invalid fieldmarks created in SwWW8ImplReader::End_Field
The problem is that the check added in commit 06767a5394f1dfba71c4f0a2a07daa5664bdbd01 "sw: WW8: do not create fieldmark with start in frame and end in body" doesn't work as well as imagined; the CheckNodesRange will only check against mismatching top-level and second-level (in the non-body-text top-levels) sections, whereas in this case the start is in one table cell and the end in the next one. So replace that and move the check into MarkManager::makeMark(), so other things than WW8 import are also checked. Change-Id: I2bf32e7b579d87600b6b6718a3222f37c14aa53d Reviewed-on: https://gerrit.libreoffice.org/83585 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/core/doc/docbm.cxx')
-rw-r--r--sw/source/core/doc/docbm.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index dec1b3d58654..f736348480a5 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -583,6 +583,15 @@ namespace sw { namespace mark
}
if ((eType == MarkType::TEXT_FIELDMARK || eType == MarkType::DATE_FIELDMARK)
+ && (rPaM.GetPoint()->nNode.GetNode().StartOfSectionNode() != rPaM.GetMark()->nNode.GetNode().StartOfSectionNode()
+ || (pSepPos && rPaM.GetPoint()->nNode.GetNode().StartOfSectionNode() != pSepPos->nNode.GetNode().StartOfSectionNode())))
+ {
+ SAL_WARN("sw.core", "MarkManager::makeMark(..)"
+ " - invalid range on fieldmark, different nodes array sections");
+ return nullptr;
+ }
+
+ if ((eType == MarkType::TEXT_FIELDMARK || eType == MarkType::DATE_FIELDMARK)
// can't check for Copy - it asserts - but it's also obviously unnecessary
&& eMode == InsertMode::New
&& sw::mark::IsFieldmarkOverlap(rPaM))