Kaydet (Commit) 1417638d authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Andras Timar

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
(cherry picked from commit abbe4f9d)
üst d7802365
......@@ -235,6 +235,11 @@ public:
// Beim Gruppenobjekt muss wenigstens ein Member sichtbar sein,
// gesperrt sein darf keiner.
bool IsObjMarkable(SdrObject* pObj) const;
// hmm, selectable is surely the same as markable, now that I
// see this as I look for a place to put it. TO-DO,
// merge these
bool IsObjSelectable(SdrObject *pObj) const;
// Betreten (Editieren) einer Objektgruppe. Anschliessend liegen alle
// Memberobjekte der Gruppe im direkten Zugriff. Alle anderen Objekte
......
......@@ -683,11 +683,14 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
* one, he releases the mouse button immediately
**************************************************************/
if (mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::BEFOREMARK))
{
if (pPV->IsObjSelectable(pObj))
{
mpView->UnmarkAllObj();
mpView->MarkObj(pObj,pPV,false,false);
return true;
}
}
/**************************************************************
* Toggle between selection and rotation
**************************************************************/
......
......@@ -655,6 +655,8 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
* From text mode, you don't want to rotate immediately.
**************************************************************/
if (mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::BEFOREMARK))
{
if (pPV->IsObjSelectable(pObj))
{
mpView->UnmarkAllObj();
mpView->MarkObj(pObj,pPV,false,false);
......@@ -662,6 +664,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
}
}
}
}
else if( mpView && mpView->IsCreateObj() && rMEvt.IsLeft())
{
// object was created
......
......@@ -1226,20 +1226,15 @@ void SdrMarkView::SetRef2(const Point& rPt)
}
}
void SdrMarkView::CheckMarked()
bool SdrPageView::IsObjSelectable(SdrObject *pObj) const
{
for (size_t nm=GetMarkedObjectCount(); nm>0;) {
--nm;
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 || pObj->GetPage()!=GetPage(); // Obj suddenly in different Page or Group
}
bRaus=bRaus || pPV->GetLockedLayers().IsSet(nLay) || // Layer locked?
!pPV->GetVisibleLayers().IsSet(nLay); // Layer invisible?
bRaus=bRaus || GetLockedLayers().IsSet(nLay) || // Layer locked?
!GetVisibleLayers().IsSet(nLay); // Layer invisible?
if( !bRaus )
bRaus = !pObj->IsVisible(); // invisible objects can not be selected
......@@ -1249,13 +1244,23 @@ void SdrMarkView::CheckMarked()
// After EnterGroup the higher-level objects,
// have to be deselected, though.
const SdrObjList* pOOL=pObj->GetObjList();
const SdrObjList* pVOL=pPV->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;) {
--nm;
SdrMark* pM=GetSdrMarkByIndex(nm);
SdrObject* pObj=pM->GetMarkedSdrObj();
SdrPageView* pPV=pM->GetPageView();
bool bRaus=!pPV->IsObjSelectable(pObj);
if (bRaus)
{
GetMarkedObjectListWriteAccess().DeleteMark(nm);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment