[Libreoffice-commits] core.git: 2 commits - hwpfilter/source sw/qa
Caolán McNamara
caolanm at redhat.com
Thu Feb 26 08:27:09 PST 2015
hwpfilter/source/hwpread.cxx | 2 +-
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 19 ++++++++++---------
2 files changed, 11 insertions(+), 10 deletions(-)
New commits:
commit b6336c9c6799be6834f30779c08caae986a346f7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Feb 26 16:18:17 2015 +0000
wrong skip set here
Change-Id: I86bdd1c2603c984380b52b080504b7583155b0fb
diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx
index dbc4915..ca8e3ea 100644
--- a/hwpfilter/source/hwpread.cxx
+++ b/hwpfilter/source/hwpread.cxx
@@ -416,7 +416,7 @@ bool Picture::Read(HWPFile & hwpf)
skip[0] = tmp16;
if (!hwpf.Read2b(tmp16)) /* 세로 */
return false;
- skip[0] = tmp16;
+ skip[1] = tmp16;
if (!hwpf.Read2b(tmp16)) /* 확대비율 : 0 고정, 이외 퍼센트 단위 가로 */
return false;
scale[0] = tmp16;
commit 7ae75562b21c3c201483c1c9b9eac1563933feea
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Feb 26 15:52:44 2015 +0000
make test device independent
Change-Id: Id6f835a9eb8d679b293114a887a81dbf47260bbf
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 667a5bd..886769c 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -59,6 +59,7 @@
#include <com/sun/star/style/PageStyleLayout.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include <com/sun/star/util/DateTime.hpp>
+#include <vcl/bmpacc.hxx>
#include <vcl/svapp.hxx>
#include <unotest/assertion_traits.hxx>
#include <unotools/fltrcfg.hxx>
@@ -2208,15 +2209,15 @@ DECLARE_OOXMLIMPORT_TEST(testMsoBrightnessContrast, "msobrightnesscontrast.docx"
uno::Reference<graphic::XGraphic> graphic;
imageProperties->getPropertyValue( "Graphic" ) >>= graphic;
uno::Reference<awt::XBitmap> bitmap(graphic, uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL( sal_Int32(58), bitmap->getSize().Width );
- CPPUNIT_ASSERT_EQUAL( sal_Int32(320), bitmap->getSize().Height );
- const uno::Sequence< sal_Int8 > data = bitmap->getDIB(); // as .bmp data
- CPPUNIT_ASSERT_EQUAL( sal_Int32(56374), data.getLength());
- CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6e0])); // -50 = 206 pixel value
- CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6e1]));
- CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6e2]));
- CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6e3]));
- CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6e4]));
+ Graphic aVclGraphic(graphic);
+ Bitmap aBitmap(aVclGraphic.GetBitmap());
+ BitmapReadAccess* pAccess = aBitmap.AcquireReadAccess();
+ CPPUNIT_ASSERT(pAccess);
+ CPPUNIT_ASSERT_EQUAL(58L, pAccess->Width());
+ CPPUNIT_ASSERT_EQUAL(320L, pAccess->Height());
+ Color aColor(pAccess->GetPixel(30, 20));
+ CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), RGB_COLORDATA( 0xce, 0xce, 0xce ));
+ aBitmap.ReleaseAccess(pAccess);
}
DECLARE_OOXMLIMPORT_TEST(testChartSize, "chart-size.docx")
More information about the Libreoffice-commits
mailing list