tdf#143657 'execute' button doesn't get enabled when contents changed
since...
commit 73c9ef661d9ef6237d3fd3c259fd040a545b44cf
Date: Tue Jul 6 18:51:38 2021 +0200
tdf#132740 don't broadcast if modified status has not changed
now we only get a notification on transition from unmodified to
modified. So continue to launch a timer on transition but clear
modification on firing so we will get notified on the next change
and move the modify callback to the timer.
modifications are no deferred until the timer fires, so reduce
the timer to make it smoother
Change-Id: I27980be54de20bb516b1f106c3ed1b303e2a4014
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119863
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx
index c53f684..18eac53 100644
--- a/dbaccess/source/ui/control/sqledit.cxx
+++ b/dbaccess/source/ui/control/sqledit.cxx
@@ -126,7 +126,7 @@ void SQLEditView::SetDrawingArea(weld::DrawingArea* pDrawingArea)
rEditEngine.SetDefaultHorizontalTextDirection(EEHorizontalTextDirection::L2R);
rEditEngine.SetModifyHdl(LINK(this, SQLEditView, ModifyHdl));
m_aUpdateDataTimer.SetTimeout(300);
m_aUpdateDataTimer.SetTimeout(150);
m_aUpdateDataTimer.SetInvokeHandler(LINK(this, SQLEditView, ImplUpdateDataHdl));
ImplSetFont();
@@ -170,8 +170,6 @@ IMPL_LINK_NOARG(SQLEditView, ModifyHdl, LinkParamNone*, void)
{
if (m_bInUpdate)
return;
m_aModifyLink.Call(nullptr);
m_aUpdateDataTimer.Start();
}
@@ -194,7 +192,6 @@ void SQLEditView::UpdateData()
rEditEngine.EnableUndo(false);
// syntax highlighting
bool bOrigModified = rEditEngine.IsModified();
for (sal_Int32 nLine=0; nLine < rEditEngine.GetParagraphCount(); ++nLine)
{
OUString aLine( rEditEngine.GetText( nLine ) );
@@ -214,12 +211,15 @@ void SQLEditView::UpdateData()
rEditEngine.QuickSetAttribs(aSet, ESelection(nLine, portion.nBegin, nLine, portion.nEnd));
}
}
if (!bOrigModified)
rEditEngine.ClearModifyFlag();
rEditEngine.ClearModifyFlag();
m_bInUpdate = false;
rEditEngine.EnableUndo(bUndoEnabled);
m_aModifyLink.Call(nullptr);
Invalidate();
}