From bd2ada701aad2c4e85d03cd8db68eaeae081d91c Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 19 Nov 2019 15:39:33 +0100 Subject: ofz#18554 sw: fix Null-dereference due to overlapping fieldmarks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The problem is that the WW8 import wants to set a fieldmark on a range that contains only the CH_TXT_ATR_FIELDEND of another fieldmark: (rr) p io_pDoc->GetNodes()[12]->m_Text.copy(33,10) $30 = "\bÿÿÿ\001ÿÿÿ\001 " MarkManager::makeMark() must check that a new fieldmark never overlaps existing fieldmarks or meta-fields. While at it, it looks like the test in DocumentContentOperationsManager::DelFullPara() can't necessarily use the passed rPam, because it obviously deletes entire nodes, but at least SwRangeRedline::DelCopyOfSection() doesn't even set nContent on rPam. Also, the check in makeMark() triggers an assert in CppunitTest_sw_uiwriter testTextFormFieldInsertion because SwHistoryTextFieldmark::SetInDoc() was neglecting to subtract 1 from the end position for the CH_TXT_ATR_FIELDEND. Change-Id: I46c1955dd8dd422a41dcbb9bc68dbe09075b4922 Reviewed-on: https://gerrit.libreoffice.org/83000 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/qa/core/data/ww8/pass/ofz18554-1.doc | Bin 0 -> 23041 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 sw/qa/core/data/ww8/pass/ofz18554-1.doc (limited to 'sw/qa') diff --git a/sw/qa/core/data/ww8/pass/ofz18554-1.doc b/sw/qa/core/data/ww8/pass/ofz18554-1.doc new file mode 100644 index 000000000000..0a6b81d78b43 Binary files /dev/null and b/sw/qa/core/data/ww8/pass/ofz18554-1.doc differ -- cgit