Kaydet (Commit) 85ea03ae authored tarafından Lennard's avatar Lennard Kaydeden (comit) Thorsten Behrens

fdo#55430 allow clicking objects in front of selected ones

Prevents that selected objects shadow selecting others in front of them.

Change-Id: Iee4abf4eddf79ef7ed331221b0a0b23d3370ae2b
Signed-off-by: 's avatarLennard <Wasserthal@nefkom.net>
Reviewed-on: https://gerrit.libreoffice.org/927Reviewed-by: 's avatarThorsten Behrens <tbehrens@suse.com>
Tested-by: 's avatarThorsten Behrens <tbehrens@suse.com>
üst 6f79b2e3
...@@ -642,6 +642,8 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) ...@@ -642,6 +642,8 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
// (and deselect others) as a preparation for showing the context // (and deselect others) as a preparation for showing the context
// menu. // menu.
const bool bSelectionOnly = rMEvt.IsRight(); const bool bSelectionOnly = rMEvt.IsRight();
SdrObject* pObj;
SdrPageView* pPV;
if (bHideAndAnimate) if (bHideAndAnimate)
{ {
...@@ -693,6 +695,17 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) ...@@ -693,6 +695,17 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
Abs(aPnt.X() - aMDPos.X()) < nDrgLog && Abs(aPnt.X() - aMDPos.X()) < nDrgLog &&
Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog) Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog)
{ {
/*************************************************************
* If a user wants to click on an object in front of a masked
* one, he releases the mouse button immediately
**************************************************************/
if (mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER | SDRSEARCH_BEFOREMARK))
{
//not Needed in the ordinary pick routine for some reason...
mpView->UnmarkAllObj();
mpView->MarkObj(pObj,pPV,false,false);
return (bReturn);
}
/************************************************************** /**************************************************************
* Toggle between selection and rotation * Toggle between selection and rotation
**************************************************************/ **************************************************************/
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#define SDRSEARCH_MARKED 0x0400 /* Nur markierte Objekte/Punkte/... */ #define SDRSEARCH_MARKED 0x0400 /* Nur markierte Objekte/Punkte/... */
#define SDRSEARCH_PASS2BOUND 0x0800 /* Wenn nix gefunden, dann neuer 2. Versuch mit BoundRectHit */ #define SDRSEARCH_PASS2BOUND 0x0800 /* Wenn nix gefunden, dann neuer 2. Versuch mit BoundRectHit */
#define SDRSEARCH_PASS3NEAREST 0x1000 /* Wenn nix gefunden, dann neuer 3. Versuch mit NearestBoundRectHit */ #define SDRSEARCH_PASS3NEAREST 0x1000 /* Wenn nix gefunden, dann neuer 3. Versuch mit NearestBoundRectHit */
#define SDRSEARCH_BEFOREMARK 0x2000 /* if one marked one found, ignore all behind that */
#define SDRSEARCH_PICKMARKABLE (SDRSEARCH_TESTMARKABLE) #define SDRSEARCH_PICKMARKABLE (SDRSEARCH_TESTMARKABLE)
#define SDRSEARCH_PICKTEXTEDIT (SDRSEARCH_DEEP|SDRSEARCH_TESTMARKABLE|SDRSEARCH_TESTTEXTEDIT) #define SDRSEARCH_PICKTEXTEDIT (SDRSEARCH_DEEP|SDRSEARCH_TESTMARKABLE|SDRSEARCH_TESTTEXTEDIT)
...@@ -181,6 +182,7 @@ protected: ...@@ -181,6 +182,7 @@ protected:
//HMHvoid ImpShowMarkHdl(bool bNoRefHdl); //HMHvoid ImpShowMarkHdl(bool bNoRefHdl);
virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, sal_uIntPtr nOptions, const SetOfByte* pMVisLay) const; virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, sal_uIntPtr nOptions, const SetOfByte* pMVisLay) const;
virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, sal_uIntPtr nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const; virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, sal_uIntPtr nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const;
virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, sal_uIntPtr nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj,const SdrMarkList * pMarkList) const;
sal_Bool ImpIsFrameHandles() const; sal_Bool ImpIsFrameHandles() const;
void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, String& rStr, sal_uInt16 nVal=0, sal_uInt16 nOpt=0) const; void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, String& rStr, sal_uInt16 nVal=0, sal_uInt16 nOpt=0) const;
......
...@@ -1572,8 +1572,13 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nT ...@@ -1572,8 +1572,13 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nT
} }
SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, sal_uIntPtr nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, sal_uIntPtr nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const
{
return (*this).CheckSingleSdrObjectHit(rPnt,nTol,pOL,pPV,nOptions,pMVisLay,rpRootObj,NULL);
}
SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, sal_uIntPtr nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj,const SdrMarkList * pMarkList) const
{ {
sal_Bool bBack=(nOptions & SDRSEARCH_BACKWARD)!=0; sal_Bool bBack=(nOptions & SDRSEARCH_BACKWARD)!=0;
sal_Bool bBefMrk=(nOptions & SDRSEARCH_BEFOREMARK)!=0;
SdrObject* pRet=NULL; SdrObject* pRet=NULL;
rpRootObj=NULL; rpRootObj=NULL;
if (pOL!=NULL) if (pOL!=NULL)
...@@ -1595,7 +1600,16 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nT ...@@ -1595,7 +1600,16 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nT
{ {
pObj = pOL->GetObj(nObjNum); pObj = pOL->GetObj(nObjNum);
} }
if (bBefMrk)
{
if ((pMarkList)!=NULL)
{
if ((*pMarkList).FindObject(pObj)!=CONTAINER_ENTRY_NOTFOUND)
{
return NULL;
}
}
}
pRet=CheckSingleSdrObjectHit(rPnt,nTol,pObj,pPV,nOptions,pMVisLay); pRet=CheckSingleSdrObjectHit(rPnt,nTol,pObj,pPV,nOptions,pMVisLay);
if (pRet!=NULL) rpRootObj=pObj; if (pRet!=NULL) rpRootObj=pObj;
if (bBack) nObjNum++; if (bBack) nObjNum++;
...@@ -1689,7 +1703,7 @@ sal_Bool SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, ...@@ -1689,7 +1703,7 @@ sal_Bool SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj,
if (pnPassNum!=NULL) *pnPassNum|=SDRSEARCHPASS_MASTERPAGE; if (pnPassNum!=NULL) *pnPassNum|=SDRSEARCHPASS_MASTERPAGE;
nTmpOptions=nTmpOptions | SDRSEARCH_IMPISMASTER; nTmpOptions=nTmpOptions | SDRSEARCH_IMPISMASTER;
} }
pHitObj=CheckSingleSdrObjectHit(aPt,nTol,pObjList,pPV,nTmpOptions,pMVisLay,pObj); pHitObj=CheckSingleSdrObjectHit(aPt,nTol,pObjList,pPV,nTmpOptions,pMVisLay,pObj,&(GetMarkedObjectList()));
if (bBack) nPgNum++; if (bBack) nPgNum++;
} }
} }
...@@ -1796,6 +1810,7 @@ sal_Bool SdrMarkView::PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPag ...@@ -1796,6 +1810,7 @@ sal_Bool SdrMarkView::PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPag
return bFnd; return bFnd;
} }
void SdrMarkView::UnmarkAllObj(SdrPageView* pPV) void SdrMarkView::UnmarkAllObj(SdrPageView* pPV)
{ {
if (GetMarkedObjectCount()!=0) { if (GetMarkedObjectCount()!=0) {
......
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