[Libreoffice-commits] core.git: vcl/unx

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Jan 20 10:38:51 UTC 2019


 vcl/unx/gtk3/gtk3gtkinst.cxx |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit d997066759cc79d07097f28bc6a97b1f43da73e0
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jan 18 13:26:09 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Jan 20 11:38:29 2019 +0100

    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 at redhat.com>
    Tested-by: Jenkins

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();
     }
 


More information about the Libreoffice-commits mailing list