diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-08-30 16:44:56 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-08-30 17:21:56 +0200 |
commit | 1223dd3bc84899d8f77c46340c46565ca74cbe1b (patch) | |
tree | aab3690eafaf8330d1d7b1d14d3f989694513363 | |
parent | 6ad86f8cc036d01702e9d491874b2b3bde23fe77 (diff) |
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
-rw-r--r-- | sw/inc/fesh.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/frmedt/feshview.cxx | 17 | ||||
-rw-r--r-- | sw/source/ui/docvw/edtwin.cxx | 5 |
3 files changed, 23 insertions, 1 deletions
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx index c5c75439fb4b..058f9127fac7 100644 --- a/sw/inc/fesh.hxx +++ b/sw/inc/fesh.hxx @@ -262,6 +262,8 @@ public: // The following two methods return enum SdrHdlKind. // Declared as int in order to spare including SVDRAW.HXX. 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 // Test if there is a draw object at that position and if it should be selected. diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index be852a900e1b..ccd1d00d75b1 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1113,6 +1113,23 @@ bool SwFEShell::IsObjSelectable( const Point& rPt ) 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. sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt) { diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 3fbc8c03c4a7..c496f0a59796 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -521,7 +521,10 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier ) (rSh.IsObjSelected() || rSh.IsFrmSelected()) && (!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; } } |