Kaydet (Commit) 1223dd3b authored tarafından Miklos Vajna's avatar Miklos Vajna

n#777337 SwEditWin::UpdatePointer: fix mouse pointer wrt. background images

When the image is in the background, just show the normal text cursor,
since we're able to select text as well in that situation.

Change-Id: I4b4303834245e402d40567cff4a2bf53a0a13e5e
üst 6ad86f8c
...@@ -262,6 +262,8 @@ public: ...@@ -262,6 +262,8 @@ public:
// The following two methods return enum SdrHdlKind. // The following two methods return enum SdrHdlKind.
// Declared as int in order to spare including SVDRAW.HXX. // Declared as int in order to spare including SVDRAW.HXX.
bool IsObjSelectable( const Point& rPt ); bool IsObjSelectable( const Point& rPt );
/// Same as IsObjSelectable(), but return the object as well.
SdrObject* GetObjAt(const Point& rPt);
int IsInsideSelectedObj( const Point& rPt ); //!! returns enum values int IsInsideSelectedObj( const Point& rPt ); //!! returns enum values
// Test if there is a draw object at that position and if it should be selected. // Test if there is a draw object at that position and if it should be selected.
......
...@@ -1113,6 +1113,23 @@ bool SwFEShell::IsObjSelectable( const Point& rPt ) ...@@ -1113,6 +1113,23 @@ bool SwFEShell::IsObjSelectable( const Point& rPt )
return bRet; return bRet;
} }
SdrObject* SwFEShell::GetObjAt( const Point& rPt )
{
SdrObject* pRet = 0;
SET_CURR_SHELL(this);
SwDrawView *pDView = Imp()->GetDrawView();
if( pDView )
{
SdrPageView* pPV;
sal_uInt16 nOld = pDView->GetHitTolerancePixel();
pDView->SetHitTolerancePixel( pDView->GetMarkHdlSizePixel()/2 );
pDView->PickObj( rPt, pDView->getHitTolLog(), pRet, pPV, SDRSEARCH_PICKMARKABLE );
pDView->SetHitTolerancePixel( nOld );
}
return pRet;
}
// Test if there is a object at that position and if it should be selected. // Test if there is a object at that position and if it should be selected.
sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt) sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt)
{ {
......
...@@ -521,7 +521,10 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier ) ...@@ -521,7 +521,10 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
(rSh.IsObjSelected() || rSh.IsFrmSelected()) && (rSh.IsObjSelected() || rSh.IsFrmSelected()) &&
(!rSh.IsSelObjProtected(FLYPROTECT_POS)); (!rSh.IsSelObjProtected(FLYPROTECT_POS));
eStyle = bMovable ? POINTER_MOVE : POINTER_ARROW; SdrObject* pSelectableObj = rSh.GetObjAt(rLPt);
// Don't update pointer if this is a background image only.
if (pSelectableObj->GetLayer() != rSh.GetDoc()->GetHellId())
eStyle = bMovable ? POINTER_MOVE : POINTER_ARROW;
aActHitType = SDRHIT_OBJECT; aActHitType = SDRHIT_OBJECT;
} }
} }
......
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