[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice
Subject:    Re: Small MsWord filter/kword projects: any takers?
From:       David Faure <david () mandrakesoft ! com>
Date:       2000-06-29 13:09:11
[Download RAW message or body]

On Thu, Jun 29, 2000 at 01:03:28PM +0200, Jost Schenck wrote:
> On Thu, 29 Jun 2000, David Faure wrote:
> >On Thu, Jun 29, 2000 at 06:45:16AM +0100, Shaheed Haque wrote:
> >> I have two small mini-projects for anyone who might be interested in 
> >> contributing to the MsWord filter, or kword generally.
> >> 
> >> 1. Alphabetic lists start with "Q"
> >> ----------------------------------
> >> 
> >> If you create an upper case alphabetic list, the first item is numbered "Q" 
> >> instead of "A". The same may happen on lower case lists, I'm not sure. 
> >> Anyway, the relevant code is in koffice/kword/parag.cc 
> >> (KWParag::counterTextByType()), where there is an intriguing comment about 
> >> unicode too!
> >
> >Does it work with
> >tmp = 'A' + counterData[i] - 1;
> >?
> >This is using QString &operator=( char c ), I can't see any
> >unicode problem with that.
> >
> >The current code is definitely strange :-)
> 
> Sorry, I *think* I added that comment, when I changed the code to support some
> sort of numbering used by German lawyers. I'm not an expert on unicode, but I
> remember that before changing those lines my numbered lists started somewhere
> 16 or 17 chars before 'A', thus showing me some special chars.

Ok, I start to see the problem.
The counterData/listData arrays (int[16]) initially held either the
number of the item _or_ the char for it - but using .unicode(). 
That was used in counterTextByType()... but .unicode() + 16 is definitely a hack.
You changed that so that it always store the number, but you only
changed counterData and not listData. That would be easy to fix and
with the code I suggest above, we would get working lists again.
HOWEVER, I believe Reggie's intent, by storing the char instead of the
number, in the array, was to allow things like 1.A.3., no ?
Does anyone knows about that ? I'm not much of a KWord user....

Of course, we can also always store numbers and generate the 'A.' when
building the full string... This looks cleaner than .unicode() to me.

-- 
David FAURE
david@mandrakesoft.com, faure@kde.org
http://home.clara.net/faure/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic