summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-01-18 13:26:09 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-01-20 11:38:29 +0100
commitd997066759cc79d07097f28bc6a97b1f43da73e0 (patch)
treef49e2ac0f3ef8922f5a2c50523e942a63c733822
parentb940eb5903f583089e99042d60ceae635ae2af83 (diff)
Related: tdf#122786 but we don't want to reformat based on that new value
Change-Id: I11fa408a446aa9fd36780392ae10457822acbb68 Reviewed-on: https://gerrit.libreoffice.org/66606 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index ccbd44ce7ad6..3ee29fcf83e3 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -5749,6 +5749,7 @@ private:
gulong m_nOutputSignalId;
gulong m_nInputSignalId;
bool m_bFormatting;
+ bool m_bBlockOutput;
static void signalValueChanged(GtkSpinButton*, gpointer widget)
{
@@ -5759,6 +5760,8 @@ private:
bool guarded_signal_output()
{
+ if (m_bBlockOutput)
+ return true;
m_bFormatting = true;
bool bRet = signal_output();
m_bFormatting = false;
@@ -5806,6 +5809,7 @@ public:
, m_nOutputSignalId(g_signal_connect(pButton, "output", G_CALLBACK(signalOutput), this))
, m_nInputSignalId(g_signal_connect(pButton, "input", G_CALLBACK(signalInput), this))
, m_bFormatting(false)
+ , m_bBlockOutput(false)
{
}
@@ -5827,9 +5831,13 @@ public:
gtk_entry_set_text(GTK_ENTRY(m_pButton), OUStringToOString(rText, RTL_TEXTENCODING_UTF8).getStr());
// tdf#122786 if we're just formatting a value, then we're done,
// however if set_text has been called directly we want to update our
- // value from this new text
+ // value from this new text, but don't want to reformat with that value
if (!m_bFormatting)
+ {
+ m_bBlockOutput = true;
gtk_spin_button_update(m_pButton);
+ m_bBlockOutput = false;
+ }
enable_notify_events();
}