dev/null |binary sw/qa/extras/ooxmlexport/data/watermark.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 36 ++++++++++++++++++++++++++- sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 26 ------------------- 4 files changed, 35 insertions(+), 27 deletions(-)
New commits: commit 6ada0b8f71eb9a5b0cf2d8d3e323727f8925a491 Author: Miklos Vajna <vmik...@suse.cz> Date: Sat Jun 15 12:45:32 2013 +0200 fdo#58819 testcase Change-Id: I94c5a92db38c929a0c8b15e7906a941e39594017 diff --git a/sw/qa/extras/ooxmlimport/data/watermark.docx b/sw/qa/extras/ooxmlexport/data/watermark.docx similarity index 100% rename from sw/qa/extras/ooxmlimport/data/watermark.docx rename to sw/qa/extras/ooxmlexport/data/watermark.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 024e317..d6812f0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -9,10 +9,12 @@ #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/drawing/FillStyle.hpp> +#include <com/sun/star/drawing/LineStyle.hpp> #include <com/sun/star/awt/Gradient.hpp> #include <com/sun/star/style/TabStop.hpp> #include <com/sun/star/packages/zip/ZipFileAccess.hpp> #include <com/sun/star/view/XViewSettingsSupplier.hpp> +#include <com/sun/star/text/RelOrientation.hpp> #include <com/sun/star/text/XTextFrame.hpp> #include <com/sun/star/text/XTextTable.hpp> #include <com/sun/star/text/XTextFramesSupplier.hpp> @@ -76,6 +78,8 @@ public: void testFdo65265(); void testFdo65655(); void testFDO63053(); + void testWatermark(); + CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) CPPUNIT_TEST(run); @@ -128,7 +132,7 @@ void Test::run() {"fdo65265.docx", &Test::testFdo65265}, {"fdo65655.docx", &Test::testFdo65655}, {"fdo63053.docx" , &Test::testFDO63053}, - + {"watermark.docx", &Test::testWatermark}, }; // Don't test the first import of these, for some reason those tests fail const char* aBlacklist[] = { @@ -737,6 +741,36 @@ void Test::testFDO63053() CPPUNIT_ASSERT_EQUAL(OUString("test1&test2"), xDocumentProperties->getSubject()); } +void Test::testWatermark() +{ + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xShape(xDraws->getByIndex(0), uno::UNO_QUERY); + // 1st problem: last character was missing + CPPUNIT_ASSERT_EQUAL(OUString("SAMPLE"), xShape->getString()); + + uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xShape, "CustomShapeGeometry"); + bool bFound = false; + for (int i = 0; i < aProps.getLength(); ++i) + if (aProps[i].Name == "TextPath") + bFound = true; + // 2nd problem: v:textpath wasn't imported + CPPUNIT_ASSERT_EQUAL(true, bFound); + + // 3rd problem: rotation angle was 315, not 45. + CPPUNIT_ASSERT_EQUAL(sal_Int32(45 * 100), getProperty<sal_Int32>(xShape, "RotateAngle")); + + // 4th problem: mso-position-vertical-relative:margin was ignored, VertOrientRelation was text::RelOrientation::FRAME. + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_PRINT_AREA, getProperty<sal_Int16>(xShape, "VertOrientRelation")); + + // These problems were in the exporter + // The textpath wasn't semi-transparent. + CPPUNIT_ASSERT_EQUAL(sal_Int16(50), getProperty<sal_Int16>(xShape, "FillTransparence")); + // The textpath had a stroke. + CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_NONE, getProperty<drawing::LineStyle>(xShape, "LineStyle")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index b1fc3d5..c0987d1 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -114,7 +114,6 @@ public: void testN592908_Picture(); void testN779630(); void testIndentation(); - void testWatermark(); void testPageBorderShadow(); void testN816593(); void testN820509(); @@ -200,7 +199,6 @@ void Test::run() {"n592908-picture.docx", &Test::testN592908_Picture}, {"n779630.docx", &Test::testN779630}, {"indentation.docx", &Test::testIndentation}, - {"watermark.docx", &Test::testWatermark}, {"page-border-shadow.docx", &Test::testPageBorderShadow}, {"n816593.docx", &Test::testN816593}, {"n820509.docx", &Test::testN820509}, @@ -1394,30 +1392,6 @@ void Test::testIndentation() CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, getProperty<sal_Int16>(xPropertySet, "WritingMode")); } -void Test::testWatermark() -{ - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xShape(xDraws->getByIndex(0), uno::UNO_QUERY); - // 1st problem: last character was missing - CPPUNIT_ASSERT_EQUAL(OUString("SAMPLE"), xShape->getString()); - - uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY); - uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xShape, "CustomShapeGeometry"); - bool bFound = false; - for (int i = 0; i < aProps.getLength(); ++i) - if (aProps[i].Name == "TextPath") - bFound = true; - // 2nd problem: v:textpath wasn't imported - CPPUNIT_ASSERT_EQUAL(true, bFound); - - // 3rd problem: rotation angle was 315, not 45. - CPPUNIT_ASSERT_EQUAL(sal_Int32(45 * 100), getProperty<sal_Int32>(xShape, "RotateAngle")); - - // 4th problem: mso-position-vertical-relative:margin was ignored, VertOrientRelation was text::RelOrientation::FRAME. - CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_PRINT_AREA, getProperty<sal_Int16>(xShape, "VertOrientRelation")); -} - void Test::testPageBorderShadow() { // The problem was that in w:pgBorders, child elements had a w:shadow attribute, but that was ignored. _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits