Kaydet (Commit) 2dda1cd4 authored tarafından Luboš Luňák's avatar Luboš Luňák

tests for msoffice brightness+contrast

For commits 1139d618 and
893fe884 .

Change-Id: Ia59ec5c4226944280c4b585c87179d28303bda4b
üst 893fe884
......@@ -2089,6 +2089,25 @@ DECLARE_OOXMLIMPORT_TEST(testGridBefore, "gridbefore.docx")
CPPUNIT_ASSERT( leftA3.toInt32() > leftB2.toInt32());
}
DECLARE_OOXMLIMPORT_TEST(testMsoBrightnessContrast, "msobrightnesscontrast.docx")
{
uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<drawing::XShape> image(getShape(1), uno::UNO_QUERY);
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( 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]));
}
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
......
This diff was suppressed by a .gitattributes entry.
......@@ -10,6 +10,8 @@
#if !defined(MACOSX) && !defined(WNT)
#include <com/sun/star/awt/XBitmap.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/table/TableBorder.hpp>
#include <com/sun/star/table/TableBorder2.hpp>
......@@ -375,6 +377,25 @@ DECLARE_WW8IMPORT_TEST(testBorderColours, "bordercolours.doc")
#endif
}
DECLARE_WW8IMPORT_TEST(testMsoBrightnessContrast, "msobrightnesscontrast.doc")
{
uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<drawing::XShape> image(getShape(1), uno::UNO_QUERY);
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( 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(20278), data.getLength());
CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6b0])); // -50 = 206 pixel value
CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6b1]));
CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6b2]));
CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6b3]));
CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6b4]));
}
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment