diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-09-28 17:11:02 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-09-28 21:49:11 +0200 |
commit | 36cec4b92e8be9f47467539967672ba8906096e1 (patch) | |
tree | b0fc2aeb0735a95d0d99548720bbbe964ac9e363 /vcl | |
parent | 4c1bf9d7790ca037933c3c6825d48736572a1886 (diff) |
tdf#144139 gen backend doesn't crash but DrawOutDev is a null op for Printers
Change-Id: I90be3c3343890989eefce3d6a535ffa854d77698
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122782
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/salvtables.cxx | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index fd17e157d8ce..2d30c82e781b 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1285,7 +1285,19 @@ void SalInstanceWidget::DoRecursivePaint(vcl::Window* pWindow, const Point& rRen Size aTempLogicSize(xOutput->PixelToLogic(aChildSizePixel)); Size aRenderLogicSize(rOutput.PixelToLogic(aChildSizePixel)); - xOutput->DrawOutDev(Point(), aTempLogicSize, rRenderLogicPos, aRenderLogicSize, rOutput); + switch (rOutput.GetOutDevType()) + { + case OUTDEV_WINDOW: + case OUTDEV_VIRDEV: + xOutput->DrawOutDev(Point(), aTempLogicSize, rRenderLogicPos, aRenderLogicSize, + rOutput); + break; + case OUTDEV_PRINTER: + case OUTDEV_PDF: + xOutput->SetBackground(rOutput.GetBackground()); + xOutput->Erase(); + break; + } //set ReallyVisible to match Visible, we restore the original state after Paint WindowImpl* pImpl = pWindow->ImplGetWindowImpl(); @@ -1297,7 +1309,19 @@ void SalInstanceWidget::DoRecursivePaint(vcl::Window* pWindow, const Point& rRen pImpl->mbReallyVisible = bRVisible; - rOutput.DrawOutDev(rRenderLogicPos, aRenderLogicSize, Point(), aTempLogicSize, *xOutput); + switch (rOutput.GetOutDevType()) + { + case OUTDEV_WINDOW: + case OUTDEV_VIRDEV: + rOutput.DrawOutDev(rRenderLogicPos, aRenderLogicSize, Point(), aTempLogicSize, + *xOutput); + break; + case OUTDEV_PRINTER: + case OUTDEV_PDF: + rOutput.DrawBitmapEx(rRenderLogicPos, aRenderLogicSize, + xOutput->GetBitmapEx(Point(), aTempLogicSize)); + break; + } xOutput.disposeAndClear(); |