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

List:       koffice-devel
Subject:    Re: Tables on multiple pages
From:       Stefan Nikolaus <stefan.nikolaus () kdemail ! net>
Date:       2008-06-27 9:48:27
Message-ID: 200806271148.30866.stefan.nikolaus () kdemail ! net
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Thursday 26 June 2008 23:41:52 Thomas Zander wrote:
> > The logic for splitting the table into pages is basically the same as for
> > printing a sheet in KSpread. The TableShape should become a
> > KoShapeContainer consisting of several shapes, one for each page. Each
> > shape has its own position in the document. So, does this already suffice
> > to break the table onto different pages?
>
> Yes, it does. This is basically the same as what KWord (textshape) does.
> One thing, I'm not sure why you need to make it a KoShapeContainer. As far
> as I can tell you can use normal shapes.
> The solution the text shape uses is that there are a set of textshapes
> which all have the same userData (KoShape::setUserData()) and that userdata
> is basically the model that combines them all.

Ah, another TODO: detaching the data from the shape. :)

> So, if you *just* want to have multiple shapes on multiple pages this would
> suffice.  But naturally you want to have multiple shapes on multiple pages
> *inside* a text flow. :)
>
> This is a bit harder.
>
> > KWord supports different layouts for each page. How can these be queried
> > from outside? Do you have to go over the parent container of the inlined
> > shape and use its dimension or how should one handle it?
>
> Let me give you an overview, the answer to the above question will
> naturally flow from that.
> The embedding of a table shape in a text flow requires you to use a
> KoTextAnchor to connect your table shape to the text shape.
>   "This class is the object that is positioned in the text to be an anchor
> for a shape.  An anchor is the connection between the text-shape and the so
> called 'anchored-shape', where the anchored shape can be any kind of shape.
> This textanchor then connects the anchored-shape to the text flow so the
> anchored shape can be repositioned on the canvas if new text is inserted or
> removed before the anchor character."  (see rest of API docs of
> KoTextAnchor)
>
> The solution that I suggest is that you inherit from the KoTextAnchor and
> reimplement the virtual methods updatePosition and resize using the parent
> shape (the text shape) as the base size for cutting up the table and for
> determining the wanted sizes.

Why inherit from KoTextAnchor at all? It seems to be a class for generic 
shapes. At least I can inline shapes by "Insert -> Make inline". Looking at 
the code, it uses, if existing, the container as the achored shape. So, the 
text cursor should jump from "before the first table page" to "after the last 
table page", not in between the pages.
The method also sets the text shape as parent of the anchored shape. This 
should give me access to the dimensions. At least from the page the anchor is 
located.  How to get the other ones? :|

> At this point, using the multiple shapes and the private text anchor class
> will take care of doing the in-text layout and splitting of the table for
> you.

Hmm, you speak of making each table page derive from KoTextAnchor? This would 
result in a set of anchors and the user becomes able to insert text between 
the table pages. This should be avoided. Or did I missed an important fact?

-- 
Stefan Nikolaus



["signature.asc" (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