diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-09-06 15:57:03 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-09-06 18:39:00 +0200 |
commit | 4cbc41bc4eaa822829e68c1ee11eafe834bb7da7 (patch) | |
tree | d683c9cb5549277dea4cc2feb6108245526c45b0 /sw | |
parent | 870a2394a87c77740daf41e1aa81b130113f8e00 (diff) |
bnc#779642 VML import: handle drawinglayer rectangle char spacing
Change-Id: I79fa72c9235682030d23a03fdb0c7c40370c4a8a
Diffstat (limited to 'sw')
-rwxr-xr-x | sw/qa/extras/ooxmlimport/data/groupshape-sdt.docx | bin | 0 -> 10742 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 16 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/groupshape-sdt.docx b/sw/qa/extras/ooxmlimport/data/groupshape-sdt.docx Binary files differnew file mode 100755 index 000000000000..072984779d72 --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/groupshape-sdt.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 08b2bfcba189..b933e856b58d 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -132,6 +132,7 @@ public: void testTablePagebreak(); void testFdo68607(); void testVmlTextVerticalAdjust(); + void testGroupshapeSdt(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -230,6 +231,7 @@ void Test::run() {"table-pagebreak.docx", &Test::testTablePagebreak}, {"fdo68607.docx", &Test::testFdo68607}, {"vml-text-vertical-adjust.docx", &Test::testVmlTextVerticalAdjust}, + {"groupshape-sdt.docx", &Test::testGroupshapeSdt}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1551,6 +1553,20 @@ void Test::testVmlTextVerticalAdjust() CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_TOP, getProperty<drawing::TextVerticalAdjust>(xShape, "TextVerticalAdjust")); } +void Test::testGroupshapeSdt() +{ + // All problems here are due to the groupshape: we have a drawinglayer rectangle, not a writer textframe. + uno::Reference<drawing::XShapes> xOuterGroupShape(getShape(1), uno::UNO_QUERY); + uno::Reference<drawing::XShapes> xInnerGroupShape(xOuterGroupShape->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xShape(xInnerGroupShape->getByIndex(0), uno::UNO_QUERY); + // Border distances were not implemented, this was 0. + CPPUNIT_ASSERT_EQUAL(sal_Int32(1905), getProperty<sal_Int32>(xShape, "TextUpperDistance")); + // Sdt field result wasn't imported, this was "". + CPPUNIT_ASSERT_EQUAL(OUString("placeholder text"), xShape->getString()); + // w:spacing was ignored in oox, this was 0. + CPPUNIT_ASSERT_EQUAL(sal_Int32(20), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xShape->getText()), 1), "CharKerning")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |