[gnote] Fix spell-check breaking note links



commit bad0c0f22817d24c947827ec635f9c8fe89b5f58
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun Oct 6 16:08:49 2013 +0300

    Fix spell-check breaking note links
    
    Fixes Bug 703664.

 src/watchers.cpp |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/watchers.cpp b/src/watchers.cpp
index 45a28f2..7e53e3e 100644
--- a/src/watchers.cpp
+++ b/src/watchers.cpp
@@ -309,7 +309,7 @@ namespace gnote {
     }
 
     m_tag_applied_cid = get_buffer()->signal_apply_tag().connect(
-      sigc::mem_fun(*this, &NoteSpellChecker::tag_applied));
+      sigc::mem_fun(*this, &NoteSpellChecker::tag_applied), false);  // connect before
 
     if (!m_obj_ptr) {
       m_obj_ptr = gtk_spell_checker_new();
@@ -360,7 +360,8 @@ namespace gnote {
         const Glib::RefPtr<const Gtk::TextTag>& atag(*tag_iter);
         if ((tag != atag) &&
             !NoteTagTable::tag_is_spell_checkable (atag)) {
-          remove = true;
+          // cancel attempt to add misspelled tag on non-spell-check place
+          get_buffer()->signal_apply_tag().emission_stop();
           break;
         }
       }
@@ -370,6 +371,7 @@ namespace gnote {
     }
 
     if (remove) {
+      // adding non-spell-check tag on misspelled text, remove the spell-check first
       get_buffer()->remove_tag_by_name("gtkspell-misspelled",
                                start_char, end_char);
     }


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