[Nautilus-list] [Fwd: Brokeness gtkhtml cause of spellings changes]



[Im forwardinf this mail cause I wrongly sent this to
nautilus-list eazel com whereas the correct address is
nautilus-list lists eazel com]

-re
--- Begin Message ---
The latest round of gtkhtml spelling changes are breaking the build for
nautilus hackers.

The attached patch adds more #ifdef GTKHTML_HAVE_PSPELL to not build
some code in gtkhtml that seems to be dependent on pspell usage being
defined.

Im not sure if this is the 100% correct thing to do, but it fixes the
build for me.

I don't see a HACKING file in gtkhtml so i went ahead and committed the
changes.

thanks

-re


PS

Also, out of curiosity, now that we live in a wonderful world of
interfaces and components, is adding #ifdefs like this all over the code
really the best way to write maintainable code ?

When I was working on the old mozilla 4.x code base, this was the single
most damning thing that contributed to the doom of that code - that is
hacking in stuff into the layout module without an interface.  It was
also the single most criticized thing about mozilla by open source
hackers.

Just wondering.
? spell-ifdef.patch
? log
? po/POTFILES
? po/Makefile.in
? po/Makefile
? po/cat-id-tbl.c
? po/gtkhtml.pot
? po/stamp-cat-id
Index: src/ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.584
diff -u -u -r1.584 ChangeLog
--- src/ChangeLog	2000/07/20 12:04:48	1.584
+++ src/ChangeLog	2000/07/20 14:29:33
@@ -1,3 +1,10 @@
+2000-07-20  Ramiro Estrugo  <ramiro eazel com>
+
+	* gtkhtml-properties.c:
+	* gtkhtml.c: (class_init):
+	* htmltext.c: (destroy):
+	Protect more pspell dependent code with #ifdef GTKHTML_HAVE_PSPELL.
+
 2000-07-20  Radek Doulik  <rodo helixcode com>
 
 	* htmltext.c (copy_helper): copy spell_errors here
Index: src/gtkhtml-properties.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/gtkhtml-properties.c,v
retrieving revision 1.14
diff -u -u -r1.14 gtkhtml-properties.c
--- src/gtkhtml-properties.c	2000/07/20 12:04:49	1.14
+++ src/gtkhtml-properties.c	2000/07/20 14:29:33
@@ -177,9 +177,12 @@
   { GTK_HTML_COMMAND_CAPITALIZE_WORD, "GTK_HTML_COMMAND_CAPITALIZE_WORD", "capitalize-word" },
   { GTK_HTML_COMMAND_UPCASE_WORD, "GTK_HTML_COMMAND_UPCASE_WORD", "upcase-word" },
   { GTK_HTML_COMMAND_DOWNCASE_WORD, "GTK_HTML_COMMAND_DOWNCASE_WORD", "downcase-word" },
+#ifdef GTKHTML_HAVE_PSPELL
+
   { GTK_HTML_COMMAND_SPELL_SUGGEST, "GTK_HTML_COMMAND_SPELL_SUGGEST", "spell-suggest" },
   { GTK_HTML_COMMAND_SPELL_PERSONAL_DICTIONARY_ADD, "GTK_HTML_COMMAND_SPELL_PERSONAL_DICTIONARY_ADD", "spell-personal-add" },
   { GTK_HTML_COMMAND_SPELL_SESSION_DICTIONARY_ADD, "GTK_HTML_COMMAND_SPELL_SESSION_DICTIONARY_ADD", "spell-session-add" },
+#endif
   { 0, NULL, NULL }
 };
 
Index: src/gtkhtml.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/gtkhtml.c,v
retrieving revision 1.165
diff -u -u -r1.165 gtkhtml.c
--- src/gtkhtml.c	2000/07/20 12:04:49	1.165
+++ src/gtkhtml.c	2000/07/20 14:29:33
@@ -1337,6 +1337,7 @@
 				GTK_SIGNAL_OFFSET (GtkHTMLClass, command),
 				gtk_marshal_NONE__ENUM,
 				GTK_TYPE_NONE, 1, GTK_TYPE_HTML_COMMAND);
+#ifdef GTKHTML_HAVE_PSPELL
 	signals [SPELL_SUGGESTION_REQUEST] =
 		gtk_signal_new ("spell_suggestion_request",
 				GTK_RUN_FIRST,
@@ -1346,7 +1347,7 @@
 				GTK_TYPE_NONE, 2,
 				GTK_TYPE_POINTER,
 				GTK_TYPE_POINTER);
-
+#endif
 	gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
 
 	object_class->destroy = destroy;
Index: src/htmltext.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmltext.c,v
retrieving revision 1.58
diff -u -u -r1.58 htmltext.c
--- src/htmltext.c	2000/07/20 12:04:49	1.58
+++ src/htmltext.c	2000/07/20 14:29:33
@@ -584,7 +584,9 @@
 {
 	HTMLText *text = HTML_TEXT (obj);
 	html_color_unref (text->color);
+#ifdef GTKHTML_HAVE_PSPELL
 	html_text_spell_errors_clear (text);
+#endif
 	g_free (text->text);
 	HTML_OBJECT_CLASS (parent_class)->destroy (obj);
 }

--- End Message ---


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