summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2018-12-17 21:13:00 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2019-01-16 15:26:48 +0100
commitba7435e5914a713730265c3378ce616de543667f (patch)
tree8a061b8367df6115f38afc902ccbc8b1d9cfe4df /sw/qa
parent3376b0e94f0638c927a37c32322bf67d42ebb00f (diff)
tdf#121804 DOCX import: handle sub/superscript inside group shapes
Regression from commit d5c934d150cb6cea5f96cbbee4fb5e8312bf027e (n#792778 DOCX import: parse group shapes in oox only, 2012-12-14), where where manual wordprocessingML -> drawingML translation did not handle this character property. Change-Id: I87481bc9c26651fd15dd39a58a92f467e8311256 Reviewed-on: https://gerrit.libreoffice.org/65289 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit dafbc86037d63e938967c0f501bdfe3ae19fa992) Reviewed-on: https://gerrit.libreoffice.org/65414 Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf121804.docxbin0 -> 17629 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport2.cxx18
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf121804.docx b/sw/qa/extras/ooxmlimport/data/tdf121804.docx
new file mode 100644
index 000000000000..af3f0d247952
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf121804.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index b7e75e9c28fe..833c2ed7e822 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -208,6 +208,24 @@ DECLARE_OOXMLIMPORT_TEST(testTdf113946, "tdf113946.docx")
CPPUNIT_ASSERT_EQUAL(OUString("1696"), aTop);
}
+DECLARE_OOXMLIMPORT_TEST(testTdf121804, "tdf121804.docx")
+{
+ uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xShape(xGroup->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xFirstPara = getParagraphOfText(1, xShape->getText());
+ uno::Reference<text::XTextRange> xFirstRun = getRun(xFirstPara, 1);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0),
+ getProperty<sal_Int32>(xFirstRun, "CharEscapement"));
+ // This failed with a NoSuchElementException, super/subscript property was
+ // lost on import, so the whole paragraph was a single run.
+ uno::Reference<text::XTextRange> xSecondRun = getRun(xFirstPara, 2);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(30),
+ getProperty<sal_Int32>(xSecondRun, "CharEscapement"));
+ uno::Reference<text::XTextRange> xThirdRun = getRun(xFirstPara, 3);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-25),
+ getProperty<sal_Int32>(xThirdRun, "CharEscapement"));
+}
+
DECLARE_OOXMLIMPORT_TEST(testTdf114217, "tdf114217.docx")
{
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);