[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

Lennard Wasserthal Wasserthal at nefkom.net
Fri Apr 11 05:20:16 PDT 2014


 sw/source/ui/docvw/edtwin.cxx |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

New commits:
commit c7cec7bb9ea7ef0aaa18a5c39eca13c446f974c5
Author: Lennard Wasserthal <Wasserthal at nefkom.net>
Date:   Sat Apr 5 11:55:24 2014 +0200

    fdo#69157 Apply object-in front selection on mouseUp
    
    Before, all selection was recklessly replaced when you clicked something
    else than a scaling handle (or the like).
    It caused bug 69157.
    
    But now, you can still drag the frame by gripping the interior one.
    Btw, that the timer did not correctly start was because of the return
    statement in the prior state.
    
    Change-Id: I5e02cfb2d5fe9cdb9fd7f50d0c961dcc418fadd6
    Signed-off-by: Lennard Wasserthal <Wasserthal at nefkom.net>
    Signed-off-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 351ab7b879a1e5bf879600bf47909181029a4d11)
    Reviewed-on: https://gerrit.libreoffice.org/8907
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 3dd87c0..cd838c0 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -2618,8 +2618,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
 {
     SwWrtShell &rSh = m_rView.GetWrtShell();
 
-    SdrObject* pObj;
-    SdrPageView* pPV;
     // We have to check if a context menu is shown and we have an UI
     // active inplace client. In that case we have to ignore the mouse
     // button down event. Otherwise we would crash (context menu has been
@@ -2936,12 +2934,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
                                 // only if no position to size was hit.
                                 if (!bHitHandle)
                                 {
-                                    if (pSdrView->PickObj(aDocPos, pSdrView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER | SDRSEARCH_BEFOREMARK))
-                                    {
-                                        pSdrView->UnmarkAllObj();
-                                        pSdrView->MarkObj(pObj,pPV,false,false);
-                                        return;
-                                    }
                                     StartDDTimer();
                                     SwEditWin::m_nDDStartPosY = aDocPos.Y();
                                     SwEditWin::m_nDDStartPosX = aDocPos.X();
@@ -4029,6 +4021,8 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
  */
 void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
 {
+    SdrObject* pObj;
+    SdrPageView* pPV;
     bool bCallBase = true;
 
     sal_Bool bCallShadowCrsr = m_bWasShdwCrsr;
@@ -4080,6 +4074,15 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
             bFrmDrag = false;
         }
         bNoInterrupt = false;
+        const Point aDocPos( PixelToLogic( rMEvt.GetPosPixel() ) );
+        if ((PixelToLogic(m_aStartPos).Y() == (aDocPos.Y())) && (PixelToLogic(m_aStartPos).X() == (aDocPos.X())))//To make sure it was not moved
+        {
+            if (pSdrView->PickObj(aDocPos, pSdrView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER ))
+            {
+                pSdrView->UnmarkAllObj();
+                pSdrView->MarkObj(pObj,pPV,false,false);
+            }
+        }
         ReleaseMouse();
         return;
     }


More information about the Libreoffice-commits mailing list