filter/source/msfilter/msdffimp.cxx | 4 - svx/source/svdraw/sdrhittesthelper.cxx | 78 ++++++++++++++++----------------- 2 files changed, 41 insertions(+), 41 deletions(-)
New commits: commit e98bc4bc82313f5ad86dfe4020c94fd7d7ea5343 Author: Noel Grandin <[email protected]> AuthorDate: Tue Sep 30 14:35:25 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Tue Sep 30 17:49:31 2025 +0200 flatten ViewObjectContactPrimitiveHit a little Change-Id: I09445931f0151b235b1081a2c2f29af602af42a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191665 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/svx/source/svdraw/sdrhittesthelper.cxx b/svx/source/svdraw/sdrhittesthelper.cxx index 9dc3b9118f07..72e41dbc2dc8 100644 --- a/svx/source/svdraw/sdrhittesthelper.cxx +++ b/svx/source/svdraw/sdrhittesthelper.cxx @@ -122,50 +122,50 @@ bool ViewObjectContactPrimitiveHit( { basegfx::B2DRange aObjectRange(rVOC.getObjectRange()); - if(!aObjectRange.isEmpty()) + if(aObjectRange.isEmpty()) + return false; + + // first do a rough B2DRange based HitTest; do not forget to + // include the HitTolerance if given + if(rLogicHitTolerance.getX() > 0 || rLogicHitTolerance.getY() > 0) { - // first do a rough B2DRange based HitTest; do not forget to - // include the HitTolerance if given - if(rLogicHitTolerance.getX() > 0 || rLogicHitTolerance.getY() > 0) - { - aObjectRange.grow(rLogicHitTolerance); - } + aObjectRange.grow(rLogicHitTolerance); + } - if(aObjectRange.isInside(rHitPosition)) - { - // get primitive sequence - sdr::contact::DisplayInfo aDisplayInfo; - // have to make a copy of this container here, because it might be changed underneath us - const drawinglayer::primitive2d::Primitive2DContainer aSequence(rVOC.getPrimitive2DSequence(aDisplayInfo)); + if(!aObjectRange.isInside(rHitPosition)) + return false; - if(!aSequence.empty()) - { - // create a HitTest processor - const drawinglayer::geometry::ViewInformation2D& rViewInformation2D = rVOC.GetObjectContact().getViewInformation2D(); - drawinglayer::processor2d::HitTestProcessor2D aHitTestProcessor2D( - rViewInformation2D, - rHitPosition, - rLogicHitTolerance, - bTextOnly); - - // ask for HitStack - aHitTestProcessor2D.collectHitStack(pHitContainer != nullptr); - - // feed it with the primitives - aHitTestProcessor2D.process(aSequence); - - // deliver result - if (aHitTestProcessor2D.getHit()) - { - if (pHitContainer) - { - // fetch HitStack primitives if requested - *pHitContainer = aHitTestProcessor2D.getHitStack(); - } + // get primitive sequence + sdr::contact::DisplayInfo aDisplayInfo; + // have to make a copy of this container here, because it might be changed underneath us + const drawinglayer::primitive2d::Primitive2DContainer aSequence(rVOC.getPrimitive2DSequence(aDisplayInfo)); - return true; - } + if(!aSequence.empty()) + { + // create a HitTest processor + const drawinglayer::geometry::ViewInformation2D& rViewInformation2D = rVOC.GetObjectContact().getViewInformation2D(); + drawinglayer::processor2d::HitTestProcessor2D aHitTestProcessor2D( + rViewInformation2D, + rHitPosition, + rLogicHitTolerance, + bTextOnly); + + // ask for HitStack + aHitTestProcessor2D.collectHitStack(pHitContainer != nullptr); + + // feed it with the primitives + aHitTestProcessor2D.process(aSequence); + + // deliver result + if (aHitTestProcessor2D.getHit()) + { + if (pHitContainer) + { + // fetch HitStack primitives if requested + *pHitContainer = aHitTestProcessor2D.getHitStack(); } + + return true; } } commit bfc171e2704c77464d36379db866aa738a97f8c3 Author: Noel Grandin <[email protected]> AuthorDate: Thu Sep 25 09:45:57 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Tue Sep 30 17:49:21 2025 +0200 remove unnecessary cast Change-Id: I9fdd1329529ee9120c246c25ca0b0498b23dfc89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191664 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 32d98128983b..1fe08f8ac50e 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -601,8 +601,8 @@ void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver ) case SdrObjKind::CustomShape : { - const SfxPoolItem& aCustomShape = static_cast<SdrObjCustomShape*>(pO)->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ); - SdrCustomShapeGeometryItem aGeometryItem( static_cast<const SdrCustomShapeGeometryItem&>(aCustomShape) ); + const SdrCustomShapeGeometryItem& rInitialGeometryItem = static_cast<SdrObjCustomShape*>(pO)->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ); + SdrCustomShapeGeometryItem aGeometryItem( rInitialGeometryItem ); static constexpr OUString sPath( u"Path"_ustr ); sal_Int16 nGluePointType = EnhancedCustomShapeGluePointType::SEGMENTS; css::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sPath, u"GluePointType"_ustr );
