drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx | 14 - drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx | 84 +++++----- drawinglayer/source/tools/wmfemfhelper.cxx | 28 +-- include/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx | 8 include/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx | 44 ++--- sfx2/source/control/recentdocsviewitem.cxx | 6 sfx2/source/control/templateviewitem.cxx | 2 svx/source/sdr/contact/viewcontactofsdrpage.cxx | 2 sw/source/core/layout/paintfrm.cxx | 20 +- sw/source/uibase/docvw/PageBreakWin.cxx | 2 10 files changed, 105 insertions(+), 105 deletions(-)
New commits: commit 0e45308b444e4fa35db8d0cbdfabe1b99af87320 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Aug 7 12:49:02 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Aug 8 09:02:21 2025 +0200 BitmapEx->Bitmap in DiscreteShadow now that Bitmap supports transparency Change-Id: Ic8ea9d519378b73e7b97c2fbca3f50c53be29a70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189071 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx b/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx index 1ff96ce60886..251aa99c500e 100644 --- a/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx @@ -29,25 +29,25 @@ namespace drawinglayer::primitive2d { - DiscreteShadow::DiscreteShadow(const BitmapEx& rBitmapEx) - : maBitmapEx(rBitmapEx) + DiscreteShadow::DiscreteShadow(const Bitmap& rBitmap) + : maBitmap(rBitmap) { - maBitmapEx.Invert(); // convert transparency to alpha - const Size& rBitmapSize = getBitmapEx().GetSizePixel(); + maBitmap.Invert(); // convert transparency to alpha + const Size aBitmapSize = getBitmap().GetSizePixel(); - if(rBitmapSize.Width() != rBitmapSize.Height() || rBitmapSize.Width() < 7) + if(aBitmapSize.Width() != aBitmapSize.Height() || aBitmapSize.Width() < 7) { OSL_ENSURE(false, "DiscreteShadowPrimitive2D: wrong bitmap format (!)"); - maBitmapEx = BitmapEx(); + maBitmap = Bitmap(); } } - const BitmapEx& DiscreteShadow::getTopLeft() const + const Bitmap& DiscreteShadow::getTopLeft() const { if(maTopLeft.IsEmpty()) { - const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); - const_cast< DiscreteShadow* >(this)->maTopLeft = getBitmapEx(); + const sal_Int32 nQuarter((getBitmap().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maTopLeft = getBitmap(); const_cast< DiscreteShadow* >(this)->maTopLeft.Crop( ::tools::Rectangle(Point(0, 0), Size((nQuarter * 2) + 1, (nQuarter * 2) + 1))); } @@ -55,12 +55,12 @@ namespace drawinglayer::primitive2d return maTopLeft; } - const BitmapEx& DiscreteShadow::getTop() const + const Bitmap& DiscreteShadow::getTop() const { if(maTop.IsEmpty()) { - const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); - const_cast< DiscreteShadow* >(this)->maTop = getBitmapEx(); + const sal_Int32 nQuarter((getBitmap().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maTop = getBitmap(); const_cast< DiscreteShadow* >(this)->maTop.Crop( ::tools::Rectangle(Point((nQuarter * 2) + 1, 0), Size(1, nQuarter))); } @@ -68,12 +68,12 @@ namespace drawinglayer::primitive2d return maTop; } - const BitmapEx& DiscreteShadow::getTopRight() const + const Bitmap& DiscreteShadow::getTopRight() const { if(maTopRight.IsEmpty()) { - const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); - const_cast< DiscreteShadow* >(this)->maTopRight = getBitmapEx(); + const sal_Int32 nQuarter((getBitmap().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maTopRight = getBitmap(); const_cast< DiscreteShadow* >(this)->maTopRight.Crop( ::tools::Rectangle(Point((nQuarter * 2) + 2, 0), Size((nQuarter * 2) + 1, (nQuarter * 2) + 1))); } @@ -81,12 +81,12 @@ namespace drawinglayer::primitive2d return maTopRight; } - const BitmapEx& DiscreteShadow::getRight() const + const Bitmap& DiscreteShadow::getRight() const { if(maRight.IsEmpty()) { - const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); - const_cast< DiscreteShadow* >(this)->maRight = getBitmapEx(); + const sal_Int32 nQuarter((getBitmap().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maRight = getBitmap(); const_cast< DiscreteShadow* >(this)->maRight.Crop( ::tools::Rectangle(Point((nQuarter * 3) + 3, (nQuarter * 2) + 1), Size(nQuarter, 1))); } @@ -94,12 +94,12 @@ namespace drawinglayer::primitive2d return maRight; } - const BitmapEx& DiscreteShadow::getBottomRight() const + const Bitmap& DiscreteShadow::getBottomRight() const { if(maBottomRight.IsEmpty()) { - const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); - const_cast< DiscreteShadow* >(this)->maBottomRight = getBitmapEx(); + const sal_Int32 nQuarter((getBitmap().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maBottomRight = getBitmap(); const_cast< DiscreteShadow* >(this)->maBottomRight.Crop( ::tools::Rectangle(Point((nQuarter * 2) + 2, (nQuarter * 2) + 2), Size((nQuarter * 2) + 1, (nQuarter * 2) + 1))); } @@ -107,12 +107,12 @@ namespace drawinglayer::primitive2d return maBottomRight; } - const BitmapEx& DiscreteShadow::getBottom() const + const Bitmap& DiscreteShadow::getBottom() const { if(maBottom.IsEmpty()) { - const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); - const_cast< DiscreteShadow* >(this)->maBottom = getBitmapEx(); + const sal_Int32 nQuarter((getBitmap().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maBottom = getBitmap(); const_cast< DiscreteShadow* >(this)->maBottom.Crop( ::tools::Rectangle(Point((nQuarter * 2) + 1, (nQuarter * 3) + 3), Size(1, nQuarter))); } @@ -120,12 +120,12 @@ namespace drawinglayer::primitive2d return maBottom; } - const BitmapEx& DiscreteShadow::getBottomLeft() const + const Bitmap& DiscreteShadow::getBottomLeft() const { if(maBottomLeft.IsEmpty()) { - const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); - const_cast< DiscreteShadow* >(this)->maBottomLeft = getBitmapEx(); + const sal_Int32 nQuarter((getBitmap().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maBottomLeft = getBitmap(); const_cast< DiscreteShadow* >(this)->maBottomLeft.Crop( ::tools::Rectangle(Point(0, (nQuarter * 2) + 2), Size((nQuarter * 2) + 1, (nQuarter * 2) + 1))); } @@ -133,12 +133,12 @@ namespace drawinglayer::primitive2d return maBottomLeft; } - const BitmapEx& DiscreteShadow::getLeft() const + const Bitmap& DiscreteShadow::getLeft() const { if(maLeft.IsEmpty()) { - const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); - const_cast< DiscreteShadow* >(this)->maLeft = getBitmapEx(); + const sal_Int32 nQuarter((getBitmap().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maLeft = getBitmap(); const_cast< DiscreteShadow* >(this)->maLeft.Crop( ::tools::Rectangle(Point(0, (nQuarter * 2) + 1), Size(nQuarter, 1))); } @@ -155,10 +155,10 @@ namespace drawinglayer::primitive2d { Primitive2DContainer xRetval; - if(getDiscreteShadow().getBitmapEx().IsEmpty()) + if(getDiscreteShadow().getBitmap().IsEmpty()) return nullptr; - const sal_Int32 nQuarter((getDiscreteShadow().getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const sal_Int32 nQuarter((getDiscreteShadow().getBitmap().GetSizePixel().Width() - 3) >> 2); const basegfx::B2DVector aScale(getTransform() * basegfx::B2DVector(1.0, 1.0)); const double fSingleX(getDiscreteUnit() / aScale.getX()); const double fSingleY(getDiscreteUnit() / aScale.getY()); @@ -172,7 +172,7 @@ namespace drawinglayer::primitive2d // TopLeft xRetval[0] = new BitmapPrimitive2D( - getDiscreteShadow().getTopLeft(), + BitmapEx(getDiscreteShadow().getTopLeft()), basegfx::utils::createScaleTranslateB2DHomMatrix( fBigLenX, fBigLenY, @@ -182,7 +182,7 @@ namespace drawinglayer::primitive2d // Top xRetval[1] = new BitmapPrimitive2D( - getDiscreteShadow().getTop(), + BitmapEx(getDiscreteShadow().getTop()), basegfx::utils::createScaleTranslateB2DHomMatrix( 1.0 - (2.0 * (fBorderX + fSingleX)) + fSingleX, fBorderY, @@ -192,7 +192,7 @@ namespace drawinglayer::primitive2d // TopRight xRetval[2] = new BitmapPrimitive2D( - getDiscreteShadow().getTopRight(), + BitmapEx(getDiscreteShadow().getTopRight()), basegfx::utils::createScaleTranslateB2DHomMatrix( fBigLenX, fBigLenY, @@ -202,7 +202,7 @@ namespace drawinglayer::primitive2d // Right xRetval[3] = new BitmapPrimitive2D( - getDiscreteShadow().getRight(), + BitmapEx(getDiscreteShadow().getRight()), basegfx::utils::createScaleTranslateB2DHomMatrix( fBorderX, 1.0 - (2.0 * (fBorderY + fSingleY)) + fSingleY, @@ -212,7 +212,7 @@ namespace drawinglayer::primitive2d // BottomRight xRetval[4] = new BitmapPrimitive2D( - getDiscreteShadow().getBottomRight(), + BitmapEx(getDiscreteShadow().getBottomRight()), basegfx::utils::createScaleTranslateB2DHomMatrix( fBigLenX, fBigLenY, @@ -222,7 +222,7 @@ namespace drawinglayer::primitive2d // Bottom xRetval[5] = new BitmapPrimitive2D( - getDiscreteShadow().getBottom(), + BitmapEx(getDiscreteShadow().getBottom()), basegfx::utils::createScaleTranslateB2DHomMatrix( 1.0 - (2.0 * (fBorderX + fSingleX)) + fSingleX, fBorderY, @@ -232,7 +232,7 @@ namespace drawinglayer::primitive2d // BottomLeft xRetval[6] = new BitmapPrimitive2D( - getDiscreteShadow().getBottomLeft(), + BitmapEx(getDiscreteShadow().getBottomLeft()), basegfx::utils::createScaleTranslateB2DHomMatrix( fBigLenX, fBigLenY, @@ -242,7 +242,7 @@ namespace drawinglayer::primitive2d // Left xRetval[7] = new BitmapPrimitive2D( - getDiscreteShadow().getLeft(), + BitmapEx(getDiscreteShadow().getLeft()), basegfx::utils::createScaleTranslateB2DHomMatrix( fBorderX, 1.0 - (2.0 * (fBorderY + fSingleY)) + fSingleY, @@ -279,7 +279,7 @@ namespace drawinglayer::primitive2d basegfx::B2DRange DiscreteShadowPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const { - if(getDiscreteShadow().getBitmapEx().IsEmpty()) + if(getDiscreteShadow().getBitmap().IsEmpty()) { // no graphics without valid bitmap definition return basegfx::B2DRange(); @@ -292,7 +292,7 @@ namespace drawinglayer::primitive2d // extract discrete shadow size and grow const basegfx::B2DVector aScale(rViewInformation.getViewTransformation() * basegfx::B2DVector(1.0, 1.0)); - const sal_Int32 nQuarter((getDiscreteShadow().getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const sal_Int32 nQuarter((getDiscreteShadow().getBitmap().GetSizePixel().Width() - 3) >> 2); const double fGrowX((1.0 / aScale.getX()) * nQuarter); const double fGrowY((1.0 / aScale.getY()) * nQuarter); aRetval.grow(std::max(fGrowX, fGrowY)); diff --git a/include/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx b/include/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx index 10840b3ee210..06a01ad7f81d 100644 --- a/include/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx @@ -22,7 +22,7 @@ #include <drawinglayer/drawinglayerdllapi.h> #include <drawinglayer/primitive2d/primitivetools2d.hxx> -#include <vcl/bitmapex.hxx> +#include <vcl/bitmap.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> @@ -36,41 +36,41 @@ namespace drawinglayer::primitive2d class DRAWINGLAYER_DLLPUBLIC DiscreteShadow { private: - /// the original shadow BitmapEx in a special form - BitmapEx maBitmapEx; + /// the original shadow Bitmap in a special form + Bitmap maBitmap; /// buffered extracted parts of CombinedShadow for easier usage - BitmapEx maTopLeft; - BitmapEx maTop; - BitmapEx maTopRight; - BitmapEx maRight; - BitmapEx maBottomRight; - BitmapEx maBottom; - BitmapEx maBottomLeft; - BitmapEx maLeft; + Bitmap maTopLeft; + Bitmap maTop; + Bitmap maTopRight; + Bitmap maRight; + Bitmap maBottomRight; + Bitmap maBottom; + Bitmap maBottomLeft; + Bitmap maLeft; public: /// constructor - explicit DiscreteShadow(const BitmapEx& rBitmapEx); + explicit DiscreteShadow(const Bitmap& rBitmap); /// data read access - const BitmapEx& getBitmapEx() const { return maBitmapEx; } + const Bitmap& getBitmap() const { return maBitmap; } /// compare operator bool operator==(const DiscreteShadow& rCompare) const { - return getBitmapEx() == rCompare.getBitmapEx(); + return getBitmap() == rCompare.getBitmap(); } /// helper accesses which create on-demand needed segments - const BitmapEx& getTopLeft() const; - const BitmapEx& getTop() const; - const BitmapEx& getTopRight() const; - const BitmapEx& getRight() const; - const BitmapEx& getBottomRight() const; - const BitmapEx& getBottom() const; - const BitmapEx& getBottomLeft() const; - const BitmapEx& getLeft() const; + const Bitmap& getTopLeft() const; + const Bitmap& getTop() const; + const Bitmap& getTopRight() const; + const Bitmap& getRight() const; + const Bitmap& getBottomRight() const; + const Bitmap& getBottom() const; + const Bitmap& getBottomLeft() const; + const Bitmap& getLeft() const; }; /** DiscreteShadowPrimitive2D class diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx index a2e970e4352d..8273ad830d70 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx @@ -137,7 +137,7 @@ void ViewContactOfPageShadow::createViewIndependentPrimitive2DSequence(drawingla else { static tools::DeleteOnDeinit< drawinglayer::primitive2d::DiscreteShadow > aDiscreteShadow(( - BitmapEx(SIP_SA_PAGESHADOW35X35))); + Bitmap(BitmapEx(SIP_SA_PAGESHADOW35X35)))); if(aDiscreteShadow.get()) { diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index a4a12a35878a..4a13ac8ac692 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -6371,8 +6371,8 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin SwTaggedPDFHelper aTaggedPDFHelper( nullptr, nullptr, nullptr, *_pViewShell->GetOut() ); static tools::DeleteOnDeinit<drawinglayer::primitive2d::DiscreteShadow> shadowMaskObj( - BitmapEx(vcl::bitmap::loadFromName(BMP_PAGE_SHADOW_MASK, - ImageLoadFlags::IgnoreDarkTheme | ImageLoadFlags::IgnoreScalingFactor))); + vcl::bitmap::loadFromName(BMP_PAGE_SHADOW_MASK, + ImageLoadFlags::IgnoreDarkTheme | ImageLoadFlags::IgnoreScalingFactor)); drawinglayer::primitive2d::DiscreteShadow& shadowMask = *shadowMaskObj.get(); static tools::DeleteOnDeinit< BitmapEx > aPageTopRightShadowObj {}; @@ -6401,42 +6401,42 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin { aShadowColor = _pViewShell->GetViewOptions()->GetShadowColor(); - AlphaMask aMask( shadowMask.getBottomRight().GetBitmap() ); + AlphaMask aMask( BitmapEx(shadowMask.getBottomRight()).GetBitmap() ); Bitmap aFilledSquare(aMask.GetSizePixel(), vcl::PixelFormat::N24_BPP); aFilledSquare.Erase( aShadowColor ); aPageBottomRightShadow = BitmapEx( aFilledSquare, aMask ); - aMask = AlphaMask( shadowMask.getBottomLeft().GetBitmap() ); + aMask = AlphaMask( BitmapEx(shadowMask.getBottomLeft()).GetBitmap() ); aFilledSquare = Bitmap(aMask.GetSizePixel(), vcl::PixelFormat::N24_BPP); aFilledSquare.Erase( aShadowColor ); aPageBottomLeftShadow = BitmapEx( aFilledSquare, aMask ); - aMask = AlphaMask( shadowMask.getBottom().GetBitmap() ); + aMask = AlphaMask( BitmapEx(shadowMask.getBottom()).GetBitmap() ); aFilledSquare = Bitmap(aMask.GetSizePixel(), vcl::PixelFormat::N24_BPP); aFilledSquare.Erase( aShadowColor ); aPageBottomShadow = BitmapEx( aFilledSquare, aMask ); - aMask = AlphaMask( shadowMask.getTop().GetBitmap() ); + aMask = AlphaMask( BitmapEx(shadowMask.getTop()).GetBitmap() ); aFilledSquare = Bitmap(aMask.GetSizePixel(), vcl::PixelFormat::N24_BPP); aFilledSquare.Erase( aShadowColor ); aPageTopShadow = BitmapEx( aFilledSquare, aMask ); - aMask = AlphaMask( shadowMask.getTopRight().GetBitmap() ); + aMask = AlphaMask( BitmapEx(shadowMask.getTopRight()).GetBitmap() ); aFilledSquare = Bitmap(aMask.GetSizePixel(), vcl::PixelFormat::N24_BPP); aFilledSquare.Erase( aShadowColor ); aPageTopRightShadow = BitmapEx( aFilledSquare, aMask ); - aMask = AlphaMask( shadowMask.getRight().GetBitmap() ); + aMask = AlphaMask( BitmapEx(shadowMask.getRight()).GetBitmap() ); aFilledSquare = Bitmap(aMask.GetSizePixel(), vcl::PixelFormat::N24_BPP); aFilledSquare.Erase( aShadowColor ); aPageRightShadow = BitmapEx( aFilledSquare, aMask ); - aMask = AlphaMask( shadowMask.getTopLeft().GetBitmap() ); + aMask = AlphaMask( BitmapEx(shadowMask.getTopLeft()).GetBitmap() ); aFilledSquare = Bitmap(aMask.GetSizePixel(), vcl::PixelFormat::N24_BPP); aFilledSquare.Erase( aShadowColor ); aPageTopLeftShadow = BitmapEx( aFilledSquare, aMask ); - aMask = AlphaMask( shadowMask.getLeft().GetBitmap() ); + aMask = AlphaMask( BitmapEx(shadowMask.getLeft()).GetBitmap() ); aFilledSquare = Bitmap(aMask.GetSizePixel(), vcl::PixelFormat::N24_BPP); aFilledSquare.Erase( aShadowColor ); aPageLeftShadow = BitmapEx( aFilledSquare, aMask ); commit 2cb59865f7e509c5951c2c832f8a3754016c3cb1 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Aug 7 12:37:04 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Aug 8 09:02:09 2025 +0200 BitmapEx->Bitmap in DiscreteBitmapPrimitive2D now that Bitmap supports transparency Change-Id: I2f15d5385fa01d5814bccb628d47ac6d85475538 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189070 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx index 66dcfcb403e1..5a3a6cca67ed 100644 --- a/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx @@ -31,12 +31,12 @@ namespace drawinglayer::primitive2d // ObjectAndViewTransformationDependentPrimitive2D to create a BitmapPrimitive2D // with the correct mapping - if(getBitmapEx().IsEmpty()) + if(getBitmap().IsEmpty()) return nullptr; // get discrete size - const Size& rSizePixel = getBitmapEx().GetSizePixel(); - const basegfx::B2DVector aDiscreteSize(rSizePixel.Width(), rSizePixel.Height()); + const Size aSizePixel = getBitmap().GetSizePixel(); + const basegfx::B2DVector aDiscreteSize(aSizePixel.Width(), aSizePixel.Height()); // get inverse ViewTransformation basegfx::B2DHomMatrix aInverseViewTransformation(getViewTransformation()); @@ -66,14 +66,14 @@ namespace drawinglayer::primitive2d // create BitmapPrimitive2D with now object-local coordinate data return new BitmapPrimitive2D( - getBitmapEx(), + BitmapEx(getBitmap()), aObjectTransform); } DiscreteBitmapPrimitive2D::DiscreteBitmapPrimitive2D( - const BitmapEx& rBitmapEx, + const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft) - : maBitmapEx(rBitmapEx), + : maBitmap(rBitmap), maTopLeft(rTopLeft) { } @@ -84,7 +84,7 @@ namespace drawinglayer::primitive2d { const DiscreteBitmapPrimitive2D& rCompare = static_cast<const DiscreteBitmapPrimitive2D&>(rPrimitive); - return (getBitmapEx() == rCompare.getBitmapEx() + return (getBitmap() == rCompare.getBitmap() && getTopLeft() == rCompare.getTopLeft()); } diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx index 05b0bba59c62..e7fb86ac345d 100644 --- a/drawinglayer/source/tools/wmfemfhelper.cxx +++ b/drawinglayer/source/tools/wmfemfhelper.cxx @@ -585,26 +585,26 @@ namespace wmfemfhelper position and size in pixels. At the end it will create a view-dependent transformed embedding of a BitmapPrimitive2D. */ - static void createBitmapExPrimitive( - const BitmapEx& rBitmapEx, + static void createBitmapPrimitive( + const Bitmap& rBitmap, const Point& rPoint, TargetHolder& rTarget, PropertyHolder const & rProperties) { - if(!rBitmapEx.IsEmpty()) + if(!rBitmap.IsEmpty()) { basegfx::B2DPoint aPoint(rPoint.X(), rPoint.Y()); aPoint = rProperties.getTransformation() * aPoint; rTarget.append( new drawinglayer::primitive2d::DiscreteBitmapPrimitive2D( - rBitmapEx, + rBitmap, aPoint)); } } /** helper to create BitmapPrimitive2D based on current context */ - static void createBitmapExPrimitive( + static void createBitmapPrimitive( const BitmapEx& rBitmapEx, const Point& rPoint, const Size& rSize, @@ -1912,7 +1912,7 @@ namespace wmfemfhelper const MetaBmpAction* pA = static_cast<const MetaBmpAction*>(pAction); const BitmapEx aBitmapEx(pA->GetBitmap()); - createBitmapExPrimitive(aBitmapEx, pA->GetPoint(), rTargetHolders.Current(), rPropertyHolders.Current()); + createBitmapPrimitive(Bitmap(aBitmapEx), pA->GetPoint(), rTargetHolders.Current(), rPropertyHolders.Current()); break; } @@ -1922,7 +1922,7 @@ namespace wmfemfhelper const MetaBmpScaleAction* pA = static_cast<const MetaBmpScaleAction*>(pAction); const BitmapEx aBitmapEx(pA->GetBitmap()); - createBitmapExPrimitive(aBitmapEx, pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + createBitmapPrimitive(aBitmapEx, pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current()); break; } @@ -1943,7 +1943,7 @@ namespace wmfemfhelper } const BitmapEx aCroppedBitmapEx(aCroppedBitmap); - createBitmapExPrimitive(aCroppedBitmapEx, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + createBitmapPrimitive(aCroppedBitmapEx, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current()); } break; @@ -1954,7 +1954,7 @@ namespace wmfemfhelper const MetaBmpExAction* pA = static_cast<const MetaBmpExAction*>(pAction); const BitmapEx& rBitmapEx = pA->GetBitmapEx(); - createBitmapExPrimitive(rBitmapEx, pA->GetPoint(), rTargetHolders.Current(), rPropertyHolders.Current()); + createBitmapPrimitive(Bitmap(rBitmapEx), pA->GetPoint(), rTargetHolders.Current(), rPropertyHolders.Current()); break; } @@ -1964,7 +1964,7 @@ namespace wmfemfhelper const MetaBmpExScaleAction* pA = static_cast<const MetaBmpExScaleAction*>(pAction); const BitmapEx& rBitmapEx = pA->GetBitmapEx(); - createBitmapExPrimitive(rBitmapEx, pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + createBitmapPrimitive(rBitmapEx, pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current()); break; } @@ -1984,7 +1984,7 @@ namespace wmfemfhelper aCroppedBitmapEx.Crop(aCropRectangle); } - createBitmapExPrimitive(aCroppedBitmapEx, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + createBitmapPrimitive(aCroppedBitmapEx, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current()); } break; @@ -1996,7 +1996,7 @@ namespace wmfemfhelper const MetaMaskAction* pA = static_cast<const MetaMaskAction*>(pAction); const BitmapEx aBitmapEx(createMaskBmpEx(pA->GetBitmap(), pA->GetColor())); - createBitmapExPrimitive(aBitmapEx, pA->GetPoint(), rTargetHolders.Current(), rPropertyHolders.Current()); + createBitmapPrimitive(Bitmap(aBitmapEx), pA->GetPoint(), rTargetHolders.Current(), rPropertyHolders.Current()); break; } @@ -2006,7 +2006,7 @@ namespace wmfemfhelper const MetaMaskScaleAction* pA = static_cast<const MetaMaskScaleAction*>(pAction); const BitmapEx aBitmapEx(createMaskBmpEx(pA->GetBitmap(), pA->GetColor())); - createBitmapExPrimitive(aBitmapEx, pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + createBitmapPrimitive(aBitmapEx, pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current()); break; } @@ -2027,7 +2027,7 @@ namespace wmfemfhelper } const BitmapEx aCroppedBitmapEx(createMaskBmpEx(aCroppedBitmap, pA->GetColor())); - createBitmapExPrimitive(aCroppedBitmapEx, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + createBitmapPrimitive(aCroppedBitmapEx, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current()); } break; diff --git a/include/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx b/include/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx index 915c8878372b..8127365420cc 100644 --- a/include/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx @@ -22,7 +22,7 @@ #include <drawinglayer/drawinglayerdllapi.h> #include <drawinglayer/primitive2d/primitivetools2d.hxx> -#include <vcl/bitmapex.hxx> +#include <vcl/bitmap.hxx> // DiscreteBitmapPrimitive2D class @@ -40,7 +40,7 @@ namespace drawinglayer::primitive2d { private: /// the RGBA Bitmap-data - BitmapEx maBitmapEx; + Bitmap maBitmap; /** the top-left object position */ basegfx::B2DPoint maTopLeft; @@ -51,11 +51,11 @@ namespace drawinglayer::primitive2d public: /// constructor DiscreteBitmapPrimitive2D( - const BitmapEx& rBitmapEx, + const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft); /// data read access - const BitmapEx& getBitmapEx() const { return maBitmapEx; } + const Bitmap& getBitmap() const { return maBitmap; } const basegfx::B2DPoint& getTopLeft() const { return maTopLeft; } /// compare operator diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx index 8f28696636f8..1cd72da80f9c 100644 --- a/sfx2/source/control/recentdocsviewitem.cxx +++ b/sfx2/source/control/recentdocsviewitem.cxx @@ -304,13 +304,13 @@ void RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc Point aIconPos(getRemoveIconArea().TopLeft()); aSeq.push_back(new DiscreteBitmapPrimitive2D( - m_bRemoveIconHighlighted ? m_aRemoveRecentBitmapHighlighted : m_aRemoveRecentBitmap, + Bitmap(m_bRemoveIconHighlighted ? m_aRemoveRecentBitmapHighlighted : m_aRemoveRecentBitmap), B2DPoint(aIconPos.X(), aIconPos.Y()))); // tdf#38742 - draw pinned icon const Point aPinnedIconPos(getPinnedIconArea().TopLeft()); aSeq.push_back(new DiscreteBitmapPrimitive2D( - m_bPinnedIconHighlighted ? m_aPinnedDocumentBitmapHighlighted : m_aPinnedDocumentBitmap, + Bitmap(m_bPinnedIconHighlighted ? m_aPinnedDocumentBitmapHighlighted : m_aPinnedDocumentBitmap), B2DPoint(aPinnedIconPos.X(), aPinnedIconPos.Y()))); pProcessor->process(aSeq); @@ -321,7 +321,7 @@ void RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc const Point aPinnedIconPos(getPinnedIconArea().TopLeft()); drawinglayer::primitive2d::Primitive2DContainer aSeq { new DiscreteBitmapPrimitive2D( - m_aPinnedDocumentBitmap, B2DPoint(aPinnedIconPos.X(), aPinnedIconPos.Y())) }; + Bitmap(m_aPinnedDocumentBitmap), B2DPoint(aPinnedIconPos.X(), aPinnedIconPos.Y())) }; pProcessor->process(aSeq); } diff --git a/sfx2/source/control/templateviewitem.cxx b/sfx2/source/control/templateviewitem.cxx index d0dd8533ee6d..1e1a5e8f841f 100644 --- a/sfx2/source/control/templateviewitem.cxx +++ b/sfx2/source/control/templateviewitem.cxx @@ -110,7 +110,7 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces { Point aIconPos(getDefaultIconArea().TopLeft()); - aSeq[4] = new DiscreteBitmapPrimitive2D( maDefaultBitmap, + aSeq[4] = new DiscreteBitmapPrimitive2D( Bitmap(maDefaultBitmap), B2DPoint(aIconPos.X(), aIconPos.Y())); } diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index ef41b1898ec0..553bd1c96044 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -209,7 +209,7 @@ void SwPageBreakWin::PaintButton() if (bRtl) nImgOfstX = aRect.Right() - aBmpEx.GetSizePixel().Width() - 3.0; aSeq.push_back(new drawinglayer::primitive2d::DiscreteBitmapPrimitive2D( - aBmpEx, B2DPoint(nImgOfstX, 1.0))); + Bitmap(aBmpEx), B2DPoint(nImgOfstX, 1.0))); double nTop = double(aRect.getOpenHeight()) / 2.0; double nBottom = nTop + 4.0;