Kaydet (Commit) 5284e44e authored tarafından Michael Stahl's avatar Michael Stahl

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 7e2f98d0
 and commit 5ed14025)

Change-Id: Ib1504baff5d1fffd6ce53b41d3ff726d8e4d5c9d
üst 7ba99c5b
...@@ -3167,8 +3167,27 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) ...@@ -3167,8 +3167,27 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
case MOUSE_LEFT + KEY_MOD2: 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; bool bHandledFlyClick = false;
if ( nNumberOfClicks == nNbFlyClicks ) if (!bExecDrawTextLink && nNumberOfClicks == nNbFlyClicks)
{ {
bHandledFlyClick = true; bHandledFlyClick = true;
// only try to select frame, if pointer already was // only try to select frame, if pointer already was
...@@ -3291,22 +3310,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) ...@@ -3291,22 +3310,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
switch ( nNumberOfClicks ) switch ( nNumberOfClicks )
{ {
case 1: 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; break;
}
case 2: case 2:
{ {
bFrmDrag = false; bFrmDrag = false;
...@@ -3684,7 +3688,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) ...@@ -3684,7 +3688,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
MoveCursor( rSh, aDocPos, bOnlyText, bLockView ); MoveCursor( rSh, aDocPos, bOnlyText, bLockView );
bCallBase = false; bCallBase = false;
} }
if ( !bOverURLGrf && !bOnlyText ) if (!bOverURLGrf && !bExecDrawTextLink && !bOnlyText)
{ {
const int nSelType = rSh.GetSelectionType(); const int nSelType = rSh.GetSelectionType();
// Check in general, if an object is selectable at given position. // Check in general, if an object is selectable at given position.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment