diff options
author | tsepez <tsepez@chromium.org> | 2016-06-06 10:51:58 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-06 10:51:58 -0700 |
commit | 48ddd86c45b437151d660758befbebec242d407d (patch) | |
tree | a61201d16145b605c3e3fbf5f951be6b5ff2db1a /xfa/fde | |
parent | 884b4f942d510974e713361b84a717340eb928b9 (diff) | |
download | pdfium-48ddd86c45b437151d660758befbebec242d407d.tar.xz |
Make GetDevFont() return a CFX_Font* instead of void*
Then we can remove a bunch of casts.
Review-Url: https://codereview.chromium.org/2033243004
Diffstat (limited to 'xfa/fde')
-rw-r--r-- | xfa/fde/fde_gedevice.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/xfa/fde/fde_gedevice.cpp b/xfa/fde/fde_gedevice.cpp index 8834bd8922..8370b2fbef 100644 --- a/xfa/fde/fde_gedevice.cpp +++ b/xfa/fde/fde_gedevice.cpp @@ -110,10 +110,9 @@ FX_BOOL CFDE_RenderDevice::DrawString(CFDE_Brush* pBrush, int32_t iCount, FX_FLOAT fFontSize, const CFX_Matrix* pMatrix) { - ASSERT(pBrush != NULL && pFont != NULL && pCharPos != NULL && iCount > 0); + ASSERT(pBrush && pFont && pCharPos && iCount > 0); CFX_FontCache* pCache = CFX_GEModule::Get()->GetFontCache(); - CFX_Font* pFxFont = (CFX_Font*)pFont->GetDevFont(); - + CFX_Font* pFxFont = pFont->GetDevFont(); FX_ARGB argb = pBrush->GetColor(); if ((pFont->GetFontStyles() & FX_FONTSTYLE_Italic) != 0 && !pFxFont->IsItalic()) { @@ -149,9 +148,8 @@ FX_BOOL CFDE_RenderDevice::DrawString(CFDE_Brush* pBrush, pCP->m_GlyphIndex &= 0x00FFFFFF; pCP->m_bFontStyle = FALSE; if (pCurFont != pSTFont) { - if (pCurFont != NULL) { - pFxFont = (CFX_Font*)pCurFont->GetDevFont(); - + if (pCurFont) { + pFxFont = pCurFont->GetDevFont(); #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ FxFont.SetFace(pFxFont->GetFace()); m_pDevice->DrawNormalText(iCurCount, pCurCP, &FxFont, pCache, @@ -171,9 +169,8 @@ FX_BOOL CFDE_RenderDevice::DrawString(CFDE_Brush* pBrush, } pCP++; } - if (pCurFont != NULL && iCurCount) { - pFxFont = (CFX_Font*)pCurFont->GetDevFont(); - + if (pCurFont && iCurCount) { + pFxFont = pCurFont->GetDevFont(); #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ FxFont.SetFace(pFxFont->GetFace()); FX_BOOL bRet = m_pDevice->DrawNormalText( |