summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-07-03 10:35:48 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-07-03 12:58:16 +0200
commit132803f99818bffbdc260918ad7a304f228f2843 (patch)
tree2ad2132ea85ce9bd554ec0e7d650fbd33de9e53b /sw/qa
parent58ef52cf3258030860d34f05bc19e2b42d9503c6 (diff)
sw comments on frames: fix DOC handling
The export part didn't use HasFlysAt() to decide what to do with empty annotation marks. Regarding the import side, the only problem was that the start of the annotation range wasn't adjusted to cover the comment anchor, similar to what the UI and the UNO API already does. Change-Id: Ibcbaafa9f3f70de95a70b424aca31ebdc9df099d Reviewed-on: https://gerrit.libreoffice.org/75025 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ww8export/data/image-comment-at-char.docbin0 -> 24064 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx17
2 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/data/image-comment-at-char.doc b/sw/qa/extras/ww8export/data/image-comment-at-char.doc
new file mode 100644
index 000000000000..e0d5e2cba456
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/image-comment-at-char.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index fcf5fc44379f..20de0969805a 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -259,6 +259,23 @@ DECLARE_WW8EXPORT_TEST(testTdf118375export, "tdf118375_240degClockwise.doc")
CPPUNIT_ASSERT_DOUBLES_EQUAL(1152.0, static_cast<double>(nPosY), 1.0);
}
+DECLARE_WW8EXPORT_TEST(testImageCommentAtChar, "image-comment-at-char.doc")
+{
+ uno::Reference<text::XTextRange> xPara = getParagraph(1);
+ CPPUNIT_ASSERT_EQUAL(OUString("Text"),
+ getProperty<OUString>(getRun(xPara, 1), "TextPortionType"));
+ // Without the accompanying fix in place, this test would have failed with 'Expected:
+ // Annotation; Actual: Frame', i.e. the comment start before the image was lost.
+ CPPUNIT_ASSERT_EQUAL(OUString("Annotation"),
+ getProperty<OUString>(getRun(xPara, 2), "TextPortionType"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Frame"),
+ getProperty<OUString>(getRun(xPara, 3), "TextPortionType"));
+ CPPUNIT_ASSERT_EQUAL(OUString("AnnotationEnd"),
+ getProperty<OUString>(getRun(xPara, 4), "TextPortionType"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Text"),
+ getProperty<OUString>(getRun(xPara, 5), "TextPortionType"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */