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>
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;
    {
        // 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);
    if (pRectToErase)
    {
        // Isn't this equivalent to simply doing: bounds = *pRectToErase ?
        bounds.Intersection(*pRectToErase);
        bounds.Union(*pRectToErase);
    }
    succeeded &= BindDC(hDC, bounds);   // Update the bounding rect.

    ID2D1SolidColorBrush* pBlackBrush = NULL;