summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-03 15:53:00 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-07-03 16:17:22 +0100
commitabbe4f9d64073d77c4be93b7c89c03d0651bacef (patch)
tree62412baed3e7000f830ffc25faecf40d91e2b7fd /svx
parent2a583603dec40090289ddb5b4b70d800794cf57b (diff)
fix deselect of textbox on slides with images in underlying master
The original work of tdf#55430 tries to select an object under another one on the second click, but these images are unselectable so this fails. Red Hat has a whole new shiny bunch of templates which have such images in their masters. Check if the object is selectable before continuing Change-Id: I182abaf50e8bb1084c5819dc9e1ffd8b386a9e93
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdmrkv.cxx51
1 files changed, 28 insertions, 23 deletions
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index f58f88bb86f3..d281507bba1b 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -1226,6 +1226,33 @@ void SdrMarkView::SetRef2(const Point& rPt)
}
}
+bool SdrPageView::IsObjSelectable(SdrObject *pObj) const
+{
+ SdrLayerID nLay=pObj->GetLayer();
+ bool bRaus=!pObj->IsInserted(); // Obj deleted?
+ if (!pObj->Is3DObj()) {
+ bRaus=bRaus || pObj->GetPage()!=GetPage(); // Obj suddenly in different Page or Group
+ }
+ bRaus=bRaus || GetLockedLayers().IsSet(nLay) || // Layer locked?
+ !GetVisibleLayers().IsSet(nLay); // Layer invisible?
+
+ if( !bRaus )
+ bRaus = !pObj->IsVisible(); // invisible objects can not be selected
+
+ if (!bRaus) {
+ // Grouped objects can now be selected.
+ // After EnterGroup the higher-level objects,
+ // have to be deselected, though.
+ const SdrObjList* pOOL=pObj->GetObjList();
+ const SdrObjList* pVOL=GetObjList();
+ while (pOOL!=NULL && pOOL!=pVOL) {
+ pOOL=pOOL->GetUpList();
+ }
+ bRaus=pOOL!=pVOL;
+ }
+ return !bRaus;
+}
+
void SdrMarkView::CheckMarked()
{
for (size_t nm=GetMarkedObjectCount(); nm>0;) {
@@ -1233,29 +1260,7 @@ void SdrMarkView::CheckMarked()
SdrMark* pM=GetSdrMarkByIndex(nm);
SdrObject* pObj=pM->GetMarkedSdrObj();
SdrPageView* pPV=pM->GetPageView();
- SdrLayerID nLay=pObj->GetLayer();
- bool bRaus=!pObj->IsInserted(); // Obj deleted?
- if (!pObj->Is3DObj()) {
- bRaus=bRaus || pObj->GetPage()!=pPV->GetPage(); // Obj suddenly in different Page or Group
- }
- bRaus=bRaus || pPV->GetLockedLayers().IsSet(nLay) || // Layer locked?
- !pPV->GetVisibleLayers().IsSet(nLay); // Layer invisible?
-
- if( !bRaus )
- bRaus = !pObj->IsVisible(); // invisible objects can not be selected
-
- if (!bRaus) {
- // Grouped objects can now be selected.
- // After EnterGroup the higher-level objects,
- // have to be deselected, though.
- const SdrObjList* pOOL=pObj->GetObjList();
- const SdrObjList* pVOL=pPV->GetObjList();
- while (pOOL!=NULL && pOOL!=pVOL) {
- pOOL=pOOL->GetUpList();
- }
- bRaus=pOOL!=pVOL;
- }
-
+ bool bRaus=!pPV->IsObjSelectable(pObj);
if (bRaus)
{
GetMarkedObjectListWriteAccess().DeleteMark(nm);