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

List:       koffice-devel
Subject:    Re: Tables in KWord? (was: MS filters)
From:       Thomas Zander <zander () kde ! org>
Date:       2008-03-17 21:08:47
Message-ID: 200803172208.51072.zander () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Monday 17. March 2008 09:12:49 Boudewijn Rempt wrote:
> On Mon, 17 Mar 2008, Karl-Heinz Zimmer wrote:
> > What is the priority of "Find a good way to have tables in KWord"?
>
> I started a table shape earlier this year.
[] 
> Right now, I'm stuck waiting for ODF text support to improve enough
> that I can make a couple of decisions:
>
> * Make it possible to have any shape as cell contents (so a text cell
> will be a text shape)?

This is how it was done in 1.x.
This turned out to be a very very bad idea; you are unable to do a lot of 
things that people expect and the layout code is near impossible to get 
right. (mixing of abstraction layers)
Also multi page tables are quite impossible to do like that due to the 
layout code living at different levels. The text level and the shape 
level.

[]

> * Integrate the table shape as an embedded object 
> in a text shape's QTextDocument by: 
> * using a Unicode text object 
> (QChar::ObjectReplacementCharacter) 
> * a QTextObject derived class 
> (QTextTable is a QTextObject already) 
Those two things are the same thing, really. In the QTextLayout (aka plain 
Qt) the QTextObject stuff is implemented on top of the former as an 
easier way for Qt customers to extend this.  I wrote my own version which 
IMO is more powerful.  See the KoInlineObject class.

 Incidentally; the KOffice text layouter doesn't have support for 
QTextObject (yet).

> * Make it possible for cells to 
> have different widths in differnt rows (MS Word supports that, ODF
> doesn't)

Hehe; it does, actually. I'm not sure if you want to look at how OOo 
writes it out right now. For the gory details; see 
http://lists.oasis-open.org/archives/office/200707/threads.html
There are various threads with "is-subtable" as title.

> * Implement multi-page tables as linked shapes or as one multi-page
> shape (I think the former, as that's what ordinary running text seems
> to do).

Note that if you use QTextTable you will not need any such logic; all 
tables would then be part of the text-flow and its reasonably straight 
forward (Qt already manages this) to format the table over several pages.
Also worth noting is that I never got around to writing a command to make 
a shape a child of a text shape. There is only some very simple 
proof-of-concept code in KWord. The reason I mention this is that if you 
choose to do a child-shape approach you also will have to create code to 
make a table-shape a child of the text shape.

The point I wrote above of the experience we had with the approach of 
sub-shapes is also relevant for this. It really is near impossible to do 
proper layouting of multi-page tables using this approach.

> First we need to
> arrive at a clear idea of the answers to the problems I enumerated
> above. 

Yes, that seems sane.  Hope you can appreciate me writing down my 
experiences with exactly this stuff for the last 10 years ;)  (I wrote 
the last 2 iterations of the tables in kword)
-- 
Thomas Zander

[Attachment #5 (application/pgp-signature)]

_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://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