sw/source/uibase/uno/unotxvw.cxx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
New commits: commit b39c91cf5a2c21924f8ac780dadab75a6a2a0713 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Nov 28 15:46:14 2018 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Nov 28 20:48:34 2018 +0100 tdf#112696 if we select every member of a group, select the group itself Change-Id: I1b540772ff3a04c2cb32135c972f3a745c307eb9 Reviewed-on: https://gerrit.libreoffice.org/64180 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx index 1a9b9b116a0e..204f8ed45447 100644 --- a/sw/source/uibase/uno/unotxvw.cxx +++ b/sw/source/uibase/uno/unotxvw.cxx @@ -312,6 +312,33 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) bRet = true; } } + + // tdf#112696 if we selected every individual element of a group, then + // select that group instead + const SdrMarkList &rMrkList = pDrawView->GetMarkedObjectList(); + size_t nMarkCount = rMrkList.GetMarkCount(); + if (nMarkCount > 1) + { + SdrObject* pObject = rMrkList.GetMark(0)->GetMarkedSdrObj(); + SdrObject* pGroupParent = pObject->getParentSdrObjectFromSdrObject(); + for (size_t i = 1; i < nMarkCount; ++i) + { + pObject = rMrkList.GetMark(i)->GetMarkedSdrObj(); + SdrObject* pParent = pObject->getParentSdrObjectFromSdrObject(); + if (pParent != pGroupParent) + { + pGroupParent = nullptr; + break; + } + } + + if (pGroupParent && pGroupParent->IsGroupObject() && + pGroupParent->getChildrenOfSdrObject()->GetObjCount() == nMarkCount) + { + pDrawView->UnmarkAll(); + pDrawView->MarkObj(pGroupParent, pPV); + } + } } return bRet; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits