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

List:       koffice-devel
Subject:    Re: How does kword implement the pagination of pages?
From:       "C. Boemann" <cbo () boemann ! dk>
Date:       2011-05-19 12:38:20
Message-ID: 201105191438.20936.cbo () boemann ! dk
[Download RAW message or body]

On Thursday 19 May 2011 13:26:22 赢 梁 wrote:
> Hi, there.
> Recently, I'm working on a project about implement a word-processor-like
> textedit. In this project, multiple pages is needed and we should be able
> to edit text in the multi-page textedit  just like in kword, in another
> word, I need to implement the function that users can select text covering
> different pages and after input in the previous page, overflow text should
> automatic be in the next page or after delete text in the previous page,
> some word that was in the next page will come up to the previous page.
> However, I failed to implement this function. I tried to search in the
> source code of kword, but failed too. Can anyone tell me how to do it?
> Thanks a lot.
> by binxxd9
Hi

Basically we store the data without pages, but just as one long list of 
paragraphs (for you that would be lines i guess)

We then have a layout pass that creates it's own set of structures that tell 
where in the data a new page starts. These structures are regenerated every 
time the user enters or deletes anything in the data. An optimization is that 
we only starts regenerating from the page the change was made, and it's also 
planned (but not implemented) top stop regenerating the pages if we catch up 
with a state where we now the remaining pages are placed correctly.

To not be too slow the layout process is not done all in one go but a number 
of pages at a time.

hope this helps
_______________________________________________
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