avmedia/source/win/framegrabber.cxx           |    3 ++-
 basic/source/runtime/methods.cxx              |    3 ++-
 emfio/source/reader/mtftools.cxx              |    2 +-
 filter/source/msfilter/msdffimp.cxx           |    2 +-
 include/vcl/graph.hxx                         |    6 +-----
 sc/source/filter/excel/xiescher.cxx           |    4 ++--
 sd/source/core/drawdoc4.cxx                   |    2 +-
 sd/source/ui/dlg/vectdlg.cxx                  |    2 +-
 sd/source/ui/view/sdview3.cxx                 |    6 +++---
 sfx2/source/appl/linkmgr2.cxx                 |    2 +-
 svtools/qa/unit/GraphicObjectTest.cxx         |    2 +-
 svx/source/dialog/_bmpmask.cxx                |    6 +++---
 svx/source/svdraw/svdfmtf.cxx                 |   10 +++++-----
 svx/source/xoutdev/_xoutbmp.cxx               |    2 +-
 vcl/inc/graphic/Manager.hxx                   |    1 -
 vcl/inc/impgraph.hxx                          |    6 +-----
 vcl/qa/cppunit/BackendTest.cxx                |    2 +-
 vcl/qa/cppunit/BitmapFilterTest.cxx           |    4 ++--
 vcl/qa/cppunit/BitmapScaleTest.cxx            |   16 ++++++++--------
 vcl/qa/cppunit/graphicfilter/filters-test.cxx |    2 +-
 vcl/source/bitmap/bitmap.cxx                  |    2 +-
 vcl/source/filter/igif/gifread.cxx            |    2 +-
 vcl/source/filter/ixpm/xpmread.cxx            |    2 +-
 vcl/source/filter/jpeg/JpegReader.cxx         |    6 +++---
 vcl/source/gdi/graph.cxx                      |    5 -----
 vcl/source/gdi/impgraph.cxx                   |   11 -----------
 vcl/source/gdi/pdfwriter_impl2.cxx            |    2 +-
 vcl/source/graphic/GraphicObject2.cxx         |    4 ++--
 vcl/source/graphic/Manager.cxx                |    7 -------
 29 files changed, 47 insertions(+), 77 deletions(-)

New commits:
commit 51599676667b2b6e81e51fc321a19033a3094773
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Thu Aug 13 08:49:30 2020 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Sat Aug 15 17:13:55 2020 +0200

    remove constructor with plain Bitmap from Graphic, use BitmapEx
    
    Change-Id: Ie429a10a8f54c6779d437ee4bc75a5ea0c427848
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100727
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/avmedia/source/win/framegrabber.cxx 
b/avmedia/source/win/framegrabber.cxx
index 3b03c68e4e67..4fd0d8b519b2 100644
--- a/avmedia/source/win/framegrabber.cxx
+++ b/avmedia/source/win/framegrabber.cxx
@@ -183,7 +183,8 @@ uno::Reference< graphic::XGraphic > SAL_CALL 
FrameGrabber::grabFrame( double fMe
 
                         if( ReadDIB(aBmp, aMemStm, false ) && !aBmp.IsEmpty() )
                         {
-                            const Graphic aGraphic( aBmp );
+                            BitmapEx aBitmapEx(aBmp);
+                            Graphic aGraphic(aBitmapEx);
                             xRet = aGraphic.GetXGraphic();
                         }
                     }
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 89ba081348c2..cc60076b58a6 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -4309,7 +4309,8 @@ void SbRtl_LoadPicture(StarBASIC *, SbxArray & rPar, bool)
     {
         Bitmap aBmp;
         ReadDIB(aBmp, *pStream, true);
-        Graphic aGraphic(aBmp);
+        BitmapEx aBitmapEx(aBmp);
+        Graphic aGraphic(aBitmapEx);
 
         SbxObjectRef xRef = new SbStdPicture;
         static_cast<SbStdPicture*>(xRef.get())->SetGraphic( aGraphic );
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index 535c49184dae..a903bf99aa99 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -1310,7 +1310,7 @@ namespace emfio
                                               Color(),
                                               Color(),
                                               0,
-                                              Graphic (maLatestFillStyle.aBmp) 
);
+                                              Graphic 
(BitmapEx(maLatestFillStyle.aBmp)));
 
                         SvMemoryStream  aMemStm;
 
diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index 57f034e38870..ea37cbe45b47 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -6555,7 +6555,7 @@ bool SvxMSDffManager::GetBLIPDirect( SvStream& 
rBLIPStream, Graphic& rData, tool
             Bitmap aNew;
             if( ReadDIB(aNew, *pGrStream, false) )
             {
-                rData = Graphic( aNew );
+                rData = Graphic(BitmapEx(aNew));
                 nRes = ERRCODE_NONE;
             }
         }
diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx
index f6a47e43b8ec..1880041b4ba5 100644
--- a/include/vcl/graph.hxx
+++ b/include/vcl/graph.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_GRAPH_HXX
-#define INCLUDED_VCL_GRAPH_HXX
+#pragma once
 
 #include <memory>
 #include <vcl/dllapi.h>
@@ -93,7 +92,6 @@ public:
                     Graphic( const GraphicExternalLink& rGraphicLink );
                     Graphic( const Graphic& rGraphic );
                     Graphic( Graphic&& rGraphic ) noexcept;
-                    Graphic( const Bitmap& rBmp );
                     Graphic( const Image& rImage );
                     Graphic( const BitmapEx& rBmpEx );
                     Graphic( const std::shared_ptr<VectorGraphicData>& 
rVectorGraphicDataPtr );
@@ -213,6 +211,4 @@ struct hash<Graphic>
 
 } // end namespace std
 
-#endif // INCLUDED_VCL_GRAPH_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xiescher.cxx 
b/sc/source/filter/excel/xiescher.cxx
index 70f30c693bb3..70252f6e6699 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -752,7 +752,7 @@ void XclImpDrawObjBase::ConvertFillStyle( SdrObject& 
rSdrObj, const XclObjFillDa
             aBitmap = aXOBitmap.GetBitmap().GetBitmap();
 
             rSdrObj.SetMergedItem(XFillStyleItem(drawing::FillStyle_BITMAP));
-            rSdrObj.SetMergedItem(XFillBitmapItem(EMPTY_OUSTRING, 
Graphic(aBitmap)));
+            rSdrObj.SetMergedItem(XFillBitmapItem(EMPTY_OUSTRING, 
Graphic(BitmapEx(aBitmap))));
         }
     }
 }
@@ -4137,7 +4137,7 @@ void XclImpDrawing::ReadBmp( Graphic& rGraphic, const 
XclImpRoot& rRoot, XclImpS
     aMemStrm.Seek( STREAM_SEEK_TO_BEGIN );
     Bitmap aBitmap;
     if( ReadDIB(aBitmap, aMemStrm, false) )   // read DIB without file header
-        rGraphic = aBitmap;
+        rGraphic = BitmapEx(aBitmap);
 }
 
 void XclImpDrawing::ReadDffRecord( XclImpStream& rStrm )
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index c33f9d5f3f98..7eb550dea115 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -167,7 +167,7 @@ void SdDrawDocument::CreateLayoutTemplates()
     Size    aNullSize( 32, 32 );
     Bitmap  aNullBmp( aNullSize, 8 );
     aNullBmp.Erase( COL_WHITE );
-    rISet.Put(XFillBitmapItem(Graphic(aNullBmp)));
+    rISet.Put(XFillBitmapItem(Graphic(BitmapEx(aNullBmp))));
 
                     // Shadow attributes (Drawing Engine)
     rISet.Put(makeSdrShadowItem(false));
diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx
index 843d593f5e28..dce0e837ac38 100644
--- a/sd/source/ui/dlg/vectdlg.cxx
+++ b/sd/source/ui/dlg/vectdlg.cxx
@@ -103,7 +103,7 @@ void SdVectorizeDlg::InitPreviewBmp()
 
     aPreviewBmp = aBmp;
     aPreviewBmp.Scale( aRect.GetSize() );
-    m_aBmpWin.SetGraphic( aPreviewBmp );
+    m_aBmpWin.SetGraphic(BitmapEx(aPreviewBmp));
 }
 
 Bitmap SdVectorizeDlg::GetPreparedBitmap( Bitmap const & rBmp, Fraction& 
rScale )
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index c4ae7621a60c..1ecd4aa48efe 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -194,21 +194,21 @@ bool View::InsertMetaFile( TransferableDataHelper& 
rDataHelper, const Point& rPo
                             {
                                 MetaBmpAction* pBmpAction = dynamic_cast< 
MetaBmpAction* >( pAction );
                                 if( pBmpAction )
-                                    aGraphic = Graphic( 
pBmpAction->GetBitmap() );
+                                    aGraphic = 
Graphic(BitmapEx(pBmpAction->GetBitmap()));
                             }
                             break;
                         case MetaActionType::BMPSCALE:
                             {
                                 MetaBmpScaleAction* pBmpScaleAction = 
dynamic_cast< MetaBmpScaleAction* >( pAction );
                                 if( pBmpScaleAction )
-                                    aGraphic = Graphic( 
pBmpScaleAction->GetBitmap() );
+                                    aGraphic = 
Graphic(BitmapEx(pBmpScaleAction->GetBitmap()));
                             }
                             break;
                         case MetaActionType::BMPEX:
                             {
                                 MetaBmpExAction* pBmpExAction = dynamic_cast< 
MetaBmpExAction* >( pAction );
                                 if( pBmpExAction )
-                                    aGraphic = Graphic( 
pBmpExAction->GetBitmapEx() );
+                                    aGraphic = 
Graphic(pBmpExAction->GetBitmapEx() );
                             }
                             break;
                         case MetaActionType::BMPEXSCALE:
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index 8245f6da66ec..7f760ab26e13 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -559,7 +559,7 @@ bool LinkManager::GetGraphicFromAny(const OUString& 
rMimeType,
             {
                 Bitmap aBmp;
                 ReadDIB(aBmp, aMemStm, true);
-                rGraphic = aBmp;
+                rGraphic = BitmapEx(aBmp);
                 bRet = true;
             }
             break;
diff --git a/svtools/qa/unit/GraphicObjectTest.cxx 
b/svtools/qa/unit/GraphicObjectTest.cxx
index bb09612f7d72..849dea550606 100644
--- a/svtools/qa/unit/GraphicObjectTest.cxx
+++ b/svtools/qa/unit/GraphicObjectTest.cxx
@@ -45,7 +45,7 @@ private:
 void GraphicObjectTest::testTdf88836()
 {
     // Construction with empty bitmap -> type should be GraphicType::NONE
-    Graphic aGraphic = Bitmap();
+    Graphic aGraphic = BitmapEx(Bitmap());
     CPPUNIT_ASSERT_EQUAL(int(GraphicType::NONE), int(aGraphic.GetType()));
     aGraphic = Graphic(BitmapEx());
     CPPUNIT_ASSERT_EQUAL(int(GraphicType::NONE), int(aGraphic.GetType()));
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index 52cd4f2ae79b..ca3b0d21ef6c 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -811,7 +811,7 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile& rMtf )
                 case MetaActionType::BMP:
                 {
                     MetaBmpAction*  pAct = 
static_cast<MetaBmpAction*>(pAction);
-                    const Bitmap    aBmp( Mask( pAct->GetBitmap() 
).GetBitmapEx().GetBitmap() );
+                    const Bitmap    aBmp( 
Mask(BitmapEx(pAct->GetBitmap())).GetBitmapEx().GetBitmap() );
 
                     pAct = new MetaBmpAction( pAct->GetPoint(), aBmp );
                     aMtf.AddAction( pAct );
@@ -821,7 +821,7 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile& rMtf )
                 case MetaActionType::BMPSCALE:
                 {
                     MetaBmpScaleAction* pAct = 
static_cast<MetaBmpScaleAction*>(pAction);
-                    const Bitmap        aBmp( Mask( pAct->GetBitmap() 
).GetBitmapEx().GetBitmap() );
+                    const Bitmap        aBmp( 
Mask(BitmapEx(pAct->GetBitmap())).GetBitmapEx().GetBitmap() );
 
                     pAct = new MetaBmpScaleAction( pAct->GetPoint(), 
pAct->GetSize(), aBmp );
                     aMtf.AddAction( pAct );
@@ -831,7 +831,7 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile& rMtf )
                 case MetaActionType::BMPSCALEPART:
                 {
                     MetaBmpScalePartAction* pAct = 
static_cast<MetaBmpScalePartAction*>(pAction);
-                    const Bitmap            aBmp( Mask( pAct->GetBitmap() 
).GetBitmapEx().GetBitmap() );
+                    const Bitmap            aBmp( 
Mask(BitmapEx(pAct->GetBitmap())).GetBitmapEx().GetBitmap() );
 
                     pAct = new MetaBmpScalePartAction( pAct->GetDestPoint(), 
pAct->GetDestSize(),
                                                        pAct->GetSrcPoint(), 
pAct->GetSrcSize(), aBmp );
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 1f62442af896..1555951984c1 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -1092,7 +1092,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaBmpAction 
const & rAct)
     aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
     SdrGrafObj* pGraf = new SdrGrafObj(
         *mpModel,
-        Graphic(rAct.GetBitmap()),
+        Graphic(BitmapEx(rAct.GetBitmap())),
         aRect);
 
     // This action is not creating line and fill, set directly, do not use 
SetAttributes(..)
@@ -1107,7 +1107,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaBmpScaleAction 
const & rAct)
     aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
     SdrGrafObj* pGraf = new SdrGrafObj(
         *mpModel,
-        Graphic(rAct.GetBitmap()),
+        Graphic(BitmapEx(rAct.GetBitmap())),
         aRect);
 
     // This action is not creating line and fill, set directly, do not use 
SetAttributes(..)
@@ -1319,14 +1319,14 @@ void 
ImpSdrGDIMetaFileImport::DoAction(MetaTextRectAction const & rAct)
 void ImpSdrGDIMetaFileImport::DoAction(MetaBmpScalePartAction const & rAct)
 {
     tools::Rectangle aRect(rAct.GetDestPoint(), rAct.GetDestSize());
-    Bitmap aBitmap(rAct.GetBitmap());
+    BitmapEx aBitmapEx(rAct.GetBitmap());
 
     aRect.AdjustRight( 1 );
     aRect.AdjustBottom( 1 );
-    aBitmap.Crop(tools::Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
+    aBitmapEx.Crop(tools::Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
     SdrGrafObj* pGraf = new SdrGrafObj(
         *mpModel,
-        aBitmap,
+        aBitmapEx,
         aRect);
 
     // This action is not creating line and fill, set directly, do not use 
SetAttributes(..)
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index 15123e853484..8680b6fe8189 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -284,7 +284,7 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, 
OUString& rFileName,
                         if( pVDev->SetOutputSizePixel( aSize ) )
                         {
                             rGraphic.Draw( pVDev.get(), Point(), aSize );
-                            aGraphic = pVDev->GetBitmap( Point(), aSize );
+                            aGraphic = BitmapEx(pVDev->GetBitmap(Point(), 
aSize));
                         }
                         else
                             aGraphic = rGraphic.GetBitmapEx();
diff --git a/vcl/inc/graphic/Manager.hxx b/vcl/inc/graphic/Manager.hxx
index 8b21f1c46105..73a6676e4d7b 100644
--- a/vcl/inc/graphic/Manager.hxx
+++ b/vcl/inc/graphic/Manager.hxx
@@ -58,7 +58,6 @@ public:
 
     std::shared_ptr<ImpGraphic> copy(std::shared_ptr<ImpGraphic> const& 
pImpGraphic);
     std::shared_ptr<ImpGraphic> newInstance();
-    std::shared_ptr<ImpGraphic> newInstance(const Bitmap& rBitmap);
     std::shared_ptr<ImpGraphic> newInstance(const BitmapEx& rBitmapEx);
     std::shared_ptr<ImpGraphic>
     newInstance(const std::shared_ptr<VectorGraphicData>& 
rVectorGraphicDataPtr);
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index 749a5b82a12e..8b3cc14b7f2d 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_INC_IMPGRAPH_HXX
-#define INCLUDED_VCL_INC_IMPGRAPH_HXX
+#pragma once
 
 #include <vcl/dllapi.h>
 #include <vcl/GraphicExternalLink.hxx>
@@ -83,7 +82,6 @@ public:
     ImpGraphic( const ImpGraphic& rImpGraphic );
     ImpGraphic( ImpGraphic&& rImpGraphic ) noexcept;
     ImpGraphic( const GraphicExternalLink& rExternalLink);
-    ImpGraphic( const Bitmap& rBmp );
     ImpGraphic( const BitmapEx& rBmpEx );
     ImpGraphic(const std::shared_ptr<VectorGraphicData>& 
rVectorGraphicDataPtr);
     ImpGraphic( const Animation& rAnimation );
@@ -209,6 +207,4 @@ public:
     OUString getSwapFileURL();
 };
 
-#endif // INCLUDED_VCL_INC_IMPGRAPH_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx
index 68ddebb4380b..7a9cf89fceaf 100644
--- a/vcl/qa/cppunit/BackendTest.cxx
+++ b/vcl/qa/cppunit/BackendTest.cxx
@@ -41,7 +41,7 @@ class BackendTest : public test::BootstrapFixture
             Bitmap aBitmap(rBitmap);
             aBitmap.Scale(Size(128, 128), BmpScaleFlag::Fast);
             SvFileStream aStream(rsFilename, StreamMode::WRITE | 
StreamMode::TRUNC);
-            GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmap, aStream);
+            GraphicFilter::GetGraphicFilter().compressAsPNG(BitmapEx(aBitmap), 
aStream);
         }
     }
 
diff --git a/vcl/qa/cppunit/BitmapFilterTest.cxx 
b/vcl/qa/cppunit/BitmapFilterTest.cxx
index a519da24ed9b..12b32bc316f7 100644
--- a/vcl/qa/cppunit/BitmapFilterTest.cxx
+++ b/vcl/qa/cppunit/BitmapFilterTest.cxx
@@ -69,7 +69,7 @@ private:
     {
         SvFileStream aStream(sWhere, StreamMode::WRITE | StreamMode::TRUNC);
         GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-        rFilter.compressAsPNG(rBmp, aStream);
+        rFilter.compressAsPNG(BitmapEx(rBmp), aStream);
     }
 };
 
@@ -201,7 +201,7 @@ void BitmapFilterTest::testPerformance()
         std::unique_ptr<SvFileStream> pStream(
             new SvFileStream("~/BlurBigPerformance.png", StreamMode::WRITE | 
StreamMode::TRUNC));
         GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-        rFilter.compressAsPNG(aResult, *pStream);
+        rFilter.compressAsPNG(BitmapEx(aResult), *pStream);
 
         pStream.reset(new SvFileStream("~/BlurBigPerformance.txt", 
StreamMode::WRITE));
         pStream->WriteOString("Blur average time: ");
diff --git a/vcl/qa/cppunit/BitmapScaleTest.cxx 
b/vcl/qa/cppunit/BitmapScaleTest.cxx
index f73d54f6174d..277e42adbe1b 100644
--- a/vcl/qa/cppunit/BitmapScaleTest.cxx
+++ b/vcl/qa/cppunit/BitmapScaleTest.cxx
@@ -146,14 +146,14 @@ void BitmapScaleTest::testScale()
             {
                 SvFileStream aStream("~/scale_before.png", StreamMode::WRITE | 
StreamMode::TRUNC);
                 GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-                rFilter.compressAsPNG(bitmap, aStream);
+                rFilter.compressAsPNG(BitmapEx(bitmap), aStream);
             }
             CPPUNIT_ASSERT(bitmap.Scale(scaleSize.destSize, scaleMethod));
             if (bExportBitmap)
             {
                 SvFileStream aStream("~/scale_after.png", StreamMode::WRITE | 
StreamMode::TRUNC);
                 GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-                rFilter.compressAsPNG(bitmap, aStream);
+                rFilter.compressAsPNG(BitmapEx(bitmap), aStream);
             }
             CPPUNIT_ASSERT_EQUAL(scaleSize.destSize, bitmap.GetSizePixel());
             const int lastW = scaleSize.destSize.getWidth() - 1;
