commit: persistent ignored words

Subject: commit: persistent ignored words
From: WJCarpenter (bill-abisource@carpenter.ORG)
Date: Sun Mar 25 2001 - 01:48:17 CST

Fixes up various things in the maintenance of ispell's ignored words
list and also implements persisting the "Ignore All" list to the
document file. The "ignore all" word list now acts like a persistent,
per-document custom dictionary.

All *alloc()/free() sets in ignored word maintenance changed to
new/delete. Also eliminated the need for memory allocation for
scratch buffers for most common cases. Ignored word maintenance isn't
exactly performance critical, but every little bit helps.

The signature of enumIgnores() was changed because the signature it
had would have been ineffective. (enumIgnores() was not previously
called, but is called now for a UT_DEBUGMSG() in the AD_Document

Fixed a sort of interesting problem about duplicate entries. When you
"ignore all" on some word, spell-check queues all the blocks in a
document for re-spell-checking. That's done in the background. For a
long document, it's easy to do "ignore all" on another instance of the
same word before the squiggle is removed. That leads to an attempt at
adding a duplicate entry to the hash table, and that leads to an
assert. The assert looks harmless to me, but since hash tables are
used all over the place, I didn't remove it. Instead, I made ignored
word maintenance check for an entry before trying to add it.

Added two preference variables, SpellCheckIgnoredWordsSave and
SpellCheckIgnoredWordsLoad (sorry, no GUI for any platform). As a
side effect of the implementation to use those preferences,
PD_Document and AP_Convert objects now have an XAP_App pointer (and a
getApp()). The means that lots of new places (including the
import/export code) can now access the user preferences. Go hog wild.

Ignored words are saved in a bit of XML that looks like this:


The <ignoredwords> tag is at the same level as <section> and <style>.

Most changes are XP, tested on Linux. I'm not sure if this works with
the alternative Gnome XML parser, but my guess is that it does. A
small part of the changes is platform-specific, but things should work
if the code meets my modest assumptions about class hierarchies and
member functions. The Unix stuff works for sure.

CVS: ----------------------------------------------------------------------
CVS: Enter Log. Lines beginning with `CVS:' are removed automatically
CVS: Committing in .
CVS: Modified Files:
CVS: abi/src/af/xap/xp/xad_Document.cpp
CVS: abi/src/af/xap/xp/xad_Document.h
CVS: abi/src/text/ptbl/xp/pd_Document.cpp
CVS: abi/src/text/ptbl/xp/pd_Document.h
CVS: abi/src/wp/ap/beos/ap_BeOSApp.cpp
CVS: abi/src/wp/ap/beos/ap_BeOSFrame.cpp
CVS: abi/src/wp/ap/qnx/ap_QNXFrame.cpp
CVS: abi/src/wp/ap/unix/ap_UnixApp.cpp
CVS: abi/src/wp/ap/unix/ap_UnixFrame.cpp
CVS: abi/src/wp/ap/unix/gnome/ap_UnixGnomeApp.cpp
CVS: abi/src/wp/ap/win/ap_Win32App.cpp
CVS: abi/src/wp/ap/win/ap_Win32Frame.cpp
CVS: abi/src/wp/ap/xp/ap_Convert.cpp abi/src/wp/ap/xp/ap_Convert.h
CVS: abi/src/wp/ap/xp/ap_Dialog_Lists.cpp
CVS: abi/src/wp/ap/xp/ap_Prefs_SchemeIds.h
CVS: abi/src/wp/impexp/xp/ie_exp_AbiWord_1.cpp
CVS: abi/src/wp/impexp/xp/ie_imp_AbiWord_1.cpp
CVS: abi/src/wp/impexp/xp/ie_imp_XML.cpp
CVS: abi/src/wp/impexp/xp/ie_imp_XML.h
CVS: ----------------------------------------------------------------------

This archive was generated by hypermail 2b25 : Sun Mar 25 2001 - 01:48:18 CST