[gnote] Fix linking to existing note



commit 5128c8ce31d58c142ecd44e0667e8f899126ab82
Author: Aurimas Äernius <aurisc4 gmail com>
Date:   Sat Oct 8 15:35:49 2011 +0300

    Fix linking to existing note
    
    When selecting text and pressing "link", the link is not created
    when new note is not created (already exists).

 src/notewindow.cpp |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/notewindow.cpp b/src/notewindow.cpp
index ba1e55c..39c9604 100644
--- a/src/notewindow.cpp
+++ b/src/notewindow.cpp
@@ -592,6 +592,12 @@ namespace gnote {
         return;
       }
     }
+    else {
+      Gtk::TextIter start, end;
+      m_note.get_buffer()->get_selection_bounds(start, end);
+      m_note.get_buffer()->remove_tag(m_note.get_tag_table()->get_broken_link_tag(), start, end);
+      m_note.get_buffer()->apply_tag(m_note.get_tag_table()->get_link_tag(), start, end);
+    }
 
     match->get_window()->present();
   }



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