vcl/win/gdi/winlayout.cxx |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 0eea1465a06119903fca5f5b6dfe5b05a80546ba
Author: Tim Eves <tim_e...@sil.org>
Date:   Fri Mar 18 14:19:50 2016 +0700

    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 <c...@libreoffice.org>
    Reviewed-by: Martin Hosken <martin_hos...@sil.org>

diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index d67221e..572f6a9 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;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to