From ebe3fd529195ae1edf5daeab197bbb3cfec4143c Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Mon, 31 Oct 2016 04:37:25 +0200 Subject: [PATCH] Reduce number of arguments The font is already a member of the class, and the EM height is unused. Change-Id: Ice2eb2bb3e4b491bcb93123e1c3a08170cdaa50b --- vcl/inc/win/winlayout.hxx | 2 +- vcl/win/gdi/winlayout.cxx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vcl/inc/win/winlayout.hxx b/vcl/inc/win/winlayout.hxx index 04fc1353f9df..c02535177a0c 100755 --- a/vcl/inc/win/winlayout.hxx +++ b/vcl/inc/win/winlayout.hxx @@ -501,7 +501,7 @@ private: D2DWriteTextOutRenderer & operator = (const D2DWriteTextOutRenderer &) = delete; bool GetDWriteFaceFromHDC(HDC hDC, IDWriteFontFace ** ppFontFace, float * lfSize) const; - bool GetDWriteInkBox(IDWriteFontFace & rFontFace, SalLayout const &rLayout, float const lfEmHeight, Rectangle &) const; + bool GetDWriteInkBox(SalLayout const &rLayout, Rectangle &) const; ID2D1Factory * mpD2DFactory; IDWriteFactory * mpDWriteFactory; diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index 658641e40643..50f6602db6ac 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -3455,7 +3455,7 @@ bool D2DWriteTextOutRenderer::operator ()(SalLayout const &rLayout, HDC hDC, } Rectangle bounds; - bool succeeded = GetDWriteInkBox(*mpFontFace, rLayout, mlfEmHeight, bounds); + bool succeeded = GetDWriteInkBox(rLayout, bounds); succeeded &= BindDC(hDC, bounds); // Update the bounding rect. ID2D1SolidColorBrush* pBrush = nullptr; @@ -3652,12 +3652,12 @@ bool D2DWriteTextOutRenderer::GetDWriteFaceFromHDC(HDC hDC, IDWriteFontFace ** p return succeeded; } -bool D2DWriteTextOutRenderer::GetDWriteInkBox(IDWriteFontFace & rFontFace, SalLayout const &rLayout, float const /*lfEmHeight*/, Rectangle & rOut) const +bool D2DWriteTextOutRenderer::GetDWriteInkBox(SalLayout const &rLayout, Rectangle & rOut) const { rOut.SetEmpty(); DWRITE_FONT_METRICS aFontMetrics; - rFontFace.GetMetrics(&aFontMetrics); + mpFontFace->GetMetrics(&aFontMetrics); Point aPos; sal_GlyphId nLGlyph; @@ -3685,7 +3685,7 @@ bool D2DWriteTextOutRenderer::GetDWriteInkBox(IDWriteFontFace & rFontFace, SalLa if (bVertical) { DWRITE_FONT_METRICS aFM; - rFontFace.GetMetrics(&aFM); + mpFontFace->GetMetrics(&aFM); nYDiff = (aFM.ascent - aFM.descent) * mlfEmHeight / aFM.designUnitsPerEm; }