summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTim Eves <tim_eves@sil.org>2016-03-18 14:19:50 +0700
committerMartin Hosken <martin_hosken@sil.org>2016-03-19 09:44:28 +0000
commit0eea1465a06119903fca5f5b6dfe5b05a80546ba (patch)
treefe4e947646b397a331ca621fc6c40ec18ad454ec /vcl
parenteb778a1e6359df243783fee28d2ddbb7aac444f9 (diff)
Fix failure to print when using the D2DWrite path
It seems that D2D1DCRenderrTarget cannot bind to a DC on a printer device. Now whenever that attempt to bind the DC fails we run the legacy API path as a fallback. Change-Id: I6ad8d82e5280fd2dcf669310bab0f5bfc23a138a Reviewed-on: https://gerrit.libreoffice.org/23366 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Martin Hosken <martin_hosken@sil.org>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/win/gdi/winlayout.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index d67221e28253..572f6a946bab 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -3799,15 +3799,13 @@ bool D2DWriteTextOutRenderer::operator ()(WinLayout const &rLayout, HDC hDC,
return false;
if (!BindFont(hDC))
- return false;
- Rectangle bounds;
- bool succeeded = GetDWriteInkBox(*mpFontFace, rLayout, mlfEmHeight, bounds);
- if (pRectToErase)
{
- // Isn't this equivalent to simply doing: bounds = *pRectToErase ?
- bounds.Intersection(*pRectToErase);
- bounds.Union(*pRectToErase);
+ // If for any reason we can't bind fallback to legacy APIs.
+ return ExTextOutRenderer()(rLayout, hDC, pRectToErase, pPos, pGetNextGlypInfo);
}
+
+ Rectangle bounds;
+ bool succeeded = GetDWriteInkBox(*mpFontFace, rLayout, mlfEmHeight, bounds);
succeeded &= BindDC(hDC, bounds); // Update the bounding rect.
ID2D1SolidColorBrush* pBlackBrush = NULL;