summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-05-22 16:57:07 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-05-22 17:27:43 +0200
commit476316bfc9dd36c0613327c20822a193b5ca8d9b (patch)
tree99f33d8564a228a4fbcd0a6be5447154633ce98a /sw/qa
parente5d589bb3c2285362e2c89576cf14fc5e77262d0 (diff)
do reuse shape context
This is pretty much a revert of 60cb70b94537e9ff1155fb80255fc04ce41363b2. Turns out e.g. <v:shapetype> is not local only to its <w:pict>. Added a testcase. Change-Id: Ibbb9fe01bc2fc77dd67151bf4ca0905443eebf63
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmltok/data/n705956-2.docxbin0 -> 9363 bytes
-rw-r--r--sw/qa/extras/ooxmltok/ooxmltok.cxx27
2 files changed, 24 insertions, 3 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ooxmltok/data/n705956-2.docx
Binary files 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<sal_Int32>(106), bitmap->getSize().Height );
}
+void Test::testN705956_2()
+{
+ load( "n705956-2.docx" );
+/*
+<v:shapetype> must be global, reachable even from <v:shape> inside another <w:pict>
+image = ThisComponent.DrawPage.getByIndex(0)
+xray image.FillColor
+*/
+ uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPageSupplier> drawPageSupplier(textDocument, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> drawPage = drawPageSupplier->getDrawPage();
+ uno::Reference<drawing::XShape> image;
+ drawPage->getByIndex(0) >>= image;
+ uno::Reference<beans::XPropertySet> 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();