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

List:       koffice-devel
Subject:    Re: Is there a way for a KWord import filter to insert a TOC?
From:       David Faure <david () mandrakesoft ! com>
Date:       2001-06-24 22:45:10
[Download RAW message or body]

On Friday 22 June 2001 22:58, shaheed wrote:
> Hi David,
> 
> > > Is there a way for an import filter to insert a TOC? I think the answer
> > > is no...something to think about post 1.1 - possibly via a variable?
> >
> > Hmm the answer is yes, simply create the "Contents Title"
> > and "Contents Head N" styles, and use them to create the TOC.
> 
> Well, it would be hard for me to work out the page numbers!

I see ;-)

> > Ok, this basically means doing it by hand... Do you mean that msword
> > docs simply say "put a toc here", without any details ? I thuught it
> > had all the text of it, since it's possible to "hack" that text in msword
> > too.
> 
> Yes, it does exactly that. You can edit the text of a field, but you will 
> loose the edits if you press F9!

Same in KWord, if you change the lines in Contents Head N and "Update TOC".
But if you add lines with another style in between, those don't get lost.

> In fact, for the next version of Kword, I think we should give some serious 
> thought to variables. Multi-line variables would be useful for the dynamic 
> variables I proposed, for the KCite stuff, and for a TOC (and later TOF, 
> Index etc.) variables.

I'm not sure this is a good idea. I mean, I know many people who edit the contents
(and/or formatting) of their TOC (without using the styles, because not for the 
whole paragraph), and this would prevent that. Unless you mean that we would
also make variables editable ? This sort of loses the point completely IMHO.
I don't see why a TOC _has_ to be a variable. Ok, it's one in MSWord, but that's
no reason. I prefer it as generated text, as it is now.

(Also, if it's a variable, the "create the TOC, relayout and _then_ update the page 
numbers" algorithm will be very difficult to implement imho. And the user won't
control when the variable gets regenerated..... well those are implementation issues
but they just add to it)

> > It's not a variable in kword, it's generated text [because I don't see a
> > way to support multi-lines variables yet]. But if you want, we could add an
> > xml tag for "generate a toc here".
> 
> Rather than a TOC-specific hack, lets work out a generic solution (post 1.1!).

I think "generate this text here" could be done in a generic way, to add support
for indexes, etc.

I think that it's simply cleaner to separate non-editable variables, and
editable generated text.

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://perso.mandrakesoft.com/~david/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today
_______________________________________________
Koffice-devel mailing list
Koffice-devel@master.kde.org
http://master.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