svx/source/customshapes/EnhancedCustomShapeEngine.cxx | 2 - svx/source/svdraw/svdoashp.cxx | 32 +++++++++++------- 2 files changed, 21 insertions(+), 13 deletions(-)
New commits: commit b166202fc0dc50c3e612a425482c60d98219c95d Author: Mike Kaganski <[email protected]> AuthorDate: Wed Jan 28 07:05:11 2026 +0100 Commit: Mike Kaganski <[email protected]> CommitDate: Thu Jan 29 15:59:08 2026 +0100 Use non-broadcasting calls in SdrObjCustomShape::TRSetBaseGeometry Make it only one BroadcastObjectChange and SendUserCall. InvalidateRenderGeometry, SetBoundAndSnapRectsDirty, and SetChanged are already called in Nbc* methods (e.g., NbcSetLogicRect). Change-Id: Iad4c19540bc9e81d3af402f6dabef04fd54381fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198251 Reviewed-by: Mike Kaganski <[email protected]> Tested-by: Jenkins (cherry picked from commit 24e4e3e8b8af1410cffe40c29b0f864828e49b2a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198360 Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 4c4b94abfe26..0c877f8a4e76 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -2970,6 +2970,10 @@ void SdrObjCustomShape::AdjustToMaxRect(const tools::Rectangle& rMaxRect, bool b void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& /*rPolyPolygon*/) { + tools::Rectangle aBoundRect0; + if (m_pUserCall != nullptr) + aBoundRect0 = GetLastBoundRect(); + // The shape might have already flipping in its enhanced geometry. LibreOffice applies // such after all transformations. We remove it, but remember it to apply them later. bool bIsMirroredX = IsMirroredX(); @@ -2979,11 +2983,11 @@ void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, Point aCurrentCenter = GetSnapRect().Center(); if (bIsMirroredX) // mirror on the y-axis { - Mirror(aCurrentCenter, Point(aCurrentCenter.X(), aCurrentCenter.Y() + 1000)); + NbcMirror(aCurrentCenter, Point(aCurrentCenter.X(), aCurrentCenter.Y() + 1000)); } if (bIsMirroredY) // mirror on the x-axis { - Mirror(aCurrentCenter, Point(aCurrentCenter.X() + 1000, aCurrentCenter.Y())); + NbcMirror(aCurrentCenter, Point(aCurrentCenter.X() + 1000, aCurrentCenter.Y())); } } @@ -3016,13 +3020,13 @@ void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, if( !aSize.Height() ) aSize.setHeight( 1 ); if( !aSize.Width() ) aSize.setWidth( 1 ); tools::Rectangle aBaseRect(Point(), aSize); - SetLogicRect(aBaseRect); + NbcSetLogicRect(aBaseRect); // Apply flipping from Matrix, which is a transformation relative to origin if (aScale.getX() < 0.0) - Mirror(Point(0, 0), Point(0, 1000)); // mirror on the y-axis + NbcMirror(Point(0, 0), Point(0, 1000)); // mirror on the y-axis if (aScale.getY() < 0.0) - Mirror(Point(0, 0), Point(1000, 0)); // mirror on the x-axis + NbcMirror(Point(0, 0), Point(1000, 0)); // mirror on the x-axis // shear? if(!basegfx::fTools::equalZero(fShearX)) @@ -3033,7 +3037,7 @@ void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, // back the mirroring of the shear angle aGeoStat.m_nShearAngle = Degree100(basegfx::fround(basegfx::rad2deg<100>(atan(fShearX)))); aGeoStat.RecalcTan(); - Shear(Point(), aGeoStat.m_nShearAngle, aGeoStat.mfTanShearAngle, false); + NbcShear(Point(), aGeoStat.m_nShearAngle, aGeoStat.mfTanShearAngle, false); } // rotation? @@ -3046,14 +3050,15 @@ void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, // mirrored -> mirror value here aGeoStat.m_nRotationAngle = NormAngle36000(Degree100(basegfx::fround(-basegfx::rad2deg<100>(fRotate)))); aGeoStat.RecalcSinCos(); - Rotate(Point(), aGeoStat.m_nRotationAngle, aGeoStat.mfSinRotationAngle, aGeoStat.mfCosRotationAngle); + NbcRotate(Point(), aGeoStat.m_nRotationAngle, aGeoStat.mfSinRotationAngle, aGeoStat.mfCosRotationAngle); } // translate? - if(!aTranslate.equalZero()) + if (Size move(basegfx::fround<tools::Long>(aTranslate.getX()), + basegfx::fround<tools::Long>(aTranslate.getY())); + move.Width() || move.Height()) { - Move(Size(basegfx::fround<tools::Long>(aTranslate.getX()), - basegfx::fround<tools::Long>(aTranslate.getY()))); + NbcMove(move); } // Apply flipping from enhanced geometry at center of the shape. @@ -3074,11 +3079,14 @@ void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, double fCenterX = aCenter.getX(); double fCenterY = aCenter.getY(); if (bIsMirroredX) // vertical axis - Mirror(Point(basegfx::fround<tools::Long>(fCenterX), basegfx::fround<tools::Long>(fCenterY)), + NbcMirror(Point(basegfx::fround<tools::Long>(fCenterX), basegfx::fround<tools::Long>(fCenterY)), Point(basegfx::fround<tools::Long>(fCenterX), basegfx::fround<tools::Long>(fCenterY + 1000.0))); if (bIsMirroredY) // horizontal axis - Mirror(Point(basegfx::fround<tools::Long>(fCenterX), basegfx::fround<tools::Long>(fCenterY)), + NbcMirror(Point(basegfx::fround<tools::Long>(fCenterX), basegfx::fround<tools::Long>(fCenterY)), Point(basegfx::fround<tools::Long>(fCenterX + 1000.0), basegfx::fround<tools::Long>(fCenterY))); + + BroadcastObjectChange(); + SendUserCall(SdrUserCallType::Resize, aBoundRect0); } // taking fObjectRotation instead of aGeo.nAngle commit 31b1b573b92c5b80980a5f424f413c968de3f80a Author: Mike Kaganski <[email protected]> AuthorDate: Wed Jan 28 06:32:10 2026 +0100 Commit: Mike Kaganski <[email protected]> CommitDate: Thu Jan 29 15:58:58 2026 +0100 Use NbcShear in EnhancedCustomShapeEngine::render2 Other calls on this object are already non-broadcasting. Change-Id: I767ac914dd3373fd0709135ebd24bc12c8bb3eb3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198248 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit f141da6997f55b0934edb7547c169067817904ad) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198359 Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx index 1f90674434cf..770305d0fd25 100644 --- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx @@ -280,7 +280,7 @@ rtl::Reference<SdrObject> EnhancedCustomShapeEngine::render2() const nTan = -nTan; } - xRenderedShape->Shear(mpCustomShape->GetSnapRect().Center(), nShearAngle, nTan, false); + xRenderedShape->NbcShear(mpCustomShape->GetSnapRect().Center(), nShearAngle, nTan, false); } if(nRotateAngle ) xRenderedShape->NbcRotate(mpCustomShape->GetSnapRect().Center(), nRotateAngle);
