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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu May 2 15:51:49 UTC 2019


 vcl/unx/gtk3/gtk3gtkinst.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit b5b198ad3db3a1020b249ea3452eee6bce03e9b9
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu May 2 13:17:16 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu May 2 17:50:52 2019 +0200

    block/unblock notify events around TextView text change
    
    Change-Id: Ib2654790f4e5b839302fa547bccf0d32ca91bf55
    Reviewed-on: https://gerrit.libreoffice.org/71674
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 38369c6b1b46..7044b90c4bd5 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -7976,9 +7976,11 @@ public:
 
     virtual void set_text(const OUString& rText) override
     {
+        disable_notify_events();
         GtkTextBuffer* pBuffer = gtk_text_view_get_buffer(m_pTextView);
         OString sText(OUStringToOString(rText, RTL_TEXTENCODING_UTF8));
         gtk_text_buffer_set_text(pBuffer, sText.getStr(), sText.getLength());
+        enable_notify_events();
     }
 
     virtual OUString get_text() const override
@@ -7994,10 +7996,12 @@ public:
 
     virtual void replace_selection(const OUString& rText) override
     {
+        disable_notify_events();
         GtkTextBuffer* pBuffer = gtk_text_view_get_buffer(m_pTextView);
         gtk_text_buffer_delete_selection(pBuffer, false, gtk_text_view_get_editable(m_pTextView));
         OString sText(OUStringToOString(rText, RTL_TEXTENCODING_UTF8));
         gtk_text_buffer_insert_at_cursor(pBuffer, sText.getStr(), sText.getLength());
+        enable_notify_events();
     }
 
     virtual bool get_selection_bounds(int& rStartPos, int& rEndPos) override


More information about the Libreoffice-commits mailing list