[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Nov 28 19:48:59 UTC 2018
sw/source/uibase/uno/unotxvw.cxx | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
New commits:
commit b39c91cf5a2c21924f8ac780dadab75a6a2a0713
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Nov 28 15:46:14 2018 +0000
Commit: Caolán McNamara <caolanm at 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 <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at 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;
}
More information about the Libreoffice-commits
mailing list