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

List:       koffice-devel
Subject:    Re: Page Variable Support
From:       Thomas Zander <zander () kde ! org>
Date:       2009-08-21 6:01:59
Message-ID: 200908210902.00106.zander () kde ! org
[Download RAW message or body]

On Friday 21. August 2009 06.55.09 you wrote:
> > > A solution I see is to check the variable in the paint method to get
> > > the correct value that needs for painting.
> >
> > The solution as it is now is done because a shape doesn't know on which
> > page it is. This is the reason you always need to set the KoTextPage
> > for every text shape.  I don't see how doing any check in the paint
> > method will help as that doesn't change the situation that the shape
> > doesn't know which page it is on.
>
> Sure I need a method to return the correct page for which the painting is
> done and that should be done via an interface that is the same in every
> application.

I think that KoTextPage is exactly that interface you are looking for :)

> > Notice that the solution of KoTextShapeData::relayoutFor() is only
> > needed for the shapes on a master page in kpresenter.
>
>                         
> I can't see how that could work for shapes that are shown on multiple
> pages. The shape is the same when it is used on a master page. 

Interesting; you use the exact same shape?
How can you have the same shape in 2 places? A shape only has one 
setPosition(), only one parent()

KWord uses the KWCopyShape for that purpose. 
An extra shape is used with an independent size and position which then just 
paints the original shape.

> So when we
> show a split view with two different pages and the same master page you
> can't call shape update as it will repaint both pages, which will lead to
> show the same page number on both pages.

That again leads me back to the above question; how can you expect the exact 
same shape to be shown twice in a document in different pages. That doesn't 
look possible to me.

> An other reason is that page movement will also change the page numbers.
> With your proposed solution we need to iterate over the pages (when e.g.
> a page is moved/deleted/added) and iterate over all shapes in there to
> set the page to the correct value. That is something I really like to
> avoid.

That entirely depends on your implementation of the KoTextPage interface; if 
you pass in the kopage for example it would be done automatically.

I'm sure that there is a miscommunication somewhere. You can't show the 
exact same shape instance on different pages and expect that to have the 
proper position/size/etc and also show different content. That would be 
impossible in any model view concept, including Flake.
So I guess you have something similar to the KWCopyShape, which makes this 
much easier.

Let me know what you have so I can think along to see how to solve this.
-- 
Thomas Zander
_______________________________________________
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