From 476316bfc9dd36c0613327c20822a193b5ca8d9b Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Tue, 22 May 2012 16:57:07 +0200 Subject: do reuse shape context This is pretty much a revert of 60cb70b94537e9ff1155fb80255fc04ce41363b2. Turns out e.g. is not local only to its . Added a testcase. Change-Id: Ibbb9fe01bc2fc77dd67151bf4ca0905443eebf63 --- sw/qa/extras/ooxmltok/data/n705956-2.docx | Bin 0 -> 9363 bytes sw/qa/extras/ooxmltok/ooxmltok.cxx | 27 ++++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 sw/qa/extras/ooxmltok/data/n705956-2.docx (limited to 'sw/qa') diff --git a/sw/qa/extras/ooxmltok/data/n705956-2.docx b/sw/qa/extras/ooxmltok/data/n705956-2.docx new file mode 100644 index 000000000000..138818523a92 Binary files /dev/null and b/sw/qa/extras/ooxmltok/data/n705956-2.docx differ diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx b/sw/qa/extras/ooxmltok/ooxmltok.cxx index 2b639e0959ae..c822bf4c7283 100644 --- a/sw/qa/extras/ooxmltok/ooxmltok.cxx +++ b/sw/qa/extras/ooxmltok/ooxmltok.cxx @@ -56,7 +56,8 @@ public: void testN757890(); void testFdo49940(); void testN751077(); - void testN705956(); + void testN705956_1(); + void testN705956_2(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -67,7 +68,8 @@ public: CPPUNIT_TEST(testN757890); CPPUNIT_TEST(testFdo49940); CPPUNIT_TEST(testN751077); - CPPUNIT_TEST(testN705956); + CPPUNIT_TEST(testN705956_1); + CPPUNIT_TEST(testN705956_2); #endif CPPUNIT_TEST_SUITE_END(); @@ -241,7 +243,7 @@ xray para.PageStyleName CPPUNIT_ASSERT_EQUAL( OUString( "First Page" ), value ); } -void Test::testN705956() +void Test::testN705956_1() { load( "n705956-1.docx" ); /* @@ -263,6 +265,25 @@ xray graphic.Size CPPUNIT_ASSERT_EQUAL( static_cast(106), bitmap->getSize().Height ); } +void Test::testN705956_2() +{ + load( "n705956-2.docx" ); +/* + must be global, reachable even from inside another +image = ThisComponent.DrawPage.getByIndex(0) +xray image.FillColor +*/ + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference drawPageSupplier(textDocument, uno::UNO_QUERY); + uno::Reference drawPage = drawPageSupplier->getDrawPage(); + uno::Reference image; + drawPage->getByIndex(0) >>= image; + uno::Reference imageProperties(image, uno::UNO_QUERY); + sal_Int32 fillColor; + imageProperties->getPropertyValue( "FillColor" ) >>= fillColor; + CPPUNIT_ASSERT_EQUAL( 0xc0504d, fillColor ); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit