summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlimport
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-02-26 17:42:10 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-02-26 18:02:54 +0000
commit94d1498675e4d23197262d400fd103c2ee01c2dd (patch)
treeb5dd5f7eb9f4815fdc83ba4dbaee3a4d9a937db2 /sw/qa/extras/ooxmlimport
parent1f1627f068b2c232c0191538c697f6caa418ba5d (diff)
make test device independent
Change-Id: Ia8e18db1870dbecc7b2edb2f4908ada806ff2a95
Diffstat (limited to 'sw/qa/extras/ooxmlimport')
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx26
1 files changed, 11 insertions, 15 deletions
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 886769c7c134..7ceb756b3aa9 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1982,21 +1982,17 @@ DECLARE_OOXMLIMPORT_TEST(testPictureWithSchemeColor, "picture-with-schemecolor.d
// it's color during import.
uno::Reference<beans::XPropertySet> xImage(getShape(1), uno::UNO_QUERY);
uno::Reference<graphic::XGraphic> xGraphic = getProperty<uno::Reference<graphic::XGraphic> >(xImage, "Graphic");
- uno::Reference<awt::XBitmap> xBitmap(xGraphic, uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(341), xBitmap->getSize().Width );
- CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(181), xBitmap->getSize().Height );
-
- // Check some bits of the bitmap which change when color is imported.
- const uno::Sequence< sal_Int8 > aDIB = xBitmap->getDIB();
- CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int8>(-91), aDIB[54] );
- CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int8>(110), aDIB[55] );
- CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int8>(49), aDIB[56] );
- CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int8>(-36), aDIB[96] );
- CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int8>(-57), aDIB[97] );
- CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int8>(-80), aDIB[98] );
- CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int8>(-91), aDIB[135] );
- CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int8>(110), aDIB[136] );
- CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int8>(49), aDIB[137] );
+ Graphic aVclGraphic(xGraphic);
+ Bitmap aBitmap(aVclGraphic.GetBitmap());
+ BitmapReadAccess* pAccess = aBitmap.AcquireReadAccess();
+ CPPUNIT_ASSERT(pAccess);
+ CPPUNIT_ASSERT_EQUAL(341L, pAccess->Width());
+ CPPUNIT_ASSERT_EQUAL(181L, pAccess->Height());
+ Color aColor(pAccess->GetPixel(30, 120));
+ CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), RGB_COLORDATA( 0xb1, 0xc8, 0xdd ));
+ aColor = pAccess->GetPixel(130, 260);
+ CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), RGB_COLORDATA( 0xb1, 0xc8, 0xdd ));
+ aBitmap.ReleaseAccess(pAccess);
}
DECLARE_OOXMLIMPORT_TEST(testFdo69656, "Table_cell_auto_width_fdo69656.docx")