On Mon, 2007-07-02 at 12:35 +0200, Cor Nouws wrote: > What will be the unwanted effect? > What is the purpose of the margin check?
> Currently, because the different headers/footers are ignored when there > are different margins, as a result, both the different headers/footers > and different margins are lost. > Doesn't look as a gain to me. > Probably I miss something here? IIRC they are currently lost if there is no explicit page break anywhere to use to recover the situation. If there *is* one then the word exporter should be able to detect that at this page-break writer would have automatically moved to a new page style. At that point the exporter can then emit a new section at that point with the appropriate margins and headers/footers of the page descriptor that writer would have automatically selected to use. Let-me-see, if we create a writer document with a title page style and set the margins to e.g. 5 cm left/right and then insert a page break and set the margins of the following page style to e.g. 3 cm left/right. Then that should be an example of a document which the current code will do the right thing with. It'll see that it cannot be expressed as a single word section. Then emit things correctly for Word to render the first page correctly, then see the page break and detect that the writer selected pagedescriptor needs a new word section, emit one and set the margins and headers etc for word. That document should work correctly, and dropping the margin test will break it. We'd end up with 5cm left/right on all pages. Now in writer if we substitute the page break with a text flow break by instead whacking the return key a lot, and e.g. change the headers/footers of the title vs default style then that should be an example of the type of document that the current code doesn't export. i.e. the 2nd page in word will be the same as the 1st page. Making the title/follow page test more lax would resolve this, but break the other case as things stand. Here's a possibility it *might* be possible to add (yet more) hackery here and gamble on likely use-cases. We could attempt to always export the title style + follow style as a single word section. By, in wrtw8sty.cxx, removing the sw::util::IsPlausableSingleWordSection test, i.e. with if (1), then we'd have to use the "title" page as the one to use for margin/page size properties, as it would be one guaranteed to be used, while the following page is only probably going to be used. So we'd also basically need to remove pPdFmt = &rFollowFmt; and substitute with something like bTitleExport = true. And now convert the existing tests for exporting title page properties of "if( pPdFmt != pPdFirstPgFmt )" to "if ( bTitleExport )" instead. The outcome should be that now when we encounter a writer title page we would always export a word section with title property set and the correct header/footer content. The margins of the "follow" pages would be totally wrong in word if they don't match that of the "title page", but at least they'd have the right header/footer content. And then the *other* use of IsPlausableSingleWordSection in ww8atr.cxx would remain untouched, and continue to detect at a hard page-break that there's been a change of writer page descriptor that doesn't fit the word model and fix things up by exporting a new section. So.. a) the scenario of importing a word doc and re-exporting it should remain unchanged b) the scenario of someone inserting a title page and inserting a page break to move to the next page should remain visually unchanged in word c) the scenario of a title page without a page break where the margins match would remain unchanged d) the scenario of a title page without a page break where the margins mis-match would change, but only on the follow pages. Those follow pages would now still have the margins of the title page, but with the header/footer of the writer follow pages. hmm, puke!, but maybe worth a look. C. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
