[Libreoffice-commits] core.git: sw/source

Justin Luth justin_luth at sil.org
Thu Nov 10 14:25:05 UTC 2016


 sw/source/uibase/docvw/edtwin.cxx |   17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

New commits:
commit 70f41634d085aecc8e90dfba034bb367341d142e
Author: Justin Luth <justin_luth at sil.org>
Date:   Tue Nov 8 11:33:02 2016 +0300

    tdf#67379 - sw: treat clicking h/f-fly the same as any other
    
    Why should clicking on a frame/image in a header act any differently from
    a one insde the text body?
    
    (The only time frames (or any kind of fly) required a double click occured
    when switching from inside a header to a body-fly or from inside the body
    to a h/f-fly. This patch removes that oddball corner-case.)
    
    Now all frames are handled with a single click and there will not be
    an impact on double-clicking anymore.
    
    regression caused by 7e2f98d0a0c4a0f36a94353a256e7cc5caa3113b and its
    prior commit which say:
    > Header/Footer: fixed click on frames over the header/footer area.
    > The main problem here was due to the click to show the separator when
    > there is no header or footer under the frame. That code was just exiting
    > MouseButtonDown too early, which isn't good.
    
    > Now, double-click actually selects a frame anchored in header/footer.
    
    confirmed that single-clicking on frames over the header/footer section
    still shows the header blue-line.
    Change-Id: I4770cfe7898202929742743931e22de8bf233b03
    Reviewed-on: https://gerrit.libreoffice.org/30693
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 5b45030..68b2c69 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -2855,7 +2855,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
 
     const Point aDocPos( PixelToLogic( rMEvt.GetPosPixel() ) );
 
-    // How many clicks do we need to select a fly frame?
     FrameControlType eControl;
     bool bOverFly = false;
     bool bPageAnchored = false;
@@ -2866,16 +2865,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
         // We have a field here, that should have priority over header/footer fly.
         bOverHeaderFooterFly = false;
 
-    int nNbFlyClicks = 1;
-    // !bOverHeaderFooterFly doesn't mean we have a frame to select
-    if ( !bPageAnchored && ( ( rSh.IsHeaderFooterEdit( ) && !bOverHeaderFooterFly && bOverFly ) ||
-         ( !rSh.IsHeaderFooterEdit( ) && bOverHeaderFooterFly ) ) )
-    {
-        nNbFlyClicks = 2;
-        if ( _rMEvt.GetClicks( ) < nNbFlyClicks )
-            return;
-    }
-
     // Are we clicking on a blank header/footer area?
     if ( IsInHeaderFooter( aDocPos, eControl ) || bOverHeaderFooterFly )
     {
@@ -3211,10 +3200,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
                     }
                 }
 
-                bool bHandledFlyClick = false;
-                if (!bExecDrawTextLink && nNumberOfClicks == nNbFlyClicks)
+                if (1 == nNumberOfClicks && !bExecDrawTextLink)
                 {
-                    bHandledFlyClick = true;
                     // only try to select frame, if pointer already was
                     // switched accordingly
                     if ( m_aActHitType != SdrHitKind::NONE && !rSh.IsSelFrameMode() &&
@@ -3339,7 +3326,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
                     case 2:
                     {
                         g_bFrameDrag = false;
-                        if ( !bHandledFlyClick && !bIsDocReadOnly && rSh.IsInsideSelectedObj(aDocPos) &&
+                        if ( !bIsDocReadOnly && rSh.IsInsideSelectedObj(aDocPos) &&
                              FlyProtectFlags::NONE == rSh.IsSelObjProtected( FlyProtectFlags::Content|FlyProtectFlags::Parent ) )
                         {
                         /* This is no good: on the one hand GetSelectionType is used as flag field


More information about the Libreoffice-commits mailing list