-
Pierre Ducroquet authored
This patch refactors a bit the KoTextLayoutRootAreaProvider. It extends the provideNext call by adding a constraints structure. This structure contains so far the masterPageName and the page number of the requested new rootArea. This way, the provider don't have to sneak in layout specific data. It also adds a way for KoTextLayoutRootAreaProvider to help the layout and fix inserting a new page (by adding lines to a paragraph for instance) before a page break changing the page style. Some more explanations regarding this bug : - Page 1, style AAA * page break, requesting style BBB - Page 2, style BBB If you add more data to the page 1, then dynamically the layout should do : - Page 1, style AAA - Page 2, style AAA * page break, requesting style BBB - Page 3, style BBB But the layout did recycle the page 2, leading to : - Page 1, style AAA - Page 2, style BBB * page break, requesting style BBB - Page 3, style BBB Reloading the document leads to a correct layout. This refactoring also simplifies the page style management since the RootAreaProvider no longer has to mess with the document to guess the proper page style, and removes some duplicated code in KoTextDocumentLayout. Thanks to Camilla Boemann for all the reviews. REVIEW: 120733
8ab38f4f