[gnote] Fix broken link activation



commit 4208fcd64b77edcdf84067105925b138a670815c
Author: Aurimas Äernius <aurisc4 gmail com>
Date:   Sat Oct 8 20:40:32 2011 +0300

    Fix broken link activation
    
    When broken link is activated, it should become normal again,
    because the note exists.

 src/watchers.cpp |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/watchers.cpp b/src/watchers.cpp
index f807912..5b677a8 100644
--- a/src/watchers.cpp
+++ b/src/watchers.cpp
@@ -908,6 +908,12 @@ namespace gnote {
       }
     }
 
+    Glib::RefPtr<Gtk::TextTag> broken_link_tag = get_note()->get_tag_table()->get_broken_link_tag();
+    if(start.begins_tag(broken_link_tag)) {
+      get_note()->get_buffer()->remove_tag(broken_link_tag, start, end);
+      get_note()->get_buffer()->apply_tag(get_note()->get_tag_table()->get_link_tag(), start, end);
+    }
+
     // FIXME: We used to also check here for (link != this.Note), but
     // somehow this was causing problems receiving clicks for the
     // wrong instance of a note (see bug #413234).  Since a



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