diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-30 13:02:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-31 14:08:44 +0200 |
commit | d4442ac1ac9aae36dbc08fda8154d71ea0f81708 (patch) | |
tree | 62fdc7419391dbf8c1cd92872ba2c9e12df2c4b6 /sw | |
parent | b7939ff897a173086643819451c7b2b4553c11c3 (diff) |
drop Graphic::GetBitmap
so that we flush out various code using Bitmap, in favour of using
BitmapEx.
This is part of the process of making Bitmap largely an internal detail
of vcl
Change-Id: Iaf2ead5e3d9960838723fb55b812b97108093d74
Reviewed-on: https://gerrit.libreoffice.org/55062
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/inc/swmodeltestbase.hxx | 5 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport10.cxx | 24 | ||||
-rw-r--r-- | sw/source/uibase/dochdl/swdtflvr.cxx | 2 |
3 files changed, 15 insertions, 16 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx index 5a11a088b9ba..d66208ccfdc5 100644 --- a/sw/qa/extras/inc/swmodeltestbase.hxx +++ b/sw/qa/extras/inc/swmodeltestbase.hxx @@ -989,7 +989,10 @@ inline void assertBorderEqual( inline std::ostream& operator<<(std::ostream& rStrm, const Color& rColor) { - rStrm << "Color: R:" << static_cast<int>(rColor.GetRed()) << " G:" << static_cast<int>(rColor.GetGreen()) << " B: " << static_cast<int>(rColor.GetBlue()); + rStrm << "Color: R:" << static_cast<int>(rColor.GetRed()) + << " G:" << static_cast<int>(rColor.GetGreen()) + << " B:" << static_cast<int>(rColor.GetBlue()) + << " A:" << static_cast<int>(rColor.GetTransparency()); return rStrm; } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx index fcfea4083551..a4272feb459c 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -359,14 +359,12 @@ DECLARE_OOXMLEXPORT_TEST(testPictureWithSchemeColor, "picture-with-schemecolor.d uno::Reference<beans::XPropertySet> xImage(getShape(1), uno::UNO_QUERY); uno::Reference<graphic::XGraphic> xGraphic = getProperty<uno::Reference<graphic::XGraphic> >(xImage, "Graphic"); Graphic aVclGraphic(xGraphic); - Bitmap aBitmap(aVclGraphic.GetBitmap()); - Bitmap::ScopedReadAccess pAccess(aBitmap); - CPPUNIT_ASSERT(pAccess); - CPPUNIT_ASSERT_EQUAL(341L, pAccess->Width()); - CPPUNIT_ASSERT_EQUAL(181L, pAccess->Height()); - Color aColor(pAccess->GetPixel(30, 120).GetColor()); + BitmapEx aBitmap(aVclGraphic.GetBitmapEx()); + CPPUNIT_ASSERT_EQUAL(341L, aBitmap.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(181L, aBitmap.GetSizePixel().Height()); + Color aColor(aBitmap.GetPixelColor(120, 30)); CPPUNIT_ASSERT_EQUAL(aColor, Color( 0xb1, 0xc8, 0xdd )); - aColor = pAccess->GetPixel(130, 260).GetColor(); + aColor = aBitmap.GetPixelColor(260, 130); CPPUNIT_ASSERT_EQUAL(aColor, Color( 0xb1, 0xc8, 0xdd )); } @@ -537,13 +535,11 @@ DECLARE_OOXMLEXPORT_TEST(testMsoBrightnessContrast, "msobrightnesscontrast.docx" imageProperties->getPropertyValue( "Graphic" ) >>= graphic; uno::Reference<awt::XBitmap> bitmap(graphic, uno::UNO_QUERY); Graphic aVclGraphic(graphic); - Bitmap aBitmap(aVclGraphic.GetBitmap()); - Bitmap::ScopedReadAccess pAccess(aBitmap); - CPPUNIT_ASSERT(pAccess); - CPPUNIT_ASSERT_EQUAL(58L, pAccess->Width()); - CPPUNIT_ASSERT_EQUAL(320L, pAccess->Height()); - Color aColor(pAccess->GetPixel(30, 20).GetColor()); - CPPUNIT_ASSERT_EQUAL(aColor, Color( 0xce, 0xce, 0xce )); + BitmapEx aBitmap(aVclGraphic.GetBitmapEx()); + CPPUNIT_ASSERT_EQUAL(58L, aBitmap.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(320L, aBitmap.GetSizePixel().Height()); + Color aColor(aBitmap.GetPixelColor(20, 30)); + CPPUNIT_ASSERT_EQUAL(Color( 255, 0xce, 0xce, 0xce ), aColor); } DECLARE_OOXMLEXPORT_TEST(testChartSize, "chart-size.docx") diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 85e1638aafed..5c7a9f474780 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -797,7 +797,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut ) SwDoc *const pDoc = lcl_GetDoc(*m_pClpDocFac); m_pWrtShell->Copy( pDoc ); - if (m_pOrigGraphic && !m_pOrigGraphic->GetBitmap().IsEmpty()) + if (m_pOrigGraphic && !m_pOrigGraphic->GetBitmapEx().IsEmpty()) AddFormat( SotClipboardFormatId::SVXB ); PrepareOLE( m_aObjDesc ); |