diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-01-17 19:16:48 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-01-20 14:21:26 +0100 |
commit | f87b8aa06fd6f38a0e604d780c0bc2e62f201735 (patch) | |
tree | d452d6e48a6a3e11a788f79ed0b2d0144d2dd80d | |
parent | b7b95912f51463f3cc4cc038bb0234c8aaeac0b5 (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>
(cherry picked from commit ae56432d7e34529cd5ad391f074737d3f5adf137)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87057
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-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(); } |