tdf#122442: use Timer to detect single-clicks vs double-clicks
Regression from commit 821ae0fb9fa63e0171f987d5ec210ec121978b8f which
appeared after commits changing scheduler/main loop in the range
e6e8a060ecc6e4fd51cfe88e00d841d546ed5915..9b4abcd1c45a646a1ac9120fe1c489ba6bb44e95
Change-Id: I6cf58c1e83aa9621bdd4b5c14f8565d5c69e20c1
Reviewed-on: https://gerrit.libreoffice.org/65837
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 6207c51880c9165eedb1d1af7fdc5e179bc8844d)
Reviewed-on: https://gerrit.libreoffice.org/65841
Reviewed-by: Xisco FaulĂ <xiscofauli@libreoffice.org>
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 1f1cb9a..2e9f77b 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -4757,12 +4757,12 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
rSh.EnterStdMode();
rSh.SetVisibleCursor(aDocPt);
bCallBase = false;
m_aTemplateIdle.Stop();
m_aTemplateTimer.Stop();
}
else if(rMEvt.GetClicks() == 1)
{
// no selection -> so turn off watering can
m_aTemplateIdle.Start();
m_aTemplateTimer.Start();
}
}
}
@@ -4998,9 +4998,9 @@ SwEditWin::SwEditWin(vcl::Window *pParent, SwView &rMyView):
m_aKeyInputFlushTimer.SetInvokeHandler(LINK(this, SwEditWin, KeyInputFlushHandler));
// TemplatePointer for colors should be resetted without
// selection after single click
m_aTemplateIdle.SetPriority(TaskPriority::LOWEST);
m_aTemplateIdle.SetInvokeHandler(LINK(this, SwEditWin, TemplateTimerHdl));
// selection after single click, but not after double-click (tdf#122442)
m_aTemplateTimer.SetTimeout(GetSettings().GetMouseSettings().GetDoubleClickTime());
m_aTemplateTimer.SetInvokeHandler(LINK(this, SwEditWin, TemplateTimerHdl));
// temporary solution!!! Should set the font of the current
// insert position at every cursor movement!
diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx
index b8f473f3..0f63aa2 100644
--- a/sw/source/uibase/inc/edtwin.hxx
+++ b/sw/source/uibase/inc/edtwin.hxx
@@ -81,7 +81,7 @@ class SwEditWin final : public vcl::Window,
Point m_aStartPos;
Point m_aMovePos;
Point m_aRszMvHdlPt;
Idle m_aTemplateIdle;
Timer m_aTemplateTimer;
// type/object where the mouse pointer is
SwCallMouseEvent m_aSaveCallEvent;