Kaydet (Commit) b5b198ad authored tarafından Caolán McNamara's avatar Caolán McNamara

block/unblock notify events around TextView text change

Change-Id: Ib2654790f4e5b839302fa547bccf0d32ca91bf55
Reviewed-on: https://gerrit.libreoffice.org/71674
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst ed423da9
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment