diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-08-30 20:12:46 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-08-31 09:29:40 +0200 |
commit | 4f4452f6a74201e862971a79ba5bdcd06f3ba9ce (patch) | |
tree | 9bb16643175e864d1a81f38aa44957960504773d /xmloff/qa/unit/data | |
parent | a36d1308f946d890fcdf7887169f284704e4a5bf (diff) |
tdf#126126 ODT import: improve import of cross-table commented text range
Regression from commit d4b473dd9ba77427b28d97847067b8877c2033d9
(office:annotation-end import, 2012-07-20), the problem was that
XMLAnnotationImportContext::EndElement() assumed that we can always call
gotoRange() to go from the annotation start and end points, but this is
not true: an annotation may start inside a table and end outside a
table, which is not a valid selection, so gotoRange() fails.
Fix the regression part by just creating a text range for the anchor of
the comment, so the comment is attached to the end of the range, and
this way the rest of the comment & the document can be at least opened.
[ It seems bookmarks behave similarly: they don't block the whole
import, but don't work cross table boundaries, either. ]
Change-Id: I1b5a2e2e7501ce3054379fc79d2045c3439c52e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121322
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'xmloff/qa/unit/data')
-rw-r--r-- | xmloff/qa/unit/data/comment-table-border.fodt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/xmloff/qa/unit/data/comment-table-border.fodt b/xmloff/qa/unit/data/comment-table-border.fodt new file mode 100644 index 000000000000..29f54da9afe3 --- /dev/null +++ b/xmloff/qa/unit/data/comment-table-border.fodt @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<office:document xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:body> + <office:text> + <table:table> + <table:table-column table:style-name="Table1.A"/> + <table:table-row> + <table:table-cell table:style-name="Table1.A1" office:value-type="string"> + <text:p>A<office:annotation office:name="0"><text:p>x</text:p></office:annotation>b</text:p> + </table:table-cell> + </table:table-row> + </table:table> + <text:p>b<office:annotation-end office:name="0"/><text:span>Z</text:span></text:p> + </office:text> + </office:body> +</office:document> |