[Libreoffice] [PATCH] Fix for fdo#42178

Michael Stahl mstahl at redhat.com
Wed Nov 16 06:35:47 PST 2011


On 16/11/11 14:35, Ivan Timofeev wrote:
> Hi there,
> 
> I have fixed https://bugs.freedesktop.org/show_bug.cgi?id=42178 :-) ,
> but I think an additional review will not be superfluous, since I am
> still a newbie.
> 
> The fact is SwDocShell::GetWrtShell() always returns 0 in page
> preview. And Writer dies due to that in "lcl_GetPrintUIOptions"
> function (sw/source/ui/uno/unotxdoc.cxx).

ah yes, the ever-reocurring "this special document is missing this or
that shell" problem.
your workaround looks good (but please add an assertion for the case
that we don't get any page number, i.e. OSL_ENSURE(pPreView,...))

> The second patch makes testing of the first one easier. :-) Because,
> when you press "Cancel" in a print dialog, then make changes to a doc
> and open a print dialog again, you currently will not see any effect.
> Options will not be updated. The patch fixes this.

isn't m_pPrintUIOptions supposed to be deleted when
SwXTextDocument::render is called for the last page (and there is
specific code in vcl to ensure that this is done even on cancel)?

hmm... could be that i broke that... is the m_pPrintUIOptions really not
deleted for you?

the XRenderable implementation in writer is quite braindamaged imho with
storing stuff in SwXTextDocument members; while debugging printing
crashes a couple of weeks ago i noticed that in Draw the XModel
implementation does not implement XRenderable itself but creates an
extra class for it, which wouldn't have these ridiculous problems
because then every print job gets its own instance (but refactoring that
in writer is going to be some work...).

thanks for digging into this,
 michael



More information about the LibreOffice mailing list