@@ -215,7 +215,7 @@ void BitmapScaleTest::testScale2()
     {
         SvFileStream aStream("scale_before.png", StreamMode::WRITE | 
StreamMode::TRUNC);
         GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-        rFilter.compressAsPNG(aBitmap24Bit, aStream);
+        rFilter.compressAsPNG(BitmapEx(aBitmap24Bit), aStream);
     }
 
     // Scale - 65x65
@@ -228,7 +228,7 @@ void BitmapScaleTest::testScale2()
     {
         SvFileStream aStream("scale_after_65x65.png", StreamMode::WRITE | 
StreamMode::TRUNC);
         GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-        rFilter.compressAsPNG(aScaledBitmap, aStream);
+        rFilter.compressAsPNG(BitmapEx(aScaledBitmap), aStream);
     }
 
     CPPUNIT_ASSERT_EQUAL(static_cast<long>(65), 
aScaledBitmap.GetSizePixel().Width());
@@ -245,7 +245,7 @@ void BitmapScaleTest::testScale2()
     {
         SvFileStream aStream("scale_after_64x64.png", StreamMode::WRITE | 
StreamMode::TRUNC);
         GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-        rFilter.compressAsPNG(aScaledBitmap, aStream);
+        rFilter.compressAsPNG(BitmapEx(aScaledBitmap), aStream);
     }
 
     CPPUNIT_ASSERT_EQUAL(static_cast<long>(64), 
aScaledBitmap.GetSizePixel().Width());
@@ -262,7 +262,7 @@ void BitmapScaleTest::testScale2()
     {
         SvFileStream aStream("scale_after_63x63.png", StreamMode::WRITE | 
StreamMode::TRUNC);
         GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-        rFilter.compressAsPNG(aScaledBitmap, aStream);
+        rFilter.compressAsPNG(BitmapEx(aScaledBitmap), aStream);
     }
 
     CPPUNIT_ASSERT_EQUAL(static_cast<long>(63), 
aScaledBitmap.GetSizePixel().Width());
@@ -297,7 +297,7 @@ void BitmapScaleTest::testScaleSymmetry()
     {
         SvFileStream aStream("~/scale_before.png", StreamMode::WRITE | 
StreamMode::TRUNC);
         GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-        rFilter.compressAsPNG(aBitmap24Bit, aStream);
+        rFilter.compressAsPNG(BitmapEx(aBitmap24Bit), aStream);
     }
 
     aBitmap24Bit.Scale(2, 2, BmpScaleFlag::Fast);
@@ -313,7 +313,7 @@ void BitmapScaleTest::testScaleSymmetry()
     {
         SvFileStream aStream("~/scale_after.png", StreamMode::WRITE | 
StreamMode::TRUNC);
         GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-        rFilter.compressAsPNG(aBitmap24Bit, aStream);
+        rFilter.compressAsPNG(BitmapEx(aBitmap24Bit), aStream);
     }
 }
 
diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx 
b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
index 26f743cfa311..bc745fc530f8 100644
--- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx
+++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
@@ -116,7 +116,7 @@ void VclFiltersTest::checkExportImport(const OUString& 
aFilterShortName)
     aFilterData[ 2 ].Value <<= sal_Int32(90);
 
     sal_uInt16 aFilterType = 
mpGraphicFilter->GetExportFormatNumberForShortName(aFilterShortName);
-    mpGraphicFilter->ExportGraphic( aBitmap, OUString(), aStream, aFilterType, 
&aFilterData );
+    mpGraphicFilter->ExportGraphic(BitmapEx(aBitmap), OUString(), aStream, 
aFilterType, &aFilterData );
 
     CPPUNIT_ASSERT(aStream.Tell() > 0);
 
diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx
index 242f4a3a958c..dfa50e29e592 100644
--- a/vcl/source/bitmap/bitmap.cxx
+++ b/vcl/source/bitmap/bitmap.cxx
@@ -124,7 +124,7 @@ void savePNG(const OUString& sWhere, const Bitmap& rBmp)
 {
     SvFileStream aStream(sWhere, StreamMode::WRITE | StreamMode::TRUNC);
     GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-    rFilter.compressAsPNG(rBmp, aStream);
+    rFilter.compressAsPNG(BitmapEx(rBmp), aStream);
 }
 }
 
diff --git a/vcl/source/filter/igif/gifread.cxx 
b/vcl/source/filter/igif/gifread.cxx
index 045a6de0571e..f2ad9bd1132c 100644
--- a/vcl/source/filter/igif/gifread.cxx
+++ b/vcl/source/filter/igif/gifread.cxx
@@ -712,7 +712,7 @@ Graphic GIFReader::GetIntermediateGraphic()
             bStatus = bStatus && pAcc1;
         }
         else
-            aImGraphic = aBmp8;
+            aImGraphic = BitmapEx(aBmp8);
 
         pAcc8 = BitmapScopedWriteAccess(aBmp8);
         bStatus = bStatus && pAcc8;
diff --git a/vcl/source/filter/ixpm/xpmread.cxx 
b/vcl/source/filter/ixpm/xpmread.cxx
index fa71bfa3cb75..1e47bfe9d765 100644
--- a/vcl/source/filter/ixpm/xpmread.cxx
+++ b/vcl/source/filter/ixpm/xpmread.cxx
@@ -254,7 +254,7 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic )
             }
             else
             {
-                rGraphic = maBmp;
+                rGraphic = BitmapEx(maBmp);
             }
             eReadState = XPMREAD_OK;
         }
diff --git a/vcl/source/filter/jpeg/JpegReader.cxx 
b/vcl/source/filter/jpeg/JpegReader.cxx
index cd378f4a855f..0ea4ef493886 100644
--- a/vcl/source/filter/jpeg/JpegReader.cxx
+++ b/vcl/source/filter/jpeg/JpegReader.cxx
@@ -269,12 +269,12 @@ Graphic JPEGReader::CreateIntermediateGraphic(long nLines)
         }
         else
         {
-            aGraphic = *mpBitmap;
+            aGraphic = BitmapEx(*mpBitmap);
         }
     }
     else
     {
-        aGraphic = *mpBitmap;
+        aGraphic = BitmapEx(*mpBitmap);
     }
 
     mnLastLines = nLines;
@@ -304,7 +304,7 @@ ReadState JPEGReader::Read( Graphic& rGraphic, 
GraphicFilterImportFlags nImportF
         else
         {
             if (!bUseExistingBitmap)
-                rGraphic = *mpBitmap;
+                rGraphic = BitmapEx(*mpBitmap);
         }
 
         bRet = true;
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 05ad9657d8d9..b88aaf0e9f3f 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -182,11 +182,6 @@ Graphic::Graphic(GraphicExternalLink const & 
rGraphicExternalLink)
 {
 }
 
-Graphic::Graphic(const Bitmap& rBmp)
-    : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rBmp))
-{
-}
-
 Graphic::Graphic(const BitmapEx& rBmpEx)
     : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rBmpEx))
 {
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 925ec4a34952..c40a344ba1da 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -186,17 +186,6 @@ ImpGraphic::ImpGraphic(GraphicExternalLink const & 
rGraphicExternalLink) :
 {
 }
 
-ImpGraphic::ImpGraphic( const Bitmap& rBitmap ) :
-        maBitmapEx            ( rBitmap ),
-        meType          ( !rBitmap.IsEmpty() ? GraphicType::Bitmap : 
GraphicType::NONE ),
-        mnSizeBytes     ( 0 ),
-        mbSwapOut       ( false ),
-        mbDummyContext  ( false ),
-        maLastUsed (std::chrono::high_resolution_clock::now()),
-        mbPrepared (false)
-{
-}
-
 ImpGraphic::ImpGraphic( const BitmapEx& rBitmapEx ) :
         maBitmapEx            ( rBitmapEx ),
         meType          ( !rBitmapEx.IsEmpty() ? GraphicType::Bitmap : 
GraphicType::NONE ),
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx 
b/vcl/source/gdi/pdfwriter_impl2.cxx
index c8e5847aaa4d..177a8772c304 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -204,7 +204,7 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& 
i_rPoint, const Size& i_rSiz
             else
                 aMask = aBitmapEx.GetMask();
         }
-        Graphic         aGraphic( aBitmapEx.GetBitmap() );
+        Graphic aGraphic(BitmapEx(aBitmapEx.GetBitmap()));
 
         Sequence< PropertyValue > aFilterData( 2 );
         aFilterData[ 0 ].Name = "Quality";
diff --git a/vcl/source/graphic/GraphicObject2.cxx 
b/vcl/source/graphic/GraphicObject2.cxx
index dc60db55dd3f..d858b47b8f34 100644
--- a/vcl/source/graphic/GraphicObject2.cxx
+++ b/vcl/source/graphic/GraphicObject2.cxx
@@ -308,9 +308,9 @@ bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, 
const tools::Rectangle& r
                 GraphicObject aAlphaGraphic;
 
                 if( GetGraphic().IsAlpha() )
-                    aAlphaGraphic.SetGraphic( 
GetGraphic().GetBitmapEx().GetAlpha().GetBitmap() );
+                    
aAlphaGraphic.SetGraphic(BitmapEx(GetGraphic().GetBitmapEx().GetAlpha().GetBitmap()));
                 else
-                    aAlphaGraphic.SetGraphic( 
GetGraphic().GetBitmapEx().GetMask() );
+                    
aAlphaGraphic.SetGraphic(BitmapEx(GetGraphic().GetBitmapEx().GetMask()));
 
                 if( aAlphaGraphic.ImplRenderTempTile( *aVDev, 
nNumTilesInCacheX,
                                                       nNumTilesInCacheY, 
rSizePixel, pAttr ) )
diff --git a/vcl/source/graphic/Manager.cxx b/vcl/source/graphic/Manager.cxx
index 65e81fc1e605..7a25f8e41b04 100644
--- a/vcl/source/graphic/Manager.cxx
+++ b/vcl/source/graphic/Manager.cxx
@@ -178,13 +178,6 @@ std::shared_ptr<ImpGraphic> Manager::newInstance()
     return pReturn;
 }
 
-std::shared_ptr<ImpGraphic> Manager::newInstance(const Bitmap& rBitmap)
-{
-    auto pReturn = std::make_shared<ImpGraphic>(rBitmap);
-    registerGraphic(pReturn, "Bitmap");
-    return pReturn;
-}
-
 std::shared_ptr<ImpGraphic> Manager::newInstance(const BitmapEx& rBitmapEx)
 {
     auto pReturn = std::make_shared<ImpGraphic>(rBitmapEx);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to