sw/source/core/tox/ToxWhitespaceStripper.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
New commits: commit f87b8aa06fd6f38a0e604d780c0bc2e62f201735 Author: Michael Stahl <michael.st...@cib.de> AuthorDate: Fri Jan 17 19:16:48 2020 +0100 Commit: Thorsten Behrens <thorsten.behr...@cib.de> CommitDate: Mon Jan 20 14:21:26 2020 +0100 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.st...@cib.de> (cherry picked from commit ae56432d7e34529cd5ad391f074737d3f5adf137) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87057 Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> 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(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits