diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-06-22 21:04:47 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-06-23 10:49:17 +0200 |
commit | ab6a5c9eb8eee1d3efcb8f46e16e172ea8f4b1d4 (patch) | |
tree | 32747c6f0a6a0450e0e494febc7407b5ee5a100b /helpcontent2 | |
parent | afb6dd43af5d1179c2e3cd8f00794cd4c3d75b2d (diff) |
tdf#119081 sw: fix RTF paste into outer table cell
Regression from commit ed654c4aa7f9f10fcb16127349009bc0c38b12e8 (Revert
"fdo#43869 use the old rtf importer for paste", 2012-11-30), the direct
problem is that SwXText::insertTextPortion() is now used by
writerfilter, so in case it's not as good as the internal API used by
the old RTF filter, we have a problem.
This function calls SwXCell::CreateCursor(), which calls
SwXCell::createTextCursor(), which uses Move() to go to the first
content node in the cell, but that means we end up at the inner cell's
XText for an outer cell.
So later when we want to go to the end of the outer cell, we can't, as
that would be a different XText and we throw an exception.
Fix the problem by instead using createTextCursorByRange(), which
immediately positions the cursor at the insert position, so the XText
will be correct.
FWIW, the ODF import at SwXMLImport::setTextInsertMode() also uses
createTextCursorByRange() to handle this situation.
(cherry picked from commit e0d0274c2b806f5148b413926ec2e58c75ce04a1)
Change-Id: I1db13b860bc60771d98c2b4099be73f4bf41c375
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96924
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'helpcontent2')
0 files changed, 0 insertions, 0 deletions