[latexila] spell: update for GspellTextBuffer API change



commit db961f73ca27b88466b1c45ed56a17cff6a6f68e
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Mar 11 13:52:52 2016 +0100

    spell: update for GspellTextBuffer API change

 configure.ac           |    2 +-
 src/document_view.vala |   19 +++++++++++++++----
 2 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b58c4d2..f61f1c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,7 +28,7 @@ LT_INIT
 GLIB_REQUIRED_VERSION="2.40"
 GTK_REQUIRED_VERSION="3.19.3"
 GTKSOURCEVIEW_REQUIRED_VERSION="3.18"
-GSPELL_REQUIRED_VERSION="0.2.4"
+GSPELL_REQUIRED_VERSION="0.2.5"
 VALA_REQUIRED_VERSION="0.26"
 GEE_REQUIRED_VERSION="0.10"
 
diff --git a/src/document_view.vala b/src/document_view.vala
index 28aec8b..ab1cd07 100644
--- a/src/document_view.vala
+++ b/src/document_view.vala
@@ -208,7 +208,10 @@ public class DocumentView : Gtk.SourceView
     private void init_spell_checking ()
     {
         Gspell.Checker spell_checker = new Gspell.Checker (get_spell_language ());
-        Gspell.text_buffer_set_spell_checker (this.buffer, spell_checker);
+
+        unowned Gspell.TextBuffer gspell_buffer =
+            Gspell.TextBuffer.get_from_gtk_text_buffer (buffer);
+        gspell_buffer.set_spell_checker (spell_checker);
 
         setup_inline_spell_checker ();
 
@@ -249,6 +252,14 @@ public class DocumentView : Gtk.SourceView
         return Gspell.Language.lookup (lang_code);
     }
 
+    private unowned Gspell.Checker? get_spell_checker ()
+    {
+        unowned Gspell.TextBuffer gspell_buffer =
+            Gspell.TextBuffer.get_from_gtk_text_buffer (buffer);
+
+        return gspell_buffer.get_spell_checker ();
+    }
+
     public void setup_inline_spell_checker ()
     {
         Document doc = get_buffer () as Document;
@@ -278,7 +289,7 @@ public class DocumentView : Gtk.SourceView
 
     public void launch_spell_language_chooser_dialog ()
     {
-        Gspell.Checker? spell_checker = Gspell.text_buffer_get_spell_checker (buffer);
+        Gspell.Checker? spell_checker = get_spell_checker ();
         return_if_fail (spell_checker != null);
 
         Gspell.LanguageChooserDialog dialog =
@@ -298,7 +309,7 @@ public class DocumentView : Gtk.SourceView
 
     public void save_spell_language_metadata ()
     {
-        Gspell.Checker? spell_checker = Gspell.text_buffer_get_spell_checker (buffer);
+        Gspell.Checker? spell_checker = get_spell_checker ();
         return_if_fail (spell_checker != null);
 
         Document doc = get_buffer () as Document;
@@ -336,7 +347,7 @@ public class DocumentView : Gtk.SourceView
         if (! inline_checker.enabled)
             return;
 
-        Gspell.Checker? spell_checker = Gspell.text_buffer_get_spell_checker (buffer);
+        Gspell.Checker? spell_checker = get_spell_checker ();
         return_if_fail (spell_checker != null);
 
         if (spell_checker.get_language () != null)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]