[Libreoffice-commits] core.git: 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 e0ac72a1b714adc8f2ed8a721a8c0c1894d183e2
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:48 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/64179
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