tomboy r2077 - in trunk: . Tomboy



Author: sschweiz
Date: Tue Aug 12 20:36:34 2008
New Revision: 2077
URL: http://svn.gnome.org/viewvc/tomboy?rev=2077&view=rev

Log:
* Tomboy/Watchers.cs: Recheck spelling if a tag is removed.
  Fixes bug #530856.


Modified:
   trunk/ChangeLog
   trunk/Tomboy/Watchers.cs

Modified: trunk/Tomboy/Watchers.cs
==============================================================================
--- trunk/Tomboy/Watchers.cs	(original)
+++ trunk/Tomboy/Watchers.cs	Tue Aug 12 20:36:34 2008
@@ -230,6 +230,9 @@
 		[DllImport ("libgtkspell")]
 		static extern void gtkspell_detach (IntPtr obj);
 
+		[DllImport ("libgtkspell")]
+		static extern void gtkspell_recheck_all (IntPtr obj);
+
 		static bool DetectGtkSpellAvailable()
 		{
 			try {
@@ -295,6 +298,7 @@
 			}
 
 			Buffer.TagApplied += TagApplied;
+			Buffer.TagRemoved += TagRemoved;
 
 			if (obj_ptr == IntPtr.Zero) {
 				obj_ptr = gtkspell_new_attach (Window.Editor.Handle,
@@ -305,6 +309,7 @@
 
 		void Detach ()
 		{
+			Buffer.TagRemoved -= TagRemoved;
 			Buffer.TagApplied -= TagApplied;
 
 			if (obj_ptr != IntPtr.Zero) {
@@ -348,6 +353,14 @@
 				                  args.EndChar);
 			}
 		}
+
+		void TagRemoved (object sender, Gtk.TagRemovedArgs args)
+		{
+			// Recheck when a tag is removed that prevented spell checking
+			if (!NoteTagTable.TagIsSpellCheckable (args.Tag) &&
+					obj_ptr != IntPtr.Zero)
+				gtkspell_recheck_all (obj_ptr);
+		}
 	}
 	#else
 	// Add in a "dummy" NoteSpellChecker class so that Mono.Addins doesn't



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