[Libreoffice-commits] .: sw/inc sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Aug 30 08:20:37 PDT 2012


 sw/inc/fesh.hxx                    |    2 ++
 sw/source/core/frmedt/feshview.cxx |   17 +++++++++++++++++
 sw/source/ui/docvw/edtwin.cxx      |    5 ++++-
 3 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 1223dd3bc84899d8f77c46340c46565ca74cbe1b
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Thu Aug 30 16:44:56 2012 +0200

    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

diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index c5c7543..058f912 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 be852a9..ccd1d00 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 3fbc8c0..c496f0a 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;
                         }
                     }


More information about the Libreoffice-commits mailing list