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

List:       koffice-devel
Subject:    Page Variable Support
From:       Thorsten Zachmann <t.zachmann () zagge ! de>
Date:       2009-08-20 4:32:39
Message-ID: 200908200632.40224.t.zachmann () zagge ! de
[Download RAW message or body]

Hello Thomas,

in https://bugs.kde.org/show_bug.cgi?id=187838 you commented the following.

--- Comment #2 from Thomas Zander <zander kde org>  2009-08-11 16:24:27 ---
KPresenter should use KoTextShapeData::setPage(KoTextPage* textpage);
It should also call KoTextShapeData::relayoutFor(KoTextPage &textPage); from
the paint method in case the shape is used on more than one page (for instance
in a header/footer).

Last it should use the KoCanvasResourceProvider to set the property
KoInlineObject::PageCount with a value of the number of pages (well, slides, I
guess) in the current document.

--

In order to get into that stuff I had a look at kword to see how it works and 
found a problem with the above solution. 

If you a have a document with a header that shows the current page and at 
least two headers are visible at the same time (page 1 and 2), in the header 2 
is displayed instead of 1. The same happens in split view when 2 different 
pages are shown. See the following screen shot: 

http://www.zagge.de/files/variable.png

The problem is due to the relayoutFor triggers a repaint of both shapes. The 
same would happen in kopageapp applications when multiple pages are shown. 

A solution I see is to check the variable in the paint method to get the 
correct value that needs for painting.
This would also mean no need to iterate over all shapes and cast their user 
data to a KoTextShapeData when the page is changed which I would really like 
to avoid as it mean I need to call special code for the text shape each time 
the page is changed. It would also fix the update for kword as now variables 
on further pages also show 2 in the header and are never updated.
This was also the way it was implemented in koffice 1.x

Thorsten  
_______________________________________________
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