From cd0e00a305479505b9c759e86bc8ebfd4ecdc4f4 Mon Sep 17 00:00:00 2001 From: Jun Fang Date: Tue, 1 Dec 2015 12:03:21 +0800 Subject: Use c++ style casts in CPWL_Color::CPWL_Color() BUG=pdfium:281 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1481503002 . --- xfa/src/fxfa/src/app/xfa_textlayout.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/xfa/src/fxfa/src/app/xfa_textlayout.cpp b/xfa/src/fxfa/src/app/xfa_textlayout.cpp index 667fc11b4c..12e517de41 100644 --- a/xfa/src/fxfa/src/app/xfa_textlayout.cpp +++ b/xfa/src/fxfa/src/app/xfa_textlayout.cpp @@ -398,16 +398,15 @@ FX_FLOAT CXFA_TextParser::GetFontSize(IXFA_TextProvider* pTextProvider, int32_t CXFA_TextParser::GetHorScale(IXFA_TextProvider* pTextProvider, IFDE_CSSComputedStyle* pStyle, IFDE_XMLNode* pXMLNode) const { - if (pStyle != NULL) { + if (pStyle) { CFX_WideString wsValue; if (pStyle->GetCustomStyle(FX_WSTRC(L"xfa-font-horizontal-scale"), wsValue)) { return wsValue.GetInteger(); } while (pXMLNode) { - CXFA_TextParseContext* pContext = - (CXFA_TextParseContext*)m_mapXMLNodeToParseContext.GetValueAt( - pXMLNode); + CXFA_TextParseContext* pContext = static_cast( + m_mapXMLNodeToParseContext.GetValueAt(pXMLNode)); if (pContext && pContext->m_pParentStyle && pContext->m_pParentStyle->GetCustomStyle( FX_WSTRC(L"xfa-font-horizontal-scale"), wsValue)) { @@ -417,7 +416,7 @@ int32_t CXFA_TextParser::GetHorScale(IXFA_TextProvider* pTextProvider, } } if (CXFA_Font font = pTextProvider->GetFontNode()) { - return (int32_t)font.GetHorizontalScale(); + return static_cast(font.GetHorizontalScale()); } return 100; } -- cgit v1.2.3