diff options
author | Ri GangHu <sweetdream201@163.com> | 2013-08-04 14:39:18 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-08-22 17:06:10 +0200 |
commit | d3ffe3ed3fa1b80c7e54439673029e105940db80 (patch) | |
tree | b327a7ea5397c47be50109d15d7efd917d37d2ec /sw/qa | |
parent | 84184f957d004e1f7b7a361935d34b1fc2af51d6 (diff) |
fdo#67737 : fix for flip not being imported & rendered correctly
Signed-off-by: Adam Co <rattles2013@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/5272
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Change-Id: I5c8440edad0381e33b64f64bb54aa8f1bc304007
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo67737.docx | bin | 0 -> 21349 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 24 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 5 |
3 files changed, 27 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo67737.docx b/sw/qa/extras/ooxmlexport/data/fdo67737.docx Binary files differnew file mode 100644 index 000000000000..8be34ec7112a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo67737.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index f974d349dd48..d938671f710a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -110,6 +110,7 @@ public: void testTableFloating(); void testTableFloatingMargins(); void testFdo44689_start_page_7(); + void testFdo67737(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -196,6 +197,7 @@ void Test::run() {"table-floating.docx", &Test::testTableFloating}, {"table-floating-margins.docx", &Test::testTableFloatingMargins}, {"fdo44689_start_page_7.docx", &Test::testFdo44689_start_page_7}, + {"fdo67737.docx", &Test::testFdo67737}, }; // Don't test the first import of these, for some reason those tests fail const char* aBlacklist[] = { @@ -1193,6 +1195,28 @@ void Test::testFdo44689_start_page_7() CPPUNIT_ASSERT_EQUAL(sal_Int16(7), getProperty<sal_Int16>(xPara, "PageNumberOffset")); } +void Test::testFdo67737() +{ + // The problem was that imported shapes did not import and render the 'flip:x' and 'flip:y' attributes + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference<drawing::XShape> xArrow; + xDrawPage->getByIndex(0) >>= xArrow; + uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xArrow, "CustomShapeGeometry"); + for (int i = 0; i < aProps.getLength(); ++i) + { + const beans::PropertyValue& rProp = aProps[i]; + if (rProp.Name == "MirroredY") + { + CPPUNIT_ASSERT_EQUAL( true, bool(rProp.Value.get<sal_Bool>()) ); + return; + } + } + + // Shouldn't reach here + CPPUNIT_FAIL("Did not find MirroredY=true property"); +} + 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 f9d341603825..098b6c802dcd 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -253,13 +253,14 @@ void Test::testN751117() xPropertySet->getPropertyValue("LineEndName") >>= aValue; CPPUNIT_ASSERT(aValue.indexOf("Arrow") != -1); + // Rotating & Flipping will cause the angle to change from 90 degrees to 270 degrees sal_Int32 nValue = 0; xPropertySet->getPropertyValue("RotateAngle") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(90 * 100), nValue); + CPPUNIT_ASSERT_EQUAL(sal_Int32(270 * 100), nValue); uno::Reference<drawing::XShape> xShape(xPropertySet, uno::UNO_QUERY); awt::Size aActualSize(xShape->getSize()); - CPPUNIT_ASSERT(aActualSize.Width < 0); + CPPUNIT_ASSERT(aActualSize.Width > 0); // The second shape should be a line uno::Reference<lang::XServiceInfo> xServiceInfo(xDraws->getByIndex(1), uno::UNO_QUERY); |