Chromium Code Reviews| Index: xfa/fxfa/app/xfa_textlayout.cpp |
| diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp |
| index b2030814bc339ac3ef9d180549f3b719949aca6f..926ed282c462330e2abef3d93b7b616966b28f52 100644 |
| --- a/xfa/fxfa/app/xfa_textlayout.cpp |
| +++ b/xfa/fxfa/app/xfa_textlayout.cpp |
| @@ -275,8 +275,7 @@ void CXFA_TextParser::ParseTagInfo(CFDE_XMLNode* pXMLNode, |
| CFDE_XMLElement* pXMLElement = static_cast<CFDE_XMLElement*>(pXMLNode); |
| pXMLElement->GetLocalTagName(wsName); |
| tagProvider.SetTagNameObj(wsName); |
| - uint32_t dwHashCode = |
| - FX_HashCode_String_GetW(wsName.c_str(), wsName.GetLength(), TRUE); |
| + uint32_t dwHashCode = FX_HashCode_GetW(wsName.AsStringC(), true); |
| static const int32_t s_iCount = sizeof(s_XFATagName) / sizeof(uint32_t); |
| CFX_DSPATemplate<uint32_t> lookup; |
| tagProvider.m_bTagAviliable = |
| @@ -613,8 +612,7 @@ FX_BOOL CXFA_TextParser::GetTabstops( |
| break; |
| case XFA_TABSTOPSSTATUS_Location: |
| if (ch == ' ') { |
| - uint32_t dwHashCode = FX_HashCode_String_GetW( |
| - wsAlign.c_str(), wsAlign.GetLength(), TRUE); |
| + uint32_t dwHashCode = FX_HashCode_GetW(wsAlign.AsStringC(), true); |
| CXFA_Measurement ms(CFX_WideStringC(pTabStops + iLast, iCur - iLast)); |
| FX_FLOAT fPos = ms.ToUnit(XFA_UNIT_Pt); |
| pTabstopContext->Append(dwHashCode, fPos); |
| @@ -628,8 +626,7 @@ FX_BOOL CXFA_TextParser::GetTabstops( |
| } |
| } |
| if (!wsAlign.IsEmpty()) { |
| - uint32_t dwHashCode = |
| - FX_HashCode_String_GetW(wsAlign.c_str(), wsAlign.GetLength(), TRUE); |
| + uint32_t dwHashCode = FX_HashCode_GetW(wsAlign.AsStringC(), true); |
| CXFA_Measurement ms(CFX_WideStringC(pTabStops + iLast, iCur - iLast)); |
| FX_FLOAT fPos = ms.ToUnit(XFA_UNIT_Pt); |
| pTabstopContext->Append(dwHashCode, fPos); |
| @@ -1644,12 +1641,12 @@ void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle* pStyle, |
| XFA_TABSTOPS* pTabstops = |
| m_pTabstopContext->m_tabstops.GetDataPtr(iTabstopsIndex); |
| uint32_t dwAlgin = pTabstops->dwAlign; |
|
Lei Zhang
2016/04/23 01:33:29
s/dwAlgin/dwAlign/
Tom Sepez
2016/04/25 16:50:21
Done, global grep for Algin.
|
| - if (dwAlgin == FX_HashCode_String_GetW(L"center", 6)) { |
| + if (dwAlgin == FX_HashCode_GetW(L"center", false)) { |
| fLeft = pPiece->rtPiece.width / 2.0f; |
| - } else if (dwAlgin == FX_HashCode_String_GetW(L"right", 5) || |
| - dwAlgin == FX_HashCode_String_GetW(L"before", 6)) { |
| + } else if (dwAlgin == FX_HashCode_GetW(L"right", false) || |
| + dwAlgin == FX_HashCode_GetW(L"before", false)) { |
| fLeft = pPiece->rtPiece.width; |
| - } else if (dwAlgin == FX_HashCode_String_GetW(L"decimal", 7)) { |
| + } else if (dwAlgin == FX_HashCode_GetW(L"decimal", false)) { |
| int32_t iChars = pPiece->iChars; |
| for (int32_t i = 0; i < iChars; i++) { |
| if (pPiece->pszText[i] == L'.') { |