basegfx/source/polygon/b2dlinegeometry.cxx | 2 basegfx/source/polygon/b2dpolygonclipper.cxx | 4 basegfx/source/polygon/b2dpolygoncutandtouch.cxx | 2 basegfx/source/polygon/b2dpolygontools.cxx | 6 - basegfx/source/polygon/b2dpolypolygoncutter.cxx | 4 basegfx/source/polygon/b2dpolypolygontools.cxx | 12 -- basegfx/source/tools/unopolypolygon.cxx | 2 canvas/source/directx/dx_spritehelper.cxx | 3 canvas/source/opengl/ogl_canvashelper.cxx | 4 canvas/source/tools/canvascustomspritehelper.cxx | 3 cppcanvas/source/mtfrenderer/implrenderer.cxx | 2 cppcanvas/source/mtfrenderer/polypolyaction.cxx | 8 - cppcanvas/source/mtfrenderer/textaction.cxx | 8 - cppcanvas/source/mtfrenderer/textlineshelper.cxx | 6 - cui/source/tabpages/tplneend.cxx | 2 drawinglayer/source/primitive2d/PolyPolygonAlphaGradientPrimitive2D.cxx | 6 - drawinglayer/source/primitive2d/PolyPolygonColorPrimitive2D.cxx | 2 drawinglayer/source/primitive2d/PolyPolygonHairlinePrimitive2D.cxx | 2 drawinglayer/source/primitive2d/PolyPolygonMarkerPrimitive2D.cxx | 2 drawinglayer/source/primitive2d/PolyPolygonRGBAPrimitive2D.cxx | 2 drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D.cxx | 2 drawinglayer/source/primitive2d/PolyPolygonStrokePrimitive2D.cxx | 2 drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx | 2 drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx | 2 drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx | 8 - drawinglayer/source/processor2d/cairopixelprocessor2d.cxx | 2 drawinglayer/source/processor2d/vclprocessor2d.cxx | 2 drawinglayer/source/tools/emfpbrush.cxx | 4 include/basegfx/polygon/b2dpolygontools.hxx | 13 -- include/basegfx/polygon/b2dpolypolygontools.hxx | 13 -- sc/source/core/data/drwlayer.cxx | 2 sd/source/ui/func/fumorph.cxx | 16 +-- sdext/source/pdfimport/tree/genericelements.cxx | 4 svx/source/customshapes/EnhancedCustomShape3d.cxx | 2 svx/source/engine3d/view3d.cxx | 2 svx/source/sdr/contact/viewcontactofe3dextrude.cxx | 2 svx/source/sdr/contact/viewcontactofe3dlathe.cxx | 2 svx/source/sdr/contact/viewcontactofsdrpathobj.cxx | 2 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx | 8 - svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx | 4 svx/source/svdraw/svdopath.cxx | 10 - svx/source/xoutdev/_xpoly.cxx | 2 vcl/headless/CairoCommon.cxx | 11 +- vcl/qa/cppunit/outdev.cxx | 52 ++++++++++ vcl/source/gdi/region.cxx | 2 vcl/source/outdev/line.cxx | 2 vcl/source/outdev/polygon.cxx | 2 47 files changed, 133 insertions(+), 124 deletions(-)
New commits: commit 40e5bc6e68fefa8458285d1cebe0c268b163ead3 Author: Noel Grandin <[email protected]> AuthorDate: Fri Oct 17 19:44:17 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Sun Oct 19 12:13:53 2025 +0200 lets have just one getB2DRange function/method Change-Id: I5081abca177c6fb8bd21d971d93dc115d57de294 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192589 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/basegfx/source/polygon/b2dlinegeometry.cxx b/basegfx/source/polygon/b2dlinegeometry.cxx index e6189e240eb8..3489c3d5e82f 100644 --- a/basegfx/source/polygon/b2dlinegeometry.cxx +++ b/basegfx/source/polygon/b2dlinegeometry.cxx @@ -70,7 +70,7 @@ namespace basegfx::utils aRetval.append(rArrow); // get size of the arrow - const B2DRange aArrowSize(getRange(rArrow)); + const B2DRange aArrowSize(rArrow.getB2DRange()); // build ArrowTransform; center in X, align with axis in Y B2DHomMatrix aArrowTransform(basegfx::utils::createTranslateB2DHomMatrix( diff --git a/basegfx/source/polygon/b2dpolygonclipper.cxx b/basegfx/source/polygon/b2dpolygonclipper.cxx index 7453c0a823ba..0b7604d69331 100644 --- a/basegfx/source/polygon/b2dpolygonclipper.cxx +++ b/basegfx/source/polygon/b2dpolygonclipper.cxx @@ -35,7 +35,7 @@ namespace basegfx::utils if(rCandidate.count()) { - const B2DRange aCandidateRange(getRange(rCandidate)); + const B2DRange aCandidateRange(rCandidate.getB2DRange()); if(bParallelToXAxis && fTools::moreOrEqual(aCandidateRange.getMinY(), fValueOnOtherAxis)) { @@ -203,7 +203,7 @@ namespace basegfx::utils } } - const B2DRange aCandidateRange(getRange(rCandidate)); + const B2DRange aCandidateRange(rCandidate.getB2DRange()); if(rRange.isInside(aCandidateRange)) { diff --git a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx index c91f0ec48f7d..c014eb0fd6c3 100644 --- a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx +++ b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx @@ -77,7 +77,7 @@ namespace basegfx public: const B2DPolygon& getPolygon() const { return maPolygon; } - void setPolygon(const B2DPolygon& rNew) { maPolygon = rNew; maRange = utils::getRange(maPolygon); } + void setPolygon(const B2DPolygon& rNew) { maPolygon = rNew; maRange = maPolygon.getB2DRange(); } const B2DRange& getRange() const { return maRange; } temporaryPointVector& getTemporaryPointVector() { return maPoints; } }; diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx index 9051835a3708..00a5844e3394 100644 --- a/basegfx/source/polygon/b2dpolygontools.cxx +++ b/basegfx/source/polygon/b2dpolygontools.cxx @@ -389,12 +389,6 @@ namespace basegfx::utils return true; } - B2DRange getRange(const B2DPolygon& rCandidate) - { - // changed to use internally buffered version at B2DPolygon - return rCandidate.getB2DRange(); - } - double getSignedArea(const B2DPolygon& rCandidate) { const B2DPolygon aCandidate(rCandidate.areControlPointsUsed() ? rCandidate.getDefaultAdaptiveSubdivision() : rCandidate); diff --git a/basegfx/source/polygon/b2dpolypolygoncutter.cxx b/basegfx/source/polygon/b2dpolypolygoncutter.cxx index 6feeb1685bfc..a6c7bdc543a2 100644 --- a/basegfx/source/polygon/b2dpolypolygoncutter.cxx +++ b/basegfx/source/polygon/b2dpolypolygoncutter.cxx @@ -731,7 +731,7 @@ namespace basegfx::utils { const B2DPolygon& aCand(aCandidate.getB2DPolygon(a)); StripHelper* pNewHelper = &(aHelpers[a]); - pNewHelper->maRange = utils::getRange(aCand); + pNewHelper->maRange = aCand.getB2DRange(); pNewHelper->meOrinetation = utils::getOrientation(aCand); // initialize with own orientation @@ -811,7 +811,7 @@ namespace basegfx::utils { const B2DPolygon& aCandidate(rCandidate.getB2DPolygon(a)); StripHelper* pNewHelper = &(aHelpers[a]); - pNewHelper->maRange = utils::getRange(aCandidate); + pNewHelper->maRange = aCandidate.getB2DRange(); pNewHelper->meOrinetation = utils::getOrientation(aCandidate); pNewHelper->mnDepth = (pNewHelper->meOrinetation == B2VectorOrientation::Negative ? -1 : 0); } diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx index cccd168bde00..4edb248b59ee 100644 --- a/basegfx/source/polygon/b2dpolypolygontools.cxx +++ b/basegfx/source/polygon/b2dpolypolygontools.cxx @@ -179,18 +179,6 @@ namespace basegfx::utils } } - B2DRange getRange(const B2DPolyPolygon& rCandidate) - { - B2DRange aRetval; - - for(auto const& rPolygon : rCandidate) - { - aRetval.expand(utils::getRange(rPolygon)); - } - - return aRetval; - } - double getSignedArea(const B2DPolyPolygon& rCandidate) { double fRetval(0.0); diff --git a/basegfx/source/tools/unopolypolygon.cxx b/basegfx/source/tools/unopolypolygon.cxx index 36ee6181b5bd..50e14d7168f5 100644 --- a/basegfx/source/tools/unopolypolygon.cxx +++ b/basegfx/source/tools/unopolypolygon.cxx @@ -105,7 +105,7 @@ namespace basegfx::unotools } } - const B2DRange aBounds( utils::getRange( aSrcPoly ) ); + const B2DRange aBounds( aSrcPoly.getB2DRange() ); const B2DVector aOffset( unotools::b2DPointFromRealPoint2D( position ) - aBounds.getMinimum() ); diff --git a/canvas/source/directx/dx_spritehelper.cxx b/canvas/source/directx/dx_spritehelper.cxx index 563014ea1f39..18048cf1d7e9 100644 --- a/canvas/source/directx/dx_spritehelper.cxx +++ b/canvas/source/directx/dx_spritehelper.cxx @@ -171,8 +171,7 @@ namespace dxcanvas // apply a simple rect clip // ======================== - ::basegfx::B2DRectangle aClipBounds( - ::basegfx::utils::getRange( aClipPath ) ); + ::basegfx::B2DRectangle aClipBounds( aClipPath.getB2DRange() ); aClipBounds.intersect( aSourceRect ); mpBitmap->draw(fAlpha,rPos,aClipBounds,rTransform); diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index 0898ef5e3259..85a9d90cba23 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -162,7 +162,7 @@ namespace oglcanvas rTexture.AffineTransform ); ::basegfx::B2DRange aBounds; for( const auto& rPoly : rPolyPolygons ) - aBounds.expand( ::basegfx::utils::getRange( rPoly ) ); + aBounds.expand( rPoly.getB2DRange() ); aTextureTransform.translate(-aBounds.getMinX(), -aBounds.getMinY()); aTextureTransform.scale(1/aBounds.getWidth(), 1/aBounds.getHeight()); @@ -306,7 +306,7 @@ namespace oglcanvas rTexture.AffineTransform ); ::basegfx::B2DRange aBounds; for( const auto& rPolyPolygon : rPolyPolygons ) - aBounds.expand( ::basegfx::utils::getRange( rPolyPolygon ) ); + aBounds.expand( rPolyPolygon.getB2DRange() ); aTextureTransform.translate(-aBounds.getMinX(), -aBounds.getMinY()); aTextureTransform.scale(1/aBounds.getWidth(), 1/aBounds.getHeight()); aTextureTransform.invert(); diff --git a/canvas/source/tools/canvascustomspritehelper.cxx b/canvas/source/tools/canvascustomspritehelper.cxx index 1c2bb155b8aa..cdb53aeab630 100644 --- a/canvas/source/tools/canvascustomspritehelper.cxx +++ b/canvas/source/tools/canvascustomspritehelper.cxx @@ -61,8 +61,7 @@ namespace canvas // clip which is about to be set, expressed as a // b2drectangle - const ::basegfx::B2DRectangle aClipBounds( - ::basegfx::utils::getRange( aClipPath ) ); + const ::basegfx::B2DRectangle aClipBounds( aClipPath.getB2DRange() ); const ::basegfx::B2DRectangle aBounds( 0.0, 0.0, maSize.getX(), diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 3c86e197a26c..448d30204b24 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -562,7 +562,7 @@ namespace cppcanvas::internal } const ::basegfx::B2DRectangle aBounds( - ::basegfx::utils::getRange(aDevicePoly) ); + aDevicePoly.getB2DRange() ); const ::basegfx::B2DVector aOffset( rGradient.GetOfsX() / 100.0, rGradient.GetOfsY() / 100.0); diff --git a/cppcanvas/source/mtfrenderer/polypolyaction.cxx b/cppcanvas/source/mtfrenderer/polypolyaction.cxx index 2ffef8b79aac..0f75ecee39b3 100644 --- a/cppcanvas/source/mtfrenderer/polypolyaction.cxx +++ b/cppcanvas/source/mtfrenderer/polypolyaction.cxx @@ -89,7 +89,7 @@ namespace cppcanvas::internal bool bStroke ) : CachedPrimitiveBase( rCanvas, false ), mxPolyPoly( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( rCanvas->getUNOCanvas()->getDevice(), rPolyPoly) ), - maBounds( ::basegfx::utils::getRange(rPolyPoly) ), + maBounds( rPolyPoly.getB2DRange() ), mpCanvas( rCanvas ) { cppcanvastools::initRenderState(maState,rState); @@ -109,7 +109,7 @@ namespace cppcanvas::internal int nTransparency ) : CachedPrimitiveBase( rCanvas, false ), mxPolyPoly( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( rCanvas->getUNOCanvas()->getDevice(), rPolyPoly) ), - maBounds( ::basegfx::utils::getRange(rPolyPoly) ), + maBounds( rPolyPoly.getB2DRange() ), mpCanvas( rCanvas ) { cppcanvastools::initRenderState(maState,rState); @@ -258,7 +258,7 @@ namespace cppcanvas::internal const rendering::Texture& rTexture ) : CachedPrimitiveBase( rCanvas, true ), mxPolyPoly( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( rCanvas->getUNOCanvas()->getDevice(), rPolyPoly) ), - maBounds( ::basegfx::utils::getRange(rPolyPoly) ), + maBounds( rPolyPoly.getB2DRange() ), mpCanvas( rCanvas ), maTexture( rTexture ) { @@ -367,7 +367,7 @@ namespace cppcanvas::internal rendering::StrokeAttributes aStrokeAttributes ) : CachedPrimitiveBase( rCanvas, false ), mxPolyPoly( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( rCanvas->getUNOCanvas()->getDevice(), rPolyPoly) ), - maBounds( ::basegfx::utils::getRange(rPolyPoly) ), + maBounds( rPolyPoly.getB2DRange() ), mpCanvas( rCanvas ), maStrokeAttributes(std::move( aStrokeAttributes )) { diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx index 72e3cafc7396..9865206e008a 100644 --- a/cppcanvas/source/mtfrenderer/textaction.cxx +++ b/cppcanvas/source/mtfrenderer/textaction.cxx @@ -585,7 +585,7 @@ namespace cppcanvas::internal const ::basegfx::B2DPolyPolygon aPoly( cppcanvastools::createTextLinesPolyPolygon( 0.0, nLineWidth, rLineInfo ) ); - auto aRange = basegfx::utils::getRange( aPoly ).getRange(); + auto aRange = aPoly.getB2DRange().getRange(); o_rOverallSize = basegfx::B2DSize(aRange.getX(), aRange.getY()); o_rTextLines = ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( @@ -1567,7 +1567,7 @@ namespace cppcanvas::internal return calcEffectTextBounds( ::basegfx::unotools::b2DRectangleFromRealRectangle2D( xTextLayout->queryTextBounds() ), - ::basegfx::utils::getRange( aPoly ), + aPoly.getB2DRange(), maReliefOffset, maShadowOffset, aLocalState, @@ -2122,7 +2122,7 @@ namespace cppcanvas::internal rShadowColor, rTextFillColor, xTextBoundsPoly, - ::basegfx::utils::getRange(aResultingPolyPolygon), + aResultingPolyPolygon.getB2DRange(), xTextPoly, aCharWidthSeq, rVDev, @@ -2140,7 +2140,7 @@ namespace cppcanvas::internal rShadowColor, rTextFillColor, xTextBoundsPoly, - ::basegfx::utils::getRange(aResultingPolyPolygon), + aResultingPolyPolygon.getB2DRange(), xTextPoly, aCharWidthSeq, rVDev, diff --git a/cppcanvas/source/mtfrenderer/textlineshelper.cxx b/cppcanvas/source/mtfrenderer/textlineshelper.cxx index e56ed7439bf9..1bdd62c85441 100644 --- a/cppcanvas/source/mtfrenderer/textlineshelper.cxx +++ b/cppcanvas/source/mtfrenderer/textlineshelper.cxx @@ -59,19 +59,19 @@ void TextLinesHelper::init(double nLineWidth, const cppcanvastools::TextLineInfo if (aOverline.count()) { - aRange.expand(::basegfx::utils::getRange(aOverline)); + aRange.expand(aOverline.getB2DRange()); mxOverline = ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(xDevice, aOverline); } if (aUnderline.count()) { - aRange.expand(::basegfx::utils::getRange(aUnderline)); + aRange.expand(aUnderline.getB2DRange()); mxUnderline = ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(xDevice, aUnderline); } if (aStrikeout.count()) { - aRange.expand(::basegfx::utils::getRange(aStrikeout)); + aRange.expand(aStrikeout.getB2DRange()); mxStrikeout = ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(xDevice, aStrikeout); } diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx index bd7a0d09c7dc..1f49142d8411 100644 --- a/cui/source/tabpages/tplneend.cxx +++ b/cui/source/tabpages/tplneend.cxx @@ -362,7 +362,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl, weld::Button&, void) } basegfx::B2DPolyPolygon aNewPolyPolygon(static_cast<const SdrPathObj*>(pNewObj)->GetPathPoly()); - basegfx::B2DRange aNewRange(basegfx::utils::getRange(aNewPolyPolygon)); + basegfx::B2DRange aNewRange(aNewPolyPolygon.getB2DRange()); // normalize aNewPolyPolygon.translate( -aNewRange.getMinX(), -aNewRange.getMinY() ); diff --git a/drawinglayer/source/primitive2d/PolyPolygonAlphaGradientPrimitive2D.cxx b/drawinglayer/source/primitive2d/PolyPolygonAlphaGradientPrimitive2D.cxx index 63de94bb39ad..d30dbf535ef4 100644 --- a/drawinglayer/source/primitive2d/PolyPolygonAlphaGradientPrimitive2D.cxx +++ b/drawinglayer/source/primitive2d/PolyPolygonAlphaGradientPrimitive2D.cxx @@ -59,8 +59,8 @@ Primitive2DReference PolyPolygonAlphaGradientPrimitive2D::create2DDecomposition( Primitive2DContainer aContent{ new PolyPolygonColorPrimitive2D(getB2DPolyPolygon(), getBColor()) }; - Primitive2DContainer aAlpha{ new FillGradientPrimitive2D( - basegfx::utils::getRange(getB2DPolyPolygon()), getAlphaGradient()) }; + Primitive2DContainer aAlpha{ new FillGradientPrimitive2D(getB2DPolyPolygon().getB2DRange(), + getAlphaGradient()) }; return new TransparencePrimitive2D(std::move(aContent), std::move(aAlpha)); } @@ -93,7 +93,7 @@ basegfx::B2DRange PolyPolygonAlphaGradientPrimitive2D::getB2DRange( const geometry::ViewInformation2D& /*rViewInformation*/) const { // return range - without decompose - return basegfx::utils::getRange(getB2DPolyPolygon()); + return getB2DPolyPolygon().getB2DRange(); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/PolyPolygonColorPrimitive2D.cxx b/drawinglayer/source/primitive2d/PolyPolygonColorPrimitive2D.cxx index 6c7cf4bb365a..fcf0d03887bc 100644 --- a/drawinglayer/source/primitive2d/PolyPolygonColorPrimitive2D.cxx +++ b/drawinglayer/source/primitive2d/PolyPolygonColorPrimitive2D.cxx @@ -53,7 +53,7 @@ basegfx::B2DRange PolyPolygonColorPrimitive2D::getB2DRange( const geometry::ViewInformation2D& /*rViewInformation*/) const { // return range - return basegfx::utils::getRange(getB2DPolyPolygon()); + return getB2DPolyPolygon().getB2DRange(); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/PolyPolygonHairlinePrimitive2D.cxx b/drawinglayer/source/primitive2d/PolyPolygonHairlinePrimitive2D.cxx index 88b15160e2c0..6e6db92902ba 100644 --- a/drawinglayer/source/primitive2d/PolyPolygonHairlinePrimitive2D.cxx +++ b/drawinglayer/source/primitive2d/PolyPolygonHairlinePrimitive2D.cxx @@ -69,7 +69,7 @@ basegfx::B2DRange PolyPolygonHairlinePrimitive2D::getB2DRange( const geometry::ViewInformation2D& /*rViewInformation*/) const { // return range - return basegfx::utils::getRange(getB2DPolyPolygon()); + return getB2DPolyPolygon().getB2DRange(); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/PolyPolygonMarkerPrimitive2D.cxx b/drawinglayer/source/primitive2d/PolyPolygonMarkerPrimitive2D.cxx index 9c9e3b1ae81f..acb4198b5edd 100644 --- a/drawinglayer/source/primitive2d/PolyPolygonMarkerPrimitive2D.cxx +++ b/drawinglayer/source/primitive2d/PolyPolygonMarkerPrimitive2D.cxx @@ -76,7 +76,7 @@ basegfx::B2DRange PolyPolygonMarkerPrimitive2D::getB2DRange( const geometry::ViewInformation2D& /*rViewInformation*/) const { // return range - return basegfx::utils::getRange(getB2DPolyPolygon()); + return getB2DPolyPolygon().getB2DRange(); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/PolyPolygonRGBAPrimitive2D.cxx b/drawinglayer/source/primitive2d/PolyPolygonRGBAPrimitive2D.cxx index b83024604f92..50ed6ecdf152 100644 --- a/drawinglayer/source/primitive2d/PolyPolygonRGBAPrimitive2D.cxx +++ b/drawinglayer/source/primitive2d/PolyPolygonRGBAPrimitive2D.cxx @@ -85,7 +85,7 @@ basegfx::B2DRange PolyPolygonRGBAPrimitive2D::getB2DRange( const geometry::ViewInformation2D& /*rViewInformation*/) const { // return range - without decompose - return basegfx::utils::getRange(getB2DPolyPolygon()); + return getB2DPolyPolygon().getB2DRange(); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D.cxx b/drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D.cxx index a5595a4bcaeb..7d86b68bc0e8 100644 --- a/drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D.cxx +++ b/drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D.cxx @@ -100,7 +100,7 @@ bool PolyPolygonSelectionPrimitive2D::operator==(const BasePrimitive2D& rPrimiti basegfx::B2DRange PolyPolygonSelectionPrimitive2D::getB2DRange( const geometry::ViewInformation2D& rViewInformation) const { - basegfx::B2DRange aRetval(basegfx::utils::getRange(getB2DPolyPolygon())); + basegfx::B2DRange aRetval(getB2DPolyPolygon().getB2DRange()); if (getDiscreteGrow() > 0.0) { diff --git a/drawinglayer/source/primitive2d/PolyPolygonStrokePrimitive2D.cxx b/drawinglayer/source/primitive2d/PolyPolygonStrokePrimitive2D.cxx index 9c32d8853d8d..df0943c3a26b 100644 --- a/drawinglayer/source/primitive2d/PolyPolygonStrokePrimitive2D.cxx +++ b/drawinglayer/source/primitive2d/PolyPolygonStrokePrimitive2D.cxx @@ -79,7 +79,7 @@ basegfx::B2DRange PolyPolygonStrokePrimitive2D::getB2DRange( const geometry::ViewInformation2D& /*rViewInformation*/) const { // get range of it (subdivided) - basegfx::B2DRange aRetval(basegfx::utils::getRange(getB2DPolyPolygon())); + basegfx::B2DRange aRetval(getB2DPolyPolygon().getB2DRange()); // if width, grow by line width if (getLineAttribute().getWidth()) diff --git a/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx index 5ef71c97aa33..d2a5df099456 100644 --- a/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx @@ -128,7 +128,7 @@ namespace drawinglayer::primitive2d basegfx::B2DPolygon aPolygon(basegfx::utils::createUnitPolygon()); aPolygon.transform(getTransformation()); - return basegfx::utils::getRange(aPolygon); + return aPolygon.getB2DRange(); } // provide unique ID diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx index 42e2f9e75b71..6292b58a41c0 100644 --- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx @@ -128,7 +128,7 @@ namespace drawinglayer::primitive3d { // found two linearly independent 2D vectors // get 2d range of texture coordinates - const basegfx::B2DRange aOutlineRange(basegfx::utils::getRange(aTexPolyPolygon)); + const basegfx::B2DRange aOutlineRange(aTexPolyPolygon.getB2DRange()); const basegfx::BColor aHatchColor(getHatch().getColor()); const double fAngle(getHatch().getAngle()); std::vector< basegfx::B2DHomMatrix > aMatrices; diff --git a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx index 2e1071c1f9a6..5c7ce531f486 100644 --- a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx +++ b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx @@ -50,7 +50,7 @@ namespace if(!basegfx::fTools::equalZero(fScale)) { - const basegfx::B2DRange aRange(basegfx::utils::getRange(rSource)); + const basegfx::B2DRange aRange(rSource.getB2DRange()); const basegfx::B2DPoint aCenter(aRange.getCenter()); basegfx::B2DHomMatrix aTrans; @@ -79,9 +79,9 @@ namespace // grow the outside polygon and scale all polygons to original size. This is done // to avoid a shrink which potentially would lead to self-intersections, but changes // the original polygon -> not a precision step, so e.g. not usable for charts - const basegfx::B2DRange aRange(basegfx::utils::getRange(rPolygon)); + const basegfx::B2DRange aRange(rPolygon.getB2DRange()); rPolygon = basegfx::utils::growInNormalDirection(rPolygon, fOffset); - const basegfx::B2DRange aGrownRange(basegfx::utils::getRange(rPolygon)); + const basegfx::B2DRange aGrownRange(rPolygon.getB2DRange()); const double fScaleX(basegfx::fTools::equalZero(aGrownRange.getWidth()) ? 1.0 : aRange.getWidth() / aGrownRange.getWidth()); const double fScaleY(basegfx::fTools::equalZero(aGrownRange.getHeight())? 1.0 : aRange.getHeight() / aGrownRange.getHeight()); basegfx::B2DHomMatrix aScaleTrans; @@ -397,7 +397,7 @@ namespace drawinglayer::primitive3d if(bCloseFront || bCloseBack) { - const basegfx::B2DRange aBaseRange(basegfx::utils::getRange(aFront)); + const basegfx::B2DRange aBaseRange(aFront.getB2DRange()); const double fOuterLength(aBaseRange.getMaxX() * fRotation); const double fInnerLength(aBaseRange.getMinX() * fRotation); const double fAverageLength((fOuterLength + fInnerLength) * 0.5); diff --git a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx index 14d6800af5d2..58b2629db59a 100644 --- a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx @@ -3595,7 +3595,7 @@ void CairoPixelProcessor2D::processPolyPolygonAlphaGradientPrimitive2D( // create temporary FillGradientPrimitive2D, but do not forget // to embed to MaskPrimitive2D to get the PolyPolygon form - const basegfx::B2DRange aRange(basegfx::utils::getRange(rPolyPolygon)); + const basegfx::B2DRange aRange(rPolyPolygon.getB2DRange()); const primitive2d::Primitive2DContainer aContainerMaskedFillGradient{ rtl::Reference<primitive2d::MaskPrimitive2D>(new primitive2d::MaskPrimitive2D( rPolyPolygon, diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index 390f46c83766..4257de9e7de4 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -923,7 +923,7 @@ void VclProcessor2D::RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive return; } - const basegfx::B2DRange aRange(basegfx::utils::getRange(aMask)); + const basegfx::B2DRange aRange(aMask.getB2DRange()); tools::Rectangle aMaskRect = vcl::unotools::rectangleFromB2DRectangle(aRange); impBufferDevice aBufferDevice(*mpOutputDevice, aMaskRect); diff --git a/drawinglayer/source/tools/emfpbrush.cxx b/drawinglayer/source/tools/emfpbrush.cxx index 4c0ac0ef7832..d64d76085dc5 100644 --- a/drawinglayer/source/tools/emfpbrush.cxx +++ b/drawinglayer/source/tools/emfpbrush.cxx @@ -149,7 +149,7 @@ namespace emfplushelper s.Seek(pos + pathLength); - const ::basegfx::B2DRectangle aBounds(::basegfx::utils::getRange(path->GetPolygon(rR, false))); + const ::basegfx::B2DRectangle aBounds(path->GetPolygon(rR, false).getB2DRange()); aWidth = aBounds.getWidth(); aHeight = aBounds.getHeight(); SAL_INFO("drawinglayer.emf", "EMF+ Polygon bounding box: " << aBounds.getMinX() << "," << aBounds.getMinY() << " " @@ -167,7 +167,7 @@ namespace emfplushelper s.Seek(pos + 8 * boundaryPointCount); - const ::basegfx::B2DRectangle aBounds(::basegfx::utils::getRange(path->GetPolygon(rR, false))); + const ::basegfx::B2DRectangle aBounds(path->GetPolygon(rR, false).getB2DRange()); aWidth = aBounds.getWidth(); aHeight = aBounds.getHeight(); SAL_INFO("drawinglayer.emf", "EMF+ Polygon bounding box: " << aBounds.getMinX() << "," << aBounds.getMinY() << " " diff --git a/include/basegfx/polygon/b2dpolygontools.hxx b/include/basegfx/polygon/b2dpolygontools.hxx index 783b7347f018..09028e1b3442 100644 --- a/include/basegfx/polygon/b2dpolygontools.hxx +++ b/include/basegfx/polygon/b2dpolygontools.hxx @@ -90,19 +90,6 @@ namespace basegfx::utils BASEGFX_DLLPUBLIC bool isInside(const B2DPolygon& rCandidate, const B2DPoint& rPoint, bool bWithBorder = false); BASEGFX_DLLPUBLIC bool isInside(const B2DPolygon& rCandidate, const B2DPolygon& rPolygon, bool bWithBorder = false); - /** Get the range of a polygon - - This method creates the outer range of the subdivided bezier curve. - For detailed discussion see B2DPolygon::getB2DRange() - - @param rCandidate - The B2DPolygon possibly containing bezier segments - - @return - The outer range of the bezier curve - */ - BASEGFX_DLLPUBLIC B2DRange getRange(const B2DPolygon& rCandidate); - // get signed area of polygon BASEGFX_DLLPUBLIC double getSignedArea(const B2DPolygon& rCandidate); diff --git a/include/basegfx/polygon/b2dpolypolygontools.hxx b/include/basegfx/polygon/b2dpolypolygontools.hxx index 896094633230..955c5430d9ec 100644 --- a/include/basegfx/polygon/b2dpolypolygontools.hxx +++ b/include/basegfx/polygon/b2dpolypolygontools.hxx @@ -59,19 +59,6 @@ namespace basegfx::utils // in bWithBorder flag. It is assumed that the orientations of the given polygon are correct. BASEGFX_DLLPUBLIC bool isInside(const B2DPolyPolygon& rCandidate, const B2DPoint& rPoint, bool bWithBorder = false); - /** Get the range of a polyPolygon - - For detailed description look at getRange(const B2DPolygon&). - This method just expands by the range of every sub-Polygon. - - @param rCandidate - The B2DPolyPolygon possibly containing bezier segments - - @return - The outer range of the polygon - */ - BASEGFX_DLLPUBLIC B2DRange getRange(const B2DPolyPolygon& rCandidate); - // get signed area of polygon BASEGFX_DLLPUBLIC double getSignedArea(const B2DPolyPolygon& rCandidate); diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 5540894cf274..2867ec1c6e71 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -737,7 +737,7 @@ namespace tools::Rectangle lcl_UpdateCalcPoly(basegfx::B2DPolygon &rCalcPoly, int nWhichPoint, const Point &rPos) { rCalcPoly.setB2DPoint(nWhichPoint, basegfx::B2DPoint(rPos.X(), rPos.Y())); - basegfx::B2DRange aRange(basegfx::utils::getRange(rCalcPoly)); + basegfx::B2DRange aRange(rCalcPoly.getB2DRange()); return tools::Rectangle(static_cast<tools::Long>(aRange.getMinX()), static_cast<tools::Long>(aRange.getMinY()), static_cast<tools::Long>(aRange.getMaxX()), static_cast<tools::Long>(aRange.getMaxY())); } diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index 6af6d1cc8a79..4c80d4b9951e 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -236,9 +236,9 @@ void FuMorph::ImpEqualizePolyPointCount( ::basegfx::B2DPolygon aPoly1(ImpGetExpandedPolygon(rSmall, nCnt)); // create transformation for rBig to do the compare - const ::basegfx::B2DRange aSrcSize(::basegfx::utils::getRange(rBig)); + const ::basegfx::B2DRange aSrcSize(rBig.getB2DRange()); const ::basegfx::B2DPoint aSrcPos(aSrcSize.getCenter()); - const ::basegfx::B2DRange aDstSize(::basegfx::utils::getRange(rSmall)); + const ::basegfx::B2DRange aDstSize(rSmall.getB2DRange()); const ::basegfx::B2DPoint aDstPos(aDstSize.getCenter()); basegfx::B2DHomMatrix aTrans(basegfx::utils::createTranslateB2DHomMatrix(-aSrcPos.getX(), -aSrcPos.getY())); @@ -292,13 +292,13 @@ void FuMorph::ImpAddPolys( while(rSmaller.count() < rBigger.count()) { const ::basegfx::B2DPolygon& aToBeCopied(rBigger.getB2DPolygon(rSmaller.count())); - const ::basegfx::B2DRange aToBeCopiedPolySize(::basegfx::utils::getRange(aToBeCopied)); + const ::basegfx::B2DRange aToBeCopiedPolySize(aToBeCopied.getB2DRange()); ::basegfx::B2DPoint aNewPoint(aToBeCopiedPolySize.getCenter()); ::basegfx::B2DPolygon aNewPoly; - const ::basegfx::B2DRange aSrcSize(::basegfx::utils::getRange(rBigger.getB2DPolygon(0))); + const ::basegfx::B2DRange aSrcSize(rBigger.getB2DPolygon(0).getB2DRange()); const ::basegfx::B2DPoint aSrcPos(aSrcSize.getCenter()); - const ::basegfx::B2DRange aDstSize(::basegfx::utils::getRange(rSmaller.getB2DPolygon(0))); + const ::basegfx::B2DRange aDstSize(rSmaller.getB2DPolygon(0).getB2DRange()); const ::basegfx::B2DPoint aDstPos(aDstSize.getCenter()); aNewPoint = aNewPoint - aSrcPos + aDstPos; @@ -478,9 +478,9 @@ void FuMorph::ImpMorphPolygons( if(!nSteps) return; - const ::basegfx::B2DRange aStartPolySize(::basegfx::utils::getRange(rPolyPoly1)); + const ::basegfx::B2DRange aStartPolySize(rPolyPoly1.getB2DRange()); const ::basegfx::B2DPoint aStartCenter(aStartPolySize.getCenter()); - const ::basegfx::B2DRange aEndPolySize(::basegfx::utils::getRange(rPolyPoly2)); + const ::basegfx::B2DRange aEndPolySize(rPolyPoly2.getB2DRange()); const ::basegfx::B2DPoint aEndCenter(aEndPolySize.getCenter()); const ::basegfx::B2DPoint aDelta(aEndCenter - aStartCenter); const double fFactor(1.0 / (nSteps + 1)); @@ -491,7 +491,7 @@ void FuMorph::ImpMorphPolygons( fValue += fFactor; ::basegfx::B2DPolyPolygon aNewPolyPoly2D = ImpCreateMorphedPolygon(rPolyPoly1, rPolyPoly2, fValue); - const ::basegfx::B2DRange aNewPolySize(::basegfx::utils::getRange(aNewPolyPoly2D)); + const ::basegfx::B2DRange aNewPolySize(aNewPolyPoly2D.getB2DRange()); const ::basegfx::B2DPoint aNewS(aNewPolySize.getCenter()); const ::basegfx::B2DPoint aRealS(aStartCenter + (aDelta * fValue)); const ::basegfx::B2DPoint aDiff(aRealS - aNewS); diff --git a/sdext/source/pdfimport/tree/genericelements.cxx b/sdext/source/pdfimport/tree/genericelements.cxx index fa6d951e5da2..7d61d0796d4f 100644 --- a/sdext/source/pdfimport/tree/genericelements.cxx +++ b/sdext/source/pdfimport/tree/genericelements.cxx @@ -147,9 +147,9 @@ void PolyPolyElement::updateGeometry() { basegfx::B2DRange aRange; if( PolyPoly.areControlPointsUsed() ) - aRange = basegfx::utils::getRange( basegfx::utils::adaptiveSubdivideByAngle( PolyPoly ) ); + aRange = basegfx::utils::adaptiveSubdivideByAngle( PolyPoly ).getB2DRange(); else - aRange = basegfx::utils::getRange( PolyPoly ); + aRange = PolyPoly.getB2DRange(); x = aRange.getMinX(); y = aRange.getMinY(); w = aRange.getWidth(); diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx index 230184f17b83..58cd35803463 100644 --- a/svx/source/customshapes/EnhancedCustomShape3d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx @@ -509,7 +509,7 @@ rtl::Reference<SdrObject> EnhancedCustomShape3d::Create3DObject( aPolyPoly = basegfx::utils::adaptiveSubdivideByAngle(aPolyPoly); } - const basegfx::B2DRange aTempRange(basegfx::utils::getRange(aPolyPoly)); + const basegfx::B2DRange aTempRange(aPolyPoly.getB2DRange()); const tools::Rectangle aBoundRect(basegfx::fround<tools::Long>(aTempRange.getMinX()), basegfx::fround<tools::Long>(aTempRange.getMinY()), basegfx::fround<tools::Long>(aTempRange.getMaxX()), basegfx::fround<tools::Long>(aTempRange.getMaxY())); aTotalPolyPoly.append(aPolyPoly); aBoundRect2d.Union( aBoundRect ); diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index 132eca98536b..039d5f359b59 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -1339,7 +1339,7 @@ void E3dView::Start3DCreation() { SdrObject* pMark = rMarkList.GetMark(nMark)->GetMarkedSdrObj(); basegfx::B2DPolyPolygon aXPP(pMark->TakeXorPoly()); - aR.expand(basegfx::utils::getRange(aXPP)); + aR.expand(aXPP.getB2DRange()); } basegfx::B2DPoint aCenter(aR.getCenter()); diff --git a/svx/source/sdr/contact/viewcontactofe3dextrude.cxx b/svx/source/sdr/contact/viewcontactofe3dextrude.cxx index 146a06305d64..e2a3a831d308 100644 --- a/svx/source/sdr/contact/viewcontactofe3dextrude.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dextrude.cxx @@ -53,7 +53,7 @@ namespace sdr::contact // calculate texture size; use size of top/bottom cap to get a perfect mapping // for the caps. The in-between geometry will get a stretched size with a // relative factor size of caps to extrude depth - const basegfx::B2DRange aRange(basegfx::utils::getRange(aPolyPolygon)); + const basegfx::B2DRange aRange(aPolyPolygon.getB2DRange()); const basegfx::B2DVector aTextureSize(aRange.getWidth(), aRange.getHeight()); // get more data diff --git a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx index a7e73acc58e7..6822fb8cb853 100644 --- a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx @@ -61,7 +61,7 @@ namespace sdr::contact fPolygonMaxLength = std::max(fPolygonMaxLength, fPolygonLength); } - const basegfx::B2DRange aPolyPolygonRange(basegfx::utils::getRange(aPolyPolygon)); + const basegfx::B2DRange aPolyPolygonRange(aPolyPolygon.getB2DRange()); const basegfx::B2DVector aTextureSize( M_PI * fabs(aPolyPolygonRange.getCenter().getX()), // PI * d fPolygonMaxLength); diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx index add214d4e34a..eed34565a143 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx @@ -110,7 +110,7 @@ namespace sdr::contact { // #i102548# create unscaled, unsheared, unrotated and untranslated polygon // (unit polygon) by creating the object matrix and back-transforming the polygon - const basegfx::B2DRange aObjectRange(basegfx::utils::getRange(aUnitPolyPolygon)); + const basegfx::B2DRange aObjectRange(aUnitPolyPolygon.getB2DRange()); const GeoStat& rGeoStat(GetPathObj().GetGeoStat()); const double fWidth(aObjectRange.getWidth()); const double fHeight(aObjectRange.getHeight()); diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index 78daae6c4c5e..71b818d1d11d 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -360,7 +360,7 @@ basegfx::B2DRange SlideBackgroundFillPrimitive2D::getB2DRange( const geometry::ViewInformation2D& /*rViewInformation*/) const { // return range - return basegfx::utils::getRange(getB2DPolyPolygon()); + return getB2DPolyPolygon().getB2DRange(); } // provide unique ID @@ -378,7 +378,7 @@ sal_uInt32 SlideBackgroundFillPrimitive2D::getPrimitive2DID() const { // when we have no given definition range, use the range of the given geometry // also for definition (simplest case) - const basegfx::B2DRange aRange(basegfx::utils::getRange(rPolyPolygon)); + const basegfx::B2DRange aRange(rPolyPolygon.getB2DRange()); return createPolyPolygonFillPrimitive( rPolyPolygon, @@ -511,7 +511,7 @@ sal_uInt32 SlideBackgroundFillPrimitive2D::getPrimitive2DID() const // fillGradientPrimitive is enough here (compared to PolyPolygonGradientPrimitive2D) since float transparence will be masked anyways Primitive2DContainer aAlpha { new FillGradientPrimitive2D( - basegfx::utils::getRange(rPolyPolygon), + rPolyPolygon.getB2DRange(), rDefinitionRange, rAlphaGradient) }; @@ -646,7 +646,7 @@ sal_uInt32 SlideBackgroundFillPrimitive2D::getPrimitive2DID() const basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon); aScaledUnitPolyPolygon.transform(aJustScaleTransform); const basegfx::B2DRange aTextAnchorRange - = getTextAnchorRange(rText, basegfx::utils::getRange(aScaledUnitPolyPolygon)); + = getTextAnchorRange(rText, aScaledUnitPolyPolygon.getB2DRange()); // now create a transformation from this basic range (aTextAnchorRange) // #i121494# if we have no scale use at least 1.0 to have a carrier e.g. for diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx index c5a3f812583f..15315202a1b3 100644 --- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx @@ -150,7 +150,7 @@ namespace drawinglayer::primitive2d { if(rLineStartEnd.isStartActive()) { - const basegfx::B2DRange aArrowRange(basegfx::utils::getRange(rLineStartEnd.getStartPolyPolygon())); + const basegfx::B2DRange aArrowRange(rLineStartEnd.getStartPolyPolygon().getB2DRange()); fStartArrowW = rLineStartEnd.getStartWidth(); fStartArrowH = aArrowRange.getHeight() * fStartArrowW / aArrowRange.getWidth(); @@ -162,7 +162,7 @@ namespace drawinglayer::primitive2d if(rLineStartEnd.isEndActive()) { - const basegfx::B2DRange aArrowRange(basegfx::utils::getRange(rLineStartEnd.getEndPolyPolygon())); + const basegfx::B2DRange aArrowRange(rLineStartEnd.getEndPolyPolygon().getB2DRange()); fEndArrowW = rLineStartEnd.getEndWidth(); fEndArrowH = aArrowRange.getHeight() * fEndArrowW / aArrowRange.getWidth(); diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 42e5a267985a..4ac94576b212 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -1651,7 +1651,7 @@ static bool lcl_ImpIsLine(const basegfx::B2DPolyPolygon& rPolyPolygon) static tools::Rectangle lcl_ImpGetBoundRect(const basegfx::B2DPolyPolygon& rPolyPolygon) { - basegfx::B2DRange aRange(basegfx::utils::getRange(rPolyPolygon)); + basegfx::B2DRange aRange(rPolyPolygon.getB2DRange()); if (aRange.isEmpty()) return tools::Rectangle(); @@ -2801,7 +2801,7 @@ bool SdrPathObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DP // #i72287# use polygon without control points for range calculation. Do not change rPolyPolygon // itself, else this method will no longer return the full polygon information (curve will // be lost) - const basegfx::B2DRange aPolyRangeNoCurve(basegfx::utils::getRange(rPolyPolygon)); + const basegfx::B2DRange aPolyRangeNoCurve(rPolyPolygon.getB2DRange()); aScale = aPolyRangeNoCurve.getRange(); aTranslate = aPolyRangeNoCurve.getMinimum(); @@ -2833,7 +2833,7 @@ bool SdrPathObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DP // #i72287# use polygon without control points for range calculation. Do not change rPolyPolygon // itself, else this method will no longer return the full polygon information (curve will // be lost) - const basegfx::B2DRange aCorrectedRangeNoCurve(basegfx::utils::getRange(rPolyPolygon)); + const basegfx::B2DRange aCorrectedRangeNoCurve(rPolyPolygon.getB2DRange()); aTranslate = aObjectMatrix * aCorrectedRangeNoCurve.getMinimum(); aScale = aCorrectedRangeNoCurve.getRange(); @@ -2847,7 +2847,7 @@ bool SdrPathObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DP // #i72287# use polygon without control points for range calculation. Do not change rPolyPolygon // itself, else this method will no longer return the full polygon information (curve will // be lost) - const basegfx::B2DRange aPolyRangeNoCurve(basegfx::utils::getRange(rPolyPolygon)); + const basegfx::B2DRange aPolyRangeNoCurve(rPolyPolygon.getB2DRange()); if (!aPolyRangeNoCurve.isEmpty()) { aScale = aPolyRangeNoCurve.getRange(); @@ -2980,7 +2980,7 @@ void SdrPathObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b if(!aTranslate.equalZero()) { // #i39529# absolute positioning, so get current position (without control points (!)) - const basegfx::B2DRange aCurrentRange(basegfx::utils::getRange(aNewPolyPolygon)); + const basegfx::B2DRange aCurrentRange(aNewPolyPolygon.getB2DRange()); aTransform.translate(aTranslate.getX() - aCurrentRange.getMinX(), aTranslate.getY() - aCurrentRange.getMinY()); } diff --git a/svx/source/xoutdev/_xpoly.cxx b/svx/source/xoutdev/_xpoly.cxx index 026ae404ca61..d5a4709ae043 100644 --- a/svx/source/xoutdev/_xpoly.cxx +++ b/svx/source/xoutdev/_xpoly.cxx @@ -406,7 +406,7 @@ tools::Rectangle XPolygon::GetBoundRect() const // get a relatively correct BoundRect. Numerically, this is not // correct and never was. - const basegfx::B2DRange aPolygonRange(basegfx::utils::getRange(getB2DPolygon())); + const basegfx::B2DRange aPolygonRange(getB2DPolygon().getB2DRange()); aRetval = tools::Rectangle(basegfx::fround<tools::Long>(aPolygonRange.getMinX()), basegfx::fround<tools::Long>(aPolygonRange.getMinY()), basegfx::fround<tools::Long>(aPolygonRange.getMaxX()), diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx index 34ec89ca7f9f..fff84da6297c 100644 --- a/vcl/headless/CairoCommon.cxx +++ b/vcl/headless/CairoCommon.cxx @@ -1045,7 +1045,7 @@ bool CairoCommon::drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice, static const bool bFuzzing = comphelper::IsFuzzing(); if (bFuzzing) { - const basegfx::B2DRange aRange(basegfx::utils::getRange(rPolyLine)); + const basegfx::B2DRange aRange(rPolyLine.getB2DRange()); if (aRange.getMaxX() - aRange.getMinX() > 0x10000000 || aRange.getMaxY() - aRange.getMinY() > 0x10000000) { diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index 15baf036ce55..daee1aed18b0 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -1234,7 +1234,7 @@ tools::Rectangle vcl::Region::GetBoundRect() const // prefer double precision source if(getB2DPolyPolygon()) { - const basegfx::B2DRange aRange(basegfx::utils::getRange(*getB2DPolyPolygon())); + const basegfx::B2DRange aRange(getB2DPolyPolygon()->getB2DRange()); if(aRange.isEmpty()) { diff --git a/vcl/source/outdev/line.cxx b/vcl/source/outdev/line.cxx index 6c2ba506b907..5ef7a4dbcce2 100644 --- a/vcl/source/outdev/line.cxx +++ b/vcl/source/outdev/line.cxx @@ -302,7 +302,7 @@ void OutputDevice::drawLine( basegfx::B2DPolyPolygon aLinePolyPolygon, const Lin if (bFuzzing) { - const basegfx::B2DRange aRange(basegfx::utils::getRange(aFillPolyPolygon)); + const basegfx::B2DRange aRange(aFillPolyPolygon.getB2DRange()); if (aRange.getMaxX() - aRange.getMinX() > 0x10000000 || aRange.getMaxY() - aRange.getMinY() > 0x10000000) { commit 4bc08277e8fcfc37105f1427ca2f0d596d39eccd Author: Noel Grandin <[email protected]> AuthorDate: Fri Oct 17 15:11:59 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Sun Oct 19 12:13:39 2025 +0200 fix DrawPolyPolygon alpha behaviour I dont think this ever worked. I checked before commit 088a7c7c451321a800ca8d3523a18b6bb93239b7 Author: Noel Grandin <[email protected]> Date: Tue Sep 24 16:18:11 2024 +0200 remove alpha device from OutputDevice and back then, it would simply write opaque white pixels if you set the line or fill colors to anything transparent. Change-Id: I4bf4173a45cf98c705ebfa5917d7cdab887fac64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192577 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx index a9bdff539014..34ec89ca7f9f 100644 --- a/vcl/headless/CairoCommon.cxx +++ b/vcl/headless/CairoCommon.cxx @@ -629,6 +629,7 @@ cairo_t* CairoCommon::createTmpCompatibleCairoContext() const void CairoCommon::applyColor(cairo_t* cr, Color aColor, double fTransparency) { + cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); if (cairo_surface_get_content(cairo_get_target(cr)) != CAIRO_CONTENT_ALPHA) { cairo_set_source_rgba(cr, aColor.GetRed() / 255.0, aColor.GetGreen() / 255.0, @@ -638,7 +639,6 @@ void CairoCommon::applyColor(cairo_t* cr, Color aColor, double fTransparency) { double fSet = aColor == COL_BLACK ? 1.0 : 0.0; cairo_set_source_rgba(cr, 1, 1, 1, fSet); - cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); } } @@ -880,7 +880,8 @@ void CairoCommon::drawRect(double nX, double nY, double nWidth, double nHeight, basegfx::B2DRectangle(nX, nY, nX + nWidth, nY + nHeight)); m_oFillColor = aOrigFillColor; - drawPolyPolygon(basegfx::B2DHomMatrix(), basegfx::B2DPolyPolygon(aRect), 0.0, bAntiAlias); + drawPolyPolygon(basegfx::B2DHomMatrix(), basegfx::B2DPolyPolygon(aRect), + (255 - aOrigFillColor->GetAlpha()) / 255.0, bAntiAlias); m_oFillColor = std::nullopt; } @@ -892,7 +893,8 @@ void CairoCommon::drawRect(double nX, double nY, double nWidth, double nHeight, basegfx::B2DRectangle(nX, nY, nX + nWidth - 1, nY + nHeight - 1)); m_oLineColor = aOrigLineColor; - drawPolyPolygon(basegfx::B2DHomMatrix(), basegfx::B2DPolyPolygon(aRect), 0.0, bAntiAlias); + drawPolyPolygon(basegfx::B2DHomMatrix(), basegfx::B2DPolyPolygon(aRect), + (255 - aOrigLineColor->GetAlpha()) / 255.0, bAntiAlias); m_oLineColor = std::nullopt; } @@ -1137,6 +1139,7 @@ bool CairoCommon::drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice, } } + cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba(cr, m_oLineColor->GetRed() / 255.0, m_oLineColor->GetGreen() / 255.0, m_oLineColor->GetBlue() / 255.0, 1.0 - fTransparency); diff --git a/vcl/qa/cppunit/outdev.cxx b/vcl/qa/cppunit/outdev.cxx index 0573ac8043e9..5f3d1d3be325 100644 --- a/vcl/qa/cppunit/outdev.cxx +++ b/vcl/qa/cppunit/outdev.cxx @@ -1856,6 +1856,58 @@ CPPUNIT_TEST_FIXTURE(VclOutdevTest, testDrawRectAlpha2) CPPUNIT_ASSERT_EQUAL(RED_TRANSPARENT, pVDev->GetPixel(Point(1, 1))); } +CPPUNIT_TEST_FIXTURE(VclOutdevTest, testDrawPolyPolygonAlpha1) +{ + Size aSize(100, 100); + ScopedVclPtrInstance<VirtualDevice> pVDev(DeviceFormat::WITH_ALPHA); + pVDev->SetOutputSizePixel(aSize, /*bErase*/ true, /*bAlphaMaskTransparent*/ true); + + // create a square polypolygon + tools::Polygon aPolygon(4); + aPolygon.SetPoint(Point(0, 0), 0); + aPolygon.SetPoint(Point(0, 100), 1); + aPolygon.SetPoint(Point(100, 100), 2); + aPolygon.SetPoint(Point(0, 0), 3); + tools::PolyPolygon aPolyPolygon(aPolygon); + aPolyPolygon.Optimize(PolyOptimizeFlags::CLOSE); + basegfx::B2DPolyPolygon aB2DPolyPolygon(aPolyPolygon.getB2DPolyPolygon()); + + const Color RED_OPAQUE(ColorAlpha, 255, 255, 0, 0); // opaque red + + pVDev->SetLineColor(RED_OPAQUE); + pVDev->SetFillColor(RED_OPAQUE); + pVDev->DrawPolyPolygon(aB2DPolyPolygon); + + CPPUNIT_ASSERT_EQUAL(RED_OPAQUE, pVDev->GetPixel(Point(0, 0))); + CPPUNIT_ASSERT_EQUAL(RED_OPAQUE, pVDev->GetPixel(Point(1, 1))); +} + +CPPUNIT_TEST_FIXTURE(VclOutdevTest, testDrawPolyPolygonAlpha2) +{ + Size aSize(100, 100); + ScopedVclPtrInstance<VirtualDevice> pVDev(DeviceFormat::WITH_ALPHA); + pVDev->SetOutputSizePixel(aSize, /*bErase*/ true, /*bAlphaMaskTransparent*/ true); + + // create a square polypolygon + tools::Polygon aPolygon(4); + aPolygon.SetPoint(Point(0, 0), 0); + aPolygon.SetPoint(Point(0, 100), 1); + aPolygon.SetPoint(Point(100, 100), 2); + aPolygon.SetPoint(Point(0, 0), 3); + tools::PolyPolygon aPolyPolygon(aPolygon); + aPolyPolygon.Optimize(PolyOptimizeFlags::CLOSE); + basegfx::B2DPolyPolygon aB2DPolyPolygon(aPolyPolygon.getB2DPolyPolygon()); + + const Color RED_TRANSPARENT(ColorAlpha, 127, 255, 0, 0); // 50% transparent red + + pVDev->SetLineColor(RED_TRANSPARENT); + pVDev->SetFillColor(RED_TRANSPARENT); + pVDev->DrawPolyPolygon(aB2DPolyPolygon); + + CPPUNIT_ASSERT_EQUAL(RED_TRANSPARENT, pVDev->GetPixel(Point(0, 0))); + CPPUNIT_ASSERT_EQUAL(RED_TRANSPARENT, pVDev->GetPixel(Point(1, 1))); +} + static size_t ClipGradientTest(GDIMetaFile& rMtf, size_t nIndex) { MetaAction* pAction = rMtf.GetAction(nIndex); diff --git a/vcl/source/outdev/polygon.cxx b/vcl/source/outdev/polygon.cxx index 551c627322ef..19c5ff050b39 100644 --- a/vcl/source/outdev/polygon.cxx +++ b/vcl/source/outdev/polygon.cxx @@ -305,7 +305,7 @@ void OutputDevice::ImplDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyP bSuccess = mpGraphics->DrawPolyLine( aTransform, rPolygon, - 0.0, + (255 - GetLineColor().GetAlpha()) / 255.0, 0.0, // tdf#124848 hairline nullptr, // MM01 basegfx::B2DLineJoin::NONE,
