svx/inc/EnhancedCustomShapeEngine.hxx                 |    4 ++--
 svx/source/customshapes/EnhancedCustomShapeEngine.cxx |   11 +++--------
 2 files changed, 5 insertions(+), 10 deletions(-)

New commits:
commit 432930279b5d2791efadf5d602fb426c59d10a48
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Sep 26 10:45:19 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Fri Sep 26 13:10:17 2025 +0200

    simplify ImplForceGroupWithText
    
    we are already passing the required data via the
    rSdrObjCustomShape parameter.
    
    Change-Id: I66bdd73ac99f98bbf2ab8f9ac5d1390964683e55
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191527
    Reviewed-by: Noel Grandin <[email protected]>
    Tested-by: Jenkins

diff --git a/svx/inc/EnhancedCustomShapeEngine.hxx 
b/svx/inc/EnhancedCustomShapeEngine.hxx
index 9105057e2981..df240853ef45 100644
--- a/svx/inc/EnhancedCustomShapeEngine.hxx
+++ b/svx/inc/EnhancedCustomShapeEngine.hxx
@@ -29,8 +29,8 @@ class SVXCORE_DLLPUBLIC EnhancedCustomShapeEngine
     css::uno::Reference<css::drawing::XShape> mxShape;
     bool mbForceGroupWithText;
 
-    rtl::Reference<SdrObject> ImplForceGroupWithText(const SdrObjCustomShape& 
rSdrObjCustomShape,
-                                                     SdrObject* 
pRenderedShape);
+    static rtl::Reference<SdrObject> ImplForceGroupWithText(SdrObjCustomShape& 
rSdrObjCustomShape,
+                                                            SdrObject* 
pRenderedShape);
 
 public:
     EnhancedCustomShapeEngine(const css::uno::Sequence<css::uno::Any>& 
aArguments);
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx 
b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index eb1e1b5a7436..3793b2ce1066 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -105,7 +105,7 @@ Sequence< OUString > SAL_CALL 
EnhancedCustomShapeEngine::getSupportedServiceName
 
 // XCustomShapeEngine
 rtl::Reference<SdrObject> EnhancedCustomShapeEngine::ImplForceGroupWithText(
-    const SdrObjCustomShape& rSdrObjCustomShape,
+    SdrObjCustomShape& rSdrObjCustomShape,
     SdrObject* pRenderedShape1)
 {
     rtl::Reference<SdrObject> pRenderedShape = pRenderedShape1;
@@ -161,13 +161,8 @@ rtl::Reference<SdrObject> 
EnhancedCustomShapeEngine::ImplForceGroupWithText(
 
             // get the text bounds and set at text object
             tools::Rectangle aTextBounds(rSdrObjCustomShape.GetSnapRect());
-            auto pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* 
>(SdrObject::getSdrObjectFromXShape(mxShape));
-
-            if(pSdrObjCustomShape)
-            {
-                EnhancedCustomShape2d aCustomShape2d(*pSdrObjCustomShape);
-                aTextBounds = aCustomShape2d.GetTextRect();
-            }
+            EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape);
+            aTextBounds = aCustomShape2d.GetTextRect();
 
             pTextObj->SetSnapRect( aTextBounds );
 

Reply via email to