sw: WW8 import: try to prevent overlapping field-marks and redlines
As one knows, the features of Writer's document model that most impress by their sheer quality of implementation are redlines and field marks. Unsurprisingly, if the two meet in the context of the WW8 import, epic disasters are imminent; ooo83574-1.doc is one such train wreck that asserts with: sw/source/core/crsr/bookmrk.cxx:111: void {anonymous}::lcl_RemoveFieldMarks(sw::mark::Fieldmark*, SwDoc*, sal_Unicode, sal_Unicode): Assertion `pStartTextNode->GetText()[rStart.nContent.GetIndex()] == aStartMark' failed. This happens when, at the end of the import, the redlines are hidden by moving them into their special SwNodes section. The reason why this one asserts is that a previous SwRedline erroneously deleted the start dummy char of this field mark, because that SwRedline had the wrong start/end positions. In Word the problematic paragraph is shown like this, where \a\b mark fields and I D F redlines: "Coming out of the work of Rummler and Brache’s \a(Rummler & Brache, 1995)(1995)\b work is the is the notion IIIIIIIIIIIIDDDDDDDDDDDDDDDDDDDDD IIIIIIIIIIIIIIIIIIIIIIIIDDDDDD DDDDDDDDDDDDIIIIIII another” \a(p. 9)\b\a(Rummler & Brache, 1995, p. 9)\b.. ( italics in the original)" IIIIII DDDDDDDDDDDDDDDDDDDDDDDDDDDDDD IDDDIDDDDDDDDDDDDDDDDDDDDDDDD FFFFFFFFFFFFFFFFFFFFFFFFFF The first mis-positioned redline here ranges from 71 to 79, ")(1995)\b", so it deletes the end dummy char of the field mark. It should range from 72 to 78. This commit adds some rather crude hacks which appear to work to avoid the problem: 1. when a field mark is inserted, the start positions of the redlines may need to be moved 2. when the end position of a redline is set, it may need adjustment to exclude a field-mark that ends at the same position Change-Id: I723f1858c84def2c063e2cb126317d06e8ac98b5
Showing
Please
register
or
sign in
to comment