From a31a07783502c891b2b17ea3adfa030ad37bd7d2 Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Tue, 1 Sep 2015 10:46:42 +0200 Subject: tdf#93830 txXfrm offset workaround works in rounded rectangle case as well Change-Id: I5d8df5c0d55e8dfd7c978b16b2b220c127f3dac9 Reviewed-on: https://gerrit.libreoffice.org/18226 Tested-by: Jenkins Reviewed-by: Andras Timar (cherry picked from commit cc88a88caad591270760d947848ad0a032d32bdb) Reviewed-on: https://gerrit.libreoffice.org/18270 Reviewed-by: Miklos Vajna --- sd/qa/unit/data/pptx/tdf93830.pptx | Bin 0 -> 64463 bytes sd/qa/unit/import-tests.cxx | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 sd/qa/unit/data/pptx/tdf93830.pptx (limited to 'sd') diff --git a/sd/qa/unit/data/pptx/tdf93830.pptx b/sd/qa/unit/data/pptx/tdf93830.pptx new file mode 100644 index 000000000000..8415daff3521 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf93830.pptx differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index a1b9703f4ac7..654b22840144 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -104,6 +104,7 @@ public: void testBulletSuffix(); void testBnc910045(); void testRowHeight(); + void testTdf93830(); CPPUNIT_TEST_SUITE(SdImportTest); @@ -143,6 +144,7 @@ public: CPPUNIT_TEST(testBulletSuffix); CPPUNIT_TEST(testBnc910045); CPPUNIT_TEST(testRowHeight); + CPPUNIT_TEST(testTdf93830); CPPUNIT_TEST_SUITE_END(); }; @@ -1200,6 +1202,29 @@ void SdImportTest::testRowHeight() CPPUNIT_ASSERT_EQUAL( sal_Int32(508), nHeight); } +void SdImportTest::testTdf93830() +{ + // Text shape offset was ignored + sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/tdf93830.pptx"), PPTX); + + uno::Reference< drawing::XDrawPagesSupplier > xDoc( + xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW ); + + uno::Reference< drawing::XDrawPage > xPage( + xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW ); + + // Get the first text box from group shape + uno::Reference< container::XIndexAccess > xShape( xPage->getByIndex(0), uno::UNO_QUERY ); + uno::Reference< beans::XPropertySet > xPropSet( xShape->getByIndex(2), uno::UNO_QUERY ); + CPPUNIT_ASSERT_MESSAGE( "no textbox shape", xPropSet.is() ); + + sal_Int32 nTextLeftDistance = 0; + xPropSet->getPropertyValue( "TextLeftDistance" ) >>= nTextLeftDistance; + CPPUNIT_ASSERT_EQUAL(sal_Int32(4152), nTextLeftDistance); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit v1.2.3