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

List:       koffice-devel
Subject:    Re: List support in KWord
From:       David Faure <dfaure () klaralvdalens-datakonsult ! se>
Date:       2003-01-23 10:03:48
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 23 January 2003 06:06, Clarence Dang wrote:
> On Tue, 21 Jan 2003 01:40 am, David Faure wrote:
> > On Sunday 19 January 2003 09:38, Clarence Dang wrote:
> > > I'm being really lazy here (sorry) but could someone please add a "text"
> > > attribute in koParagCounter::save() because reproducing things like
> > > "1.1.3" etc. is rather tricky in export filters  (esp. in a bad case like
> > > when numbered lists are inside bulleted lists which are inside numbered
> > > lists) and duplicates code.
> >
> > There is already a text() method in KoParagCounter. But it needs a
> > paragraph pointer, to find out the parent paragraph etc. In an export
> > filter that uses the KWord KoDocument this can be used indeed.
> >
> But a "normal filter" has to be able to get the text (easily) too...so I've 
> added a text attribute to COUNTER (same idea as with VARIABLE) by changing 
> libexport and lib/kotext/paragcounter.cc.

Ah, sure, good idea.
I understand now that I misunderstood your initial request (I thought you
wanted a text method in KoParagCounter).

> Two questions though:
> 1.  With bulleted lists, KoParagCounter::text used to (before the patch) draw  
> a space so that it could be drawn over by proper bullets in KWord (as in, 
> real shapes).  Now I'm drawing things like * instead... I initially thought 
> that this would cause problems (I would imagine that some bullet shapes would 
> be smaller than a *).  So are KOffice bullets opaque after all, hence totally 
> covering up the *?

I'm not sure I understand that one. AFAICS there is no "drawing over" happening
in KWord... KoTextParag::drawLabel() tests for isBullet(), to handle bullets,
and uses text() only for non-bullets counters.

Hmm, if your change made KoTextParag draw a '*' for bullets - or, more probably,
allocate more space for it due to the character being different.... then a better
change would have been to introduce a new method, say asciiText(), which
adds the bullet chars to what text() returns, and which is used when saving.
This way, no interference with the existing code.

> 2. How do I ensure that m_cache.text is in fact valid (I got lost in the code 
> trying to find the right place to call text() with that paragraph pointer 
> before saving)?

If it's not empty, it's valid. (it gets emptied when known to be invalid).
So you probably want to do
    // Ensure paragraph text is valid.
    if ( m_cache.text.isNull() )
        text( paragraph );
But for this you need to pass the paragraph to save() ...

> On Mon, 20 Jan 2003 07:20 pm, Ariya Hidayat wrote:
> > complete information about the list still should be provided
You mean like the level in the hierarchy ? (2.4.1 would save 2, 4 and 1 separately).

> The patch I committed doesn't do this but at least it's a start.  Of course a 
> major benefit is that now the lists output by filters would match those in 
> KWord.  So any changes in KWord would be passed on to the filters :)  No more 
> code duplication...this would mean that the 100+ lines in asciiexport for 
> handling counters could be changed to about 3 (which I'll be doing soon plus 
> adding table support etc.)

Yes ... well, it's mostly useful for asciiexport only, though.

> BTW, does anyone know why ASCIIExport(KoFilter *parent, const char *name, 
> const QStringList &); accepts a QStringList& (it doesn't seem to be used at 
> all)?
The usual 'args' stringlist from KLibLoader::create()? (If that's it, just ignore it)

- -- 
David Faure -- faure@kde.org, dfaure@klaralvdalens-datakonsult.se
Klarälvdalens Datakonsult AB, Platform-independent software solutions
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
KOffice-1.2.1 is available - http://download.kde.org/stable/koffice-1.2.1/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+L74E72KcVAmwbhARAiwsAJ4sgVLFqmd58MWuysmjKZ7HAlDxRQCgl8vk
nOBA7nzoddSW/bSM438ImQU=
=lmms
-----END PGP SIGNATURE-----

_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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