diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-02-05 10:06:40 +0100 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-02-05 10:48:37 +0100 |
commit | a468e386695f470f65616adde4673aa43a562c51 (patch) | |
tree | d15bde185f02eeb3e65de4a74720db75921d3f9f /sw | |
parent | c53dd7ea947e0233d98edd3e5d2f07c65ea61f30 (diff) |
drawingML import: paragraph adjustment inside group shape
Change-Id: I875cb1f12c9f81d329d7fe9cd3aa32a4cd818573
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/dml-groupshape-paraadjust.docx | bin | 0 -> 17764 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 20 |
2 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/dml-groupshape-paraadjust.docx b/sw/qa/extras/ooxmlimport/data/dml-groupshape-paraadjust.docx Binary files differnew file mode 100644 index 000000000000..fc098955246e --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/dml-groupshape-paraadjust.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index d1035eb1217a..3fbf9ee32a22 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -48,6 +48,7 @@ #include <com/sun/star/xml/dom/XDocument.hpp> #include <com/sun/star/text/XDocumentIndex.hpp> #include <com/sun/star/style/CaseMap.hpp> +#include <com/sun/star/style/ParagraphAdjust.hpp> #include <vcl/svapp.hxx> #include <unotools/fltrcfg.hxx> #include <comphelper/sequenceashashmap.hxx> @@ -1788,6 +1789,25 @@ DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeCapitalization, "dml-groupshape-capita // 5th line has no capitalization CPPUNIT_ASSERT_EQUAL(style::CaseMap::NONE, getProperty<sal_Int16>(getRun(getParagraphOfText(5, xText), 1), "CharCaseMap")); } + +DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeParaAdjust, "dml-groupshape-paraadjust.docx") +{ + // Paragraph adjustment inside a group shape was not imported + uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY)->getText(); + // 2nd line is adjusted to the right + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_RIGHT), getProperty<sal_Int16>(getRun(getParagraphOfText(2, xText), 1), "ParaAdjust")); + // 3rd line has no adjustment + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_LEFT), getProperty<sal_Int16>(getRun(getParagraphOfText(3, xText), 1), "ParaAdjust")); + // 4th line is adjusted to center + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_CENTER), getProperty<sal_Int16>(getRun(getParagraphOfText(4, xText), 1), "ParaAdjust")); + // 5th line has no adjustment + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_LEFT), getProperty<sal_Int16>(getRun(getParagraphOfText(5, xText), 1), "ParaAdjust")); + // 6th line is justified + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_BLOCK), getProperty<sal_Int16>(getRun(getParagraphOfText(6, xText), 1), "ParaAdjust")); + // 7th line has no adjustment + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_LEFT), getProperty<sal_Int16>(getRun(getParagraphOfText(7, xText), 1), "ParaAdjust")); +} #endif CPPUNIT_PLUGIN_IMPLEMENT(); |