summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2017-03-04 05:29:38 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2017-03-04 14:21:21 +0200
commit073d920ef5914b5dfe491dbaf7fb18ba56293b85 (patch)
treed3eb256c77131f026b087c81fd98521bf101191a
parent59460acff8a8cad0569fb4955945258ca1d5e3f2 (diff)
pEraseRect is always null
Simplify the code accordingly and make it return true for success. Change-Id: I661eea739e23b59ebff2573f52036b25ecb5a1ed
-rw-r--r--vcl/inc/win/winlayout.hxx3
-rw-r--r--vcl/win/gdi/winlayout.cxx16
2 files changed, 5 insertions, 14 deletions
diff --git a/vcl/inc/win/winlayout.hxx b/vcl/inc/win/winlayout.hxx
index 42b25b62c91f..2c6cc269fc3b 100644
--- a/vcl/inc/win/winlayout.hxx
+++ b/vcl/inc/win/winlayout.hxx
@@ -180,7 +180,6 @@ public:
virtual bool operator ()(CommonSalLayout const &rLayout,
SalGraphics &rGraphics,
HDC hDC,
- const Rectangle* pRectToErase,
Point* pPos, int* pGetNextGlypInfo) = 0;
};
@@ -195,7 +194,6 @@ public:
bool operator ()(CommonSalLayout const &rLayout,
SalGraphics &rGraphics,
HDC hDC,
- const Rectangle* pRectToErase,
Point* pPos, int* pGetNextGlypInfo) override;
};
@@ -220,7 +218,6 @@ public:
bool operator ()(CommonSalLayout const &rLayout,
SalGraphics &rGraphics,
HDC hDC,
- const Rectangle* pRectToErase,
Point* pPos, int* pGetNextGlypInfo) override;
inline bool BindDC(HDC hDC, Rectangle const & rRect = Rectangle(0, 0, 0, 0)) {
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index c884c9ef6580..21116d375fb4 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -265,10 +265,8 @@ TextOutRenderer & TextOutRenderer::get(bool bUseDWrite)
bool ExTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
SalGraphics & /*rGraphics*/,
HDC hDC,
- const Rectangle* pRectToErase,
Point* pPos, int* pGetNextGlypInfo)
{
- bool bGlyphs = false;
const GlyphItem* pGlyph;
HFONT hFont = static_cast<HFONT>(GetCurrentObject( hDC, OBJ_FONT ));
HFONT hAltFont = nullptr;
@@ -286,7 +284,6 @@ bool ExTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
}
while (rLayout.GetNextGlyphs(1, &pGlyph, *pPos, *pGetNextGlypInfo))
{
- bGlyphs = true;
WORD glyphWStr[] = { pGlyph->maGlyphId };
if (hAltFont && pGlyph->IsVertical() == bUseAltFont)
{
@@ -302,7 +299,7 @@ bool ExTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
DeleteObject(hAltFont);
}
- return (pRectToErase && bGlyphs);
+ return true;
}
D2DWriteTextOutRenderer::D2DWriteTextOutRenderer()
@@ -344,7 +341,6 @@ D2DWriteTextOutRenderer::~D2DWriteTextOutRenderer()
bool D2DWriteTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
SalGraphics &rGraphics,
HDC hDC,
- const Rectangle* pRectToErase,
Point* pPos, int* pGetNextGlypInfo)
{
if (!Ready())
@@ -353,7 +349,7 @@ bool D2DWriteTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
if (!BindFont(hDC))
{
// If for any reason we can't bind fallback to legacy APIs.
- return ExTextOutRenderer()(rLayout, rGraphics, hDC, pRectToErase, pPos, pGetNextGlypInfo);
+ return ExTextOutRenderer()(rLayout, rGraphics, hDC, pPos, pGetNextGlypInfo);
}
Rectangle bounds;
@@ -365,7 +361,6 @@ bool D2DWriteTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
succeeded &= SUCCEEDED(mpRT->CreateSolidColorBrush(D2D1::ColorF(GetRValue(bgrTextColor) / 255.0f, GetGValue(bgrTextColor) / 255.0f, GetBValue(bgrTextColor) / 255.0f), &pBrush));
HRESULT hr = S_OK;
- bool bGlyphs = false;
if (succeeded)
{
mpRT->BeginDraw();
@@ -373,7 +368,6 @@ bool D2DWriteTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
const GlyphItem* pGlyph;
while (rLayout.GetNextGlyphs(1, &pGlyph, *pPos, *pGetNextGlypInfo))
{
- bGlyphs = true;
UINT16 glyphIndices[] = { pGlyph->maGlyphId };
FLOAT glyphAdvances[] = { pGlyph->mnNewWidth };
DWRITE_GLYPH_OFFSET glyphOffsets[] = { { 0.0f, 0.0f }, };
@@ -403,7 +397,7 @@ bool D2DWriteTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
if (hr == D2DERR_RECREATE_TARGET)
CreateRenderTarget();
- return (succeeded && bGlyphs && pRectToErase);
+ return succeeded;
}
bool D2DWriteTextOutRenderer::BindFont(HDC hDC)
@@ -609,8 +603,8 @@ void WinSalGraphics::DrawTextLayout(const CommonSalLayout& rLayout, HDC hDC, boo
Point aPos(0, 0);
int nGlyphCount(0);
TextOutRenderer &render = TextOutRenderer::get(bUseDWrite);
- bool result = render(rLayout, *this, hDC, nullptr, &aPos, &nGlyphCount);
- assert(!result);
+ bool result = render(rLayout, *this, hDC, &aPos, &nGlyphCount);
+ assert(result);
}
void WinSalGraphics::DrawTextLayout(const CommonSalLayout& rLayout)