diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2016-11-05 11:50:18 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-02-08 11:56:05 +0100 |
commit | b87753d5febe573508ae9105ed0cb70c7465256c (patch) | |
tree | 8e6fd97e68400fea30784e66730d0a77d458d0b9 /sw/qa/extras | |
parent | 9e7ed752229778946bcb3791eafb8fb6df935018 (diff) |
tdf#103753: DOCX: Handle relative positions to left or right margin
Positioning relative to left or right margin in MS Word
works the same as the positioning relative to left or right
page border in LO Writer.
Reviewed-on: https://gerrit.libreoffice.org/30376
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
Change-Id: I476a5e9e76f766b7fb7f1c7f4a068af8bb3c8813
Reviewed-on: https://gerrit.libreoffice.org/30377
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 18ef4766a97340fb9e0adc4ac7ee4feb90213a64)
Diffstat (limited to 'sw/qa/extras')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf103573.docx | bin | 0 -> 16155 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport7.cxx | 19 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf103573.docx b/sw/qa/extras/ooxmlexport/data/tdf103573.docx Binary files differnew file mode 100644 index 000000000000..34d7e3367d9e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf103573.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx index 764ddb026361..21d224d9cdd1 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx @@ -23,6 +23,8 @@ #include <com/sun/star/style/LineSpacing.hpp> #include <com/sun/star/style/LineSpacingMode.hpp> #include <com/sun/star/text/GraphicCrop.hpp> +#include <com/sun/star/text/HoriOrientation.hpp> +#include <com/sun/star/text/RelOrientation.hpp> #include <pagedesc.hxx> #include <comphelper/sequenceashashmap.hxx> @@ -1133,6 +1135,23 @@ DECLARE_OOXMLEXPORT_TEST(testTdf95031, "tdf95031.docx") CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraph(3), "ParaTopMargin")); } +DECLARE_OOXMLEXPORT_TEST(testTdf103573, "tdf103573.docx") +{ + // Relative positions to the left or right margin (MS Word naming) was not handled. + uno::Reference<beans::XPropertySet> xShapeProperties( getShape(1), uno::UNO_QUERY ); + sal_Int16 nValue; + xShapeProperties->getPropertyValue("HoriOrient") >>= nValue; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Not centered horizontally", text::HoriOrientation::CENTER, nValue); + xShapeProperties->getPropertyValue("HoriOrientRelation") >>= nValue; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Not centered horizontally relatively to left page border", text::RelOrientation::PAGE_LEFT, nValue); + + xShapeProperties.set( getShape(2), uno::UNO_QUERY ); + xShapeProperties->getPropertyValue("HoriOrient") >>= nValue; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Not centered horizontally", text::HoriOrientation::CENTER, nValue); + xShapeProperties->getPropertyValue("HoriOrientRelation") >>= nValue; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Not centered horizontally relatively to right page border", text::RelOrientation::PAGE_RIGHT, nValue); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); |