summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-05-18 19:10:12 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-05-18 19:24:54 +0200
commita28f5713a7e91b5d99cc0e63470db1512b997320 (patch)
tree55a71c027634a70da97281406e011025b8e75aa5 /sw
parent1735044e9f693cde1af0d905d264c849e3fce311 (diff)
testcase for part of bnc#705956
60cb70b94537e9ff1155fb80255fc04ce41363b2 specifically Change-Id: I160b24505d3e2425ce807f92f80d6737b725941b
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmltok/data/n705956-1.docxbin0 -> 7861 bytes
-rw-r--r--sw/qa/extras/ooxmltok/ooxmltok.cxx25
2 files changed, 25 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmltok/data/n705956-1.docx b/sw/qa/extras/ooxmltok/data/n705956-1.docx
new file mode 100644
index 000000000000..edff3bac412c
--- /dev/null
+++ b/sw/qa/extras/ooxmltok/data/n705956-1.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx b/sw/qa/extras/ooxmltok/ooxmltok.cxx
index 896b9fd78fa7..1238192745b6 100644
--- a/sw/qa/extras/ooxmltok/ooxmltok.cxx
+++ b/sw/qa/extras/ooxmltok/ooxmltok.cxx
@@ -27,6 +27,7 @@
#include "../swmodeltestbase.hxx"
+#include <com/sun/star/awt/XBitmap.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -55,6 +56,7 @@ public:
void testN757890();
void testFdo49940();
void testN751077();
+ void testN705956();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -65,6 +67,7 @@ public:
CPPUNIT_TEST(testN757890);
CPPUNIT_TEST(testFdo49940);
CPPUNIT_TEST(testN751077);
+ CPPUNIT_TEST(testN705956);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -238,6 +241,28 @@ xray para.PageStyleName
CPPUNIT_ASSERT_EQUAL( OUString( "First Page" ), value );
}
+void Test::testN705956()
+{
+ load( "n705956-1.docx" );
+/*
+Get the first image in the document and check it's the one image in the document.
+image = ThisComponent.DrawPage.getByIndex(0)
+graphic = image.Graphic
+xray graphic.Size
+*/
+ 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);
+ uno::Reference<graphic::XGraphic> graphic;
+ imageProperties->getPropertyValue( "Graphic" ) >>= graphic;
+ uno::Reference<awt::XBitmap> bitmap(graphic, uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL( 120, bitmap->getSize().Width );
+ CPPUNIT_ASSERT_EQUAL( 106, bitmap->getSize().Height );
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();