offapi/com/sun/star/drawing/XShapeGroup.idl | 2 -- svx/source/unodraw/unoshap2.cxx | 25 +++++++++++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-)
New commits: commit a070a0fb11e895a3e06c336326befd4883f9b797 Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Mon Nov 24 08:45:33 2025 +0100 Commit: Stephan Bergmann <[email protected]> CommitDate: Thu Dec 4 09:23:20 2025 +0100 Implement XShapeGroup::enterGroup and ::leaveGroup has been a TODO item since initial import Also un-deprecate the XShapeGroup interface. There was no rationale given why it was deprecated and it seems the functionality is not available elsewhere. Change-Id: I8fd54d3732fd0ec1c54a2d1b2874e958a77b011e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194409 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <[email protected]> (cherry picked from commit c085b0bdf35a6e9a7f5e3fe94bf3f7f5204648dc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194865 Reviewed-by: Stephan Bergmann <[email protected]> diff --git a/offapi/com/sun/star/drawing/XShapeGroup.idl b/offapi/com/sun/star/drawing/XShapeGroup.idl index b643a0ff8ef7..d0552ec45f7c 100644 --- a/offapi/com/sun/star/drawing/XShapeGroup.idl +++ b/offapi/com/sun/star/drawing/XShapeGroup.idl @@ -24,8 +24,6 @@ /** is implemented by Shapes that contain other Shapes. - - @deprecated */ published interface XShapeGroup: com::sun::star::drawing::XShape { diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index 668a76c05b52..ae6971943b5d 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -153,18 +153,27 @@ void SAL_CALL SvxShapeGroup::setSize( const awt::Size& rSize ) // drawing::XShapeGroup - -void SAL_CALL SvxShapeGroup::enterGroup( ) +void SAL_CALL SvxShapeGroup::enterGroup() { - // Todo -// pDrView->EnterMarkedGroup(); -} + SdrObject* pSdrShape = GetSdrObject(); + if (!pSdrShape) + return; + SdrViewIter::ForAllViews(pSdrShape, [&pSdrShape](SdrView* pView) { + if (pView->GetMarkedObjectList().FindObject(pSdrShape) != SAL_MAX_SIZE) + { + pView->EnterMarkedGroup(); + } + }); +} -void SAL_CALL SvxShapeGroup::leaveGroup( ) +void SAL_CALL SvxShapeGroup::leaveGroup() { - // Todo -// pDrView->LeaveOneGroup(); + SdrObject* pSdrShape = GetSdrObject(); + if (!pSdrShape) + return; + + SdrViewIter::ForAllViews(pSdrShape, [](SdrView* pView) { pView->LeaveOneGroup(); }); } void SvxShapeGroup::addUnoShape( const uno::Reference< drawing::XShape >& xShape, size_t nPos )
