From koffice-devel Thu May 19 12:38:20 2011 From: "C. Boemann" Date: Thu, 19 May 2011 12:38:20 +0000 To: koffice-devel Subject: Re: How does kword implement the pagination of pages? Message-Id: <201105191438.20936.cbo () boemann ! dk> X-MARC-Message: https://marc.info/?l=koffice-devel&m=130580874131186 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