diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-01-17 19:16:48 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-01-20 11:02:23 +0100 |
commit | ae56432d7e34529cd5ad391f074737d3f5adf137 (patch) | |
tree | 2dac77f0682d199cefade640bf0afb95ebabdbed /sw | |
parent | ec1c08a68e45306d455b9df0432b8e915d74d124 (diff) |
sw: fix assert in ToX update on mw00_table_of_contents_templates.doc
... exported to RTF and re-imported:
soffice.bin: sw/source/core/txtnode/thints.cxx:1295: bool SwTextNode::InsertHint(SwTextAttr*, SetAttrMode): Assertion `!pAttr->GetEnd() || (*pAttr->GetEnd() <= Len())' failed.
The problem is that the text of a HandledTextToken is all whitespace and
a hint from 0 to 1 is inserted because mNewPositions.back() is
erroneously 1, no idea why it was doing that.
(regression from e5345f62bf525b6258736f1ce11a61b5e638e0ff)
Change-Id: I6ec290abe50c0f65a3244f0f0bb07e19741e878b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86996
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/tox/ToxWhitespaceStripper.cxx | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sw/source/core/tox/ToxWhitespaceStripper.cxx b/sw/source/core/tox/ToxWhitespaceStripper.cxx index fb9315862d6e..fc51a94c2e33 100644 --- a/sw/source/core/tox/ToxWhitespaceStripper.cxx +++ b/sw/source/core/tox/ToxWhitespaceStripper.cxx @@ -36,13 +36,11 @@ ToxWhitespaceStripper::ToxWhitespaceStripper(const OUString& inputString) } mNewPositions.push_back(buffer.getLength()-1); } - // Add one position if the position after the stripped string is requested, e.g., for attributes which - // extend beyond the string. - mNewPositions.push_back(buffer.getLength()); // strip the last whitespace (if there was one) if (lastCharacterWasWhitespace) { buffer.truncate(buffer.getLength() - 1); } + mNewPositions.push_back(buffer.getLength()); mStripped = buffer.getStr(); } |