summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-08-03 12:28:23 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-08-03 16:19:32 +0200
commit5b98dd53c7dc101d3a5ff693d3f0520ec1abd3d1 (patch)
tree63d76208f9dabaf00a5892ce9a3c93b5e293fe99
parentc88ff9298b25132fc34102230cef0263f045a523 (diff)
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 now deferred until the timer fires, so reduce the timer to make it smoother Change-Id: I27980be54de20bb516b1f106c3ed1b303e2a4014 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119933 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--dbaccess/source/ui/control/sqledit.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx
index a3a8626acc21..0be854655593 100644
--- a/dbaccess/source/ui/control/sqledit.cxx
+++ b/dbaccess/source/ui/control/sqledit.cxx
@@ -127,7 +127,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();
@@ -171,8 +171,6 @@ IMPL_LINK_NOARG(SQLEditView, ModifyHdl, LinkParamNone*, void)
{
if (m_bInUpdate)
return;
-
- m_aModifyLink.Call(nullptr);
m_aUpdateDataTimer.Start();
}
@@ -195,7 +193,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 ) );
@@ -215,12 +212,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();
}