> An easy solution might be to "move all the code from the beginning of > `PrintNextPage` until the dc->BeginPage() into the "PrePrintNextPage()" > function.
That sounds right.
> Then, before a similar surface is created, a dc->BeginPage() call already > happened. To do this, I need some more clarification on this code: > > > http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsSimplePageSequence.cpp#620 > > * can PresContext()->IsRootPaginatedDocument() be false at any time? The > `PrintNextPage()` function is only called for printing to paper - it's not > called for preview. Therefore, the PresContext is always a > paginatedDocument? >
Yes. (It is for print preview too.)
> * the function might call `dc->BeginPage()` multiple times. Shouldn't this > function add only one page to the output? Is this a bug or a feature? >
What Daniel said. I'm not sure how you should handle print-selection --- probably just disable the callbacks and print whatever's already in the canvases, or refactor print-selection so we don't do this loop here.
Rob -- “You have heard that it was said, ‘Love your neighbor and hate your enemy.’ But I tell you, love your enemies and pray for those who persecute you, that you may be children of your Father in heaven. ... If you love those who love you, what reward will you get? Are not even the tax collectors doing that? And if you greet only your own people, what are you doing more than others?" [Matthew 5:43-47] _______________________________________________ dev-tech-layout mailing list dev-tech-layout@list... https://lists.mozilla.org/listinfo/dev-tech-layout