[Libreoffice] [PATCH] Fix for fdo#42178

Ivan Timofeev timofeev.i.s at gmail.com
Wed Nov 16 08:15:38 PST 2011


2011/11/16 Michael Stahl <mstahl at redhat.com>:
> 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,...))

Ok!

> 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?

Well, digging deeper... :-)

vcl/source/gdi/print3.cxx, PrinterController::getPageFile. You added

if (mpImplData->meJobState != view::PrintableState_JOB_STARTED)
{   // rhbz#657394: check that we are still printing...
    return PrinterController::PageSize();
}

Removing of these helps! If I have understood the code correctly:

When canceling in the print dialog, PrinterController::abortJob() is
called, and abortJob calls getPageFile. Your code above returns
*before* the call to printPage and this causes troubles so that the
last page will not be printed.

What is the solution for this?

Regards,
        Ivan


More information about the LibreOffice mailing list