[Libreoffice-commits] core.git: vcl/win

Tim Eves tim_eves at sil.org
Sat Mar 19 09:44:56 UTC 2016


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

New commits:
commit 0eea1465a06119903fca5f5b6dfe5b05a80546ba
Author: Tim Eves <tim_eves at 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 <ci at libreoffice.org>
    Reviewed-by: Martin Hosken <martin_hosken at 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;


More information about the Libreoffice-commits mailing list