More


Subject: More
From: Frodo Looijaard (frodol@dds.nl)
Date: Fri Jul 06 2001 - 17:00:25 CDT


Hi folks,

I looked again at the UT_convert issues, and found several problems:
  * It seems somewhat unsure about its return type; it is declared
    as returning bool, but at one point actually returns NULL
  * Though it does compute its result (pDest) and allocates it, this
    pointer is nowhere returned (at the moment, it is actually a memory
    leak)
  * It is only used in pspell_checker.cpp, in the utf16_to_utf8 and
    utf8_to_utf16 functions. At those places, a totally different semantics
    is assumed: the fifth parameter is treated as the result parameter,
    and it is assumed some kind of string is returned through it, even
    though in fact it is a pointer to a single integer which is set to
    the number of characters processed.

Though I did not commit anything (because I am still a bit unsure of
the semantics intended), I suggest the following changes:
  * Change UT_convert to return a (char *), instead of a boolean.
    This should be NULL on error, and contain a freshly allocated buffer
    of character on succes. Perhaps it should be a slightly different
    type though.
    I have this change attached as abiword-UT_convert-1.diff
  * Change the pspell functions to reflect this change, and to take
    into account that it handles newly allocated memory.
    I have this change attached as abiword-UT_convert-2.diff

At this moment, pspell still does not work, but I would like to know
whether I am heading in the right direction.

The reason I need to use pspell: I want to use my extensive catalog
of ispell dictionaries, but they are in a slightly different format
than expected by AbiWord; using ispell directly does not work, but
it used to work fine through pspell.

Thanks,
  Frodo

-- 
Frodo Looijaard <frodol@dds.nl>  PGP key and more: http://huizen.dds.nl/~frodol
Defenestration n. (formal or joc.):
  The act of removing Windows from your computer in disgust, usually followed
  by the installation of Linux or some other Unix-like operating system.





This archive was generated by hypermail 2b25 : Fri Jul 06 2001 - 17:00:37 CDT