summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-10-06 23:37:18 +0200
committerCaolán McNamara <caolanm@redhat.com>2014-10-08 15:21:57 +0000
commitfd41d725b596968e04fc4788a4481d7dc7e488df (patch)
tree72f4d280ec3dfbe92810d7431b0a512d4dede775
parentebccd2dc8092ff873affceb1f17c0c11e0ad9e2b (diff)
fdo#79604: sw: fix clicking on hyper-links in Draw objects
The URL is dispatched in MouseButtonUp(), but this relies on MouseButtonDown() not selecting the drawing object when the cursor is over an URL field. (probably regression from commit 7e2f98d0a0c4a0f36a94353a256e7cc5caa3113b and commit 5ed14025645200c77249da364870f5772c01df17) Change-Id: Ib1504baff5d1fffd6ce53b41d3ff726d8e4d5c9d (cherry picked from commit 5284e44ed0594a79b0cc22090a9a82b19962f6c2) Reviewed-on: https://gerrit.libreoffice.org/11834 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/uibase/docvw/edtwin.cxx38
1 files changed, 21 insertions, 17 deletions
diff --git a/sw/source/core/uibase/docvw/edtwin.cxx b/sw/source/core/uibase/docvw/edtwin.cxx
index d4294af0d7db..e35b68877058 100644
--- a/sw/source/core/uibase/docvw/edtwin.cxx
+++ b/sw/source/core/uibase/docvw/edtwin.cxx
@@ -3114,8 +3114,27 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
case MOUSE_LEFT + KEY_MOD2:
{
+ // fdo#79604: first, check if a link has been clicked - do not
+ // select fly in this case!
+ if (1 == nNumberOfClicks)
+ {
+ UpdatePointer( aDocPos, rMEvt.GetModifier() );
+ SwEditWin::m_nDDStartPosY = aDocPos.Y();
+ SwEditWin::m_nDDStartPosX = aDocPos.X();
+
+ // hit an URL in DrawText object?
+ if (bExecHyperlinks && pSdrView)
+ {
+ SdrViewEvent aVEvt;
+ pSdrView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+
+ if (aVEvt.eEvent == SDREVENT_EXECUTEURL)
+ bExecDrawTextLink = true;
+ }
+ }
+
bool bHandledFlyClick = false;
- if ( nNumberOfClicks == nNbFlyClicks )
+ if (!bExecDrawTextLink && nNumberOfClicks == nNbFlyClicks)
{
bHandledFlyClick = true;
// only try to select frame, if pointer already was
@@ -3238,22 +3257,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
switch ( nNumberOfClicks )
{
case 1:
- {
- UpdatePointer( aDocPos, rMEvt.GetModifier() );
- SwEditWin::m_nDDStartPosY = aDocPos.Y();
- SwEditWin::m_nDDStartPosX = aDocPos.X();
-
- // hit an URL in DrawText object?
- if (bExecHyperlinks && pSdrView)
- {
- SdrViewEvent aVEvt;
- pSdrView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
-
- if (aVEvt.eEvent == SDREVENT_EXECUTEURL)
- bExecDrawTextLink = true;
- }
break;
- }
case 2:
{
bFrmDrag = false;
@@ -3650,7 +3654,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
bNoInterrupt = bTmpNoInterrupt;
}
- if ( !bOverURLGrf && !bOnlyText )
+ if (!bOverURLGrf && !bExecDrawTextLink && !bOnlyText)
{
const int nSelType = rSh.GetSelectionType();
// Check in general, if an object is selectable at given position.