diff options
author | tsepez <tsepez@chromium.org> | 2016-03-25 14:19:51 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-25 14:19:51 -0700 |
commit | 736f28ab2434e2da1de66ff91b64741483ff9cba (patch) | |
tree | ce46fdc563828d8ae671f898c551311d85ecea0f /xfa/fde/css | |
parent | 342f6fa66f6d843fe07d9b6a133656f83c8d62f6 (diff) | |
download | pdfium-736f28ab2434e2da1de66ff91b64741483ff9cba.tar.xz |
Remove FX_DWORD from XFA.
Review URL: https://codereview.chromium.org/1830323006
Diffstat (limited to 'xfa/fde/css')
-rw-r--r-- | xfa/fde/css/fde_csscache.cpp | 8 | ||||
-rw-r--r-- | xfa/fde/css/fde_cssdatatable.cpp | 16 | ||||
-rw-r--r-- | xfa/fde/css/fde_cssdeclaration.cpp | 10 | ||||
-rw-r--r-- | xfa/fde/css/fde_cssstyleselector.cpp | 26 | ||||
-rw-r--r-- | xfa/fde/css/fde_cssstylesheet.cpp | 14 | ||||
-rw-r--r-- | xfa/fde/css/fde_csssyntax.cpp | 4 |
6 files changed, 39 insertions, 39 deletions
diff --git a/xfa/fde/css/fde_csscache.cpp b/xfa/fde/css/fde_csscache.cpp index 4b7dd4b302..49934aee6d 100644 --- a/xfa/fde/css/fde_csscache.cpp +++ b/xfa/fde/css/fde_csscache.cpp @@ -112,13 +112,13 @@ FDE_CSSTagCache::FDE_CSSTagCache(FDE_CSSTagCache* parent, FX_POSITION pos = pTag->GetFirstAttribute(); while (pos != NULL) { pTag->GetNextAttribute(pos, wsName, wsValue); - FX_DWORD dwNameHash = + uint32_t dwNameHash = FX_HashCode_String_GetW(wsName.GetPtr(), wsName.GetLength(), TRUE); - static const FX_DWORD s_dwIDHash = FX_HashCode_String_GetW(L"id", 2, TRUE); - static const FX_DWORD s_dwClassHash = + static const uint32_t s_dwIDHash = FX_HashCode_String_GetW(L"id", 2, TRUE); + static const uint32_t s_dwClassHash = FX_HashCode_String_GetW(L"class", 5, TRUE); if (dwNameHash == s_dwClassHash) { - FX_DWORD dwHash = + uint32_t dwHash = FX_HashCode_String_GetW(wsValue.GetPtr(), wsValue.GetLength()); dwClassHashs.Add(dwHash); } else if (dwNameHash == s_dwIDHash) { diff --git a/xfa/fde/css/fde_cssdatatable.cpp b/xfa/fde/css/fde_cssdatatable.cpp index e2dff57008..6abe5a7a26 100644 --- a/xfa/fde/css/fde_cssdatatable.cpp +++ b/xfa/fde/css/fde_cssdatatable.cpp @@ -87,9 +87,9 @@ CFX_FloatRect FDE_CSSBoundaryToRect(IFDE_CSSBoundaryStyle* pBoundStyle, } return rect; } -FX_DWORD FDE_CSSFontStyleToFDE(IFDE_CSSFontStyle* pFontStyle) { +uint32_t FDE_CSSFontStyleToFDE(IFDE_CSSFontStyle* pFontStyle) { FXSYS_assert(pFontStyle != NULL); - FX_DWORD dwFontStyle = FX_FONTSTYLE_Normal; + uint32_t dwFontStyle = FX_FONTSTYLE_Normal; if (pFontStyle->GetFontStyle() == FDE_CSSFONTSTYLE_Italic) { dwFontStyle |= FX_FONTSTYLE_Italic; } @@ -560,10 +560,10 @@ FDE_LPCCSSPERSUDOTABLE FDE_GetCSSPersudoByEnum(FDE_CSSPERSUDO ePersudo) { FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByName(const FX_WCHAR* pszName, int32_t iLength) { FXSYS_assert(pszName != NULL && iLength > 0); - FX_DWORD dwHash = FX_HashCode_String_GetW(pszName, iLength, TRUE); + uint32_t dwHash = FX_HashCode_String_GetW(pszName, iLength, TRUE); int32_t iEnd = FDE_CSSPROPERTY_MAX - 1; int32_t iMid, iStart = 0; - FX_DWORD dwMid; + uint32_t dwMid; do { iMid = (iStart + iEnd) / 2; dwMid = g_FDE_CSSProperties[iMid].dwHash; @@ -584,10 +584,10 @@ FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByName( const FX_WCHAR* pszName, int32_t iLength) { FXSYS_assert(pszName != NULL && iLength > 0); - FX_DWORD dwHash = FX_HashCode_String_GetW(pszName, iLength, TRUE); + uint32_t dwHash = FX_HashCode_String_GetW(pszName, iLength, TRUE); int32_t iEnd = FDE_CSSPROPERTYVALUE_MAX - 1; int32_t iMid, iStart = 0; - FX_DWORD dwMid; + uint32_t dwMid; do { iMid = (iStart + iEnd) / 2; dwMid = g_FDE_CSSPropertyValues[iMid].dwHash; @@ -651,10 +651,10 @@ FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName(const FX_WCHAR* pszName, FDE_LPCCSSCOLORTABLE FDE_GetCSSColorByName(const FX_WCHAR* pszName, int32_t iLength) { FXSYS_assert(pszName != NULL && iLength > 0); - FX_DWORD dwHash = FX_HashCode_String_GetW(pszName, iLength, TRUE); + uint32_t dwHash = FX_HashCode_String_GetW(pszName, iLength, TRUE); int32_t iEnd = sizeof(g_FDE_CSSColors) / sizeof(FDE_CSSCOLORTABLE) - 1; int32_t iMid, iStart = 0; - FX_DWORD dwMid; + uint32_t dwMid; do { iMid = (iStart + iEnd) / 2; dwMid = g_FDE_CSSColors[iMid].dwHash; diff --git a/xfa/fde/css/fde_cssdeclaration.cpp b/xfa/fde/css/fde_cssdeclaration.cpp index 1340dae2c5..5517d85cb2 100644 --- a/xfa/fde/css/fde_cssdeclaration.cpp +++ b/xfa/fde/css/fde_cssdeclaration.cpp @@ -119,18 +119,18 @@ FX_BOOL CFDE_CSSDeclaration::AddProperty(const FDE_CSSPROPERTYARGS* pArgs, } bImportant = TRUE; } - const FX_DWORD dwType = pArgs->pProperty->dwType; + const uint32_t dwType = pArgs->pProperty->dwType; switch (dwType & 0x0F) { case FDE_CSSVALUETYPE_Primitive: { - static const FX_DWORD g_ValueGuessOrder[] = { + static const uint32_t g_ValueGuessOrder[] = { FDE_CSSVALUETYPE_MaybeNumber, FDE_CSSVALUETYPE_MaybeEnum, FDE_CSSVALUETYPE_MaybeColor, FDE_CSSVALUETYPE_MaybeURI, FDE_CSSVALUETYPE_MaybeFunction, FDE_CSSVALUETYPE_MaybeString, }; static const int32_t g_ValueGuessCount = - sizeof(g_ValueGuessOrder) / sizeof(FX_DWORD); + sizeof(g_ValueGuessOrder) / sizeof(uint32_t); for (int32_t i = 0; i < g_ValueGuessCount; ++i) { - const FX_DWORD dwMatch = dwType & g_ValueGuessOrder[i]; + const uint32_t dwMatch = dwType & g_ValueGuessOrder[i]; if (dwMatch == 0) { continue; } @@ -539,7 +539,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseValueListProperty( FX_WCHAR separator = (pArgs->pProperty->eName == FDE_CSSPROPERTY_FontFamily) ? ',' : ' '; CFDE_CSSValueListParser parser(pszValue, iValueLen, separator); - const FX_DWORD dwType = pArgs->pProperty->dwType; + const uint32_t dwType = pArgs->pProperty->dwType; FDE_CSSPRIMITIVETYPE eType; CFDE_CSSValueArray list; while (parser.NextValue(eType, pszValue, iValueLen)) { diff --git a/xfa/fde/css/fde_cssstyleselector.cpp b/xfa/fde/css/fde_cssstyleselector.cpp index ebf2d262c1..39d0df04c7 100644 --- a/xfa/fde/css/fde_cssstyleselector.cpp +++ b/xfa/fde/css/fde_cssstyleselector.cpp @@ -85,9 +85,9 @@ FDE_CSSTEXTEMPHASISMARK CFDE_CSSComputedStyle::GetTextEmphasisMark() const { } FDE_CSSRuleData::FDE_CSSRuleData(IFDE_CSSSelector* pSel, IFDE_CSSDeclaration* pDecl, - FX_DWORD dwPos) + uint32_t dwPos) : pSelector(pSel), pDeclaration(pDecl), dwPriority(dwPos), pNext(NULL) { - static const FX_DWORD s_Specific[5] = {0x00010000, 0x00010000, 0x00100000, + static const uint32_t s_Specific[5] = {0x00010000, 0x00010000, 0x00100000, 0x00100000, 0x01000000}; for (; pSel != NULL; pSel = pSel->GetNextSelector()) { FDE_CSSSELECTORTYPE eType = pSel->GetType(); @@ -106,12 +106,12 @@ void CFDE_CSSRuleCollection::Clear() { m_iSelectors = 0; } void CFDE_CSSRuleCollection::AddRulesFrom(const CFDE_CSSStyleSheetArray& sheets, - FX_DWORD dwMediaList, + uint32_t dwMediaList, IFX_FontMgr* pFontMgr) { int32_t iSheets = sheets.GetSize(); for (int32_t i = 0; i < iSheets; ++i) { IFDE_CSSStyleSheet* pSheet = sheets.GetAt(i); - if (FX_DWORD dwMatchMedia = pSheet->GetMediaList() & dwMediaList) { + if (uint32_t dwMatchMedia = pSheet->GetMediaList() & dwMediaList) { int32_t iRules = pSheet->CountRules(); for (int32_t j = 0; j < iRules; j++) { AddRulesFrom(pSheet, pSheet->GetRule(j), dwMatchMedia, pFontMgr); @@ -121,7 +121,7 @@ void CFDE_CSSRuleCollection::AddRulesFrom(const CFDE_CSSStyleSheetArray& sheets, } void CFDE_CSSRuleCollection::AddRulesFrom(IFDE_CSSStyleSheet* pStyleSheet, IFDE_CSSRule* pRule, - FX_DWORD dwMediaList, + uint32_t dwMediaList, IFX_FontMgr* pFontMgr) { switch (pRule->GetType()) { case FDE_CSSRULETYPE_Style: { @@ -179,7 +179,7 @@ void CFDE_CSSRuleCollection::AddRulesFrom(IFDE_CSSStyleSheet* pStyleSheet, } } void CFDE_CSSRuleCollection::AddRuleTo(CFX_MapPtrToPtr& map, - FX_DWORD dwKey, + uint32_t dwKey, IFDE_CSSSelector* pSel, IFDE_CSSDeclaration* pDecl) { void* pKey = (void*)(uintptr_t)dwKey; @@ -298,7 +298,7 @@ void CFDE_CSSStyleSelector::SetStylePriority( FDE_CSSSTYLESHEETPRIORITY ePriority) { m_ePriorities[ePriority] = eType; } -void CFDE_CSSStyleSelector::UpdateStyleIndex(FX_DWORD dwMediaList) { +void CFDE_CSSStyleSelector::UpdateStyleIndex(uint32_t dwMediaList) { Reset(); m_pRuleDataStore = FX_CreateAllocator(FX_ALLOCTYPE_Static, 1024, 0); FXSYS_assert(m_pRuleDataStore != NULL); @@ -372,7 +372,7 @@ void CFDE_CSSStyleSelector::MatchRules(FDE_CSSTagCache* pCache, FX_BOOL CFDE_CSSStyleSelector::MatchSelector(FDE_CSSTagCache* pCache, IFDE_CSSSelector* pSel, FDE_CSSPERSUDO ePersudoType) { - FX_DWORD dwHash; + uint32_t dwHash; while (pSel != NULL && pCache != NULL) { switch (pSel->GetType()) { case FDE_CSSSELECTORTYPE_Descendant: @@ -433,14 +433,14 @@ void CFDE_CSSStyleSelector::ComputeStyle( } CFDE_CSSDeclaration* pDecl = NULL; CFX_WideStringC wsAttri, wsValue; - FX_DWORD dwAttriHash; + uint32_t dwAttriHash; do { pTag->GetNextAttribute(pos, wsAttri, wsValue); dwAttriHash = FX_HashCode_String_GetW(wsAttri.GetPtr(), wsAttri.GetLength(), TRUE); - static const FX_DWORD s_dwStyleHash = + static const uint32_t s_dwStyleHash = FX_HashCode_String_GetW(L"style", 5, TRUE); - static const FX_DWORD s_dwAlignHash = + static const uint32_t s_dwAlignHash = FX_HashCode_String_GetW(L"align", 5, TRUE); if (dwAttriHash == s_dwStyleHash) { if (pDecl == NULL) { @@ -1743,8 +1743,8 @@ FDE_CSSWHITESPACE CFDE_CSSStyleSelector::ToWhiteSpace( return FDE_CSSWHITESPACE_Normal; } } -FX_DWORD CFDE_CSSStyleSelector::ToTextDecoration(IFDE_CSSValueList* pValue) { - FX_DWORD dwDecoration = 0; +uint32_t CFDE_CSSStyleSelector::ToTextDecoration(IFDE_CSSValueList* pValue) { + uint32_t dwDecoration = 0; for (int32_t i = pValue->CountValues() - 1; i >= 0; --i) { IFDE_CSSPrimitiveValue* pPrimitive = (IFDE_CSSPrimitiveValue*)pValue->GetValue(i); diff --git a/xfa/fde/css/fde_cssstylesheet.cpp b/xfa/fde/css/fde_cssstylesheet.cpp index e0f8fa6cdf..bc27545dca 100644 --- a/xfa/fde/css/fde_cssstylesheet.cpp +++ b/xfa/fde/css/fde_cssstylesheet.cpp @@ -49,7 +49,7 @@ IFDE_CSSStyleSheet* IFDE_CSSStyleSheet::LoadFromStream( const CFX_WideString& szUrl, IFX_Stream* pStream, uint16_t wCodePage, - FX_DWORD dwMediaList) { + uint32_t dwMediaList) { CFDE_CSSStyleSheet* pStyleSheet = new CFDE_CSSStyleSheet(dwMediaList); if (!pStyleSheet->LoadFromStream(szUrl, pStream, wCodePage)) { pStyleSheet->Release(); @@ -62,7 +62,7 @@ IFDE_CSSStyleSheet* IFDE_CSSStyleSheet::LoadFromBuffer( const FX_WCHAR* pBuffer, int32_t iBufSize, uint16_t wCodePage, - FX_DWORD dwMediaList) { + uint32_t dwMediaList) { CFDE_CSSStyleSheet* pStyleSheet = new CFDE_CSSStyleSheet(dwMediaList); if (!pStyleSheet->LoadFromBuffer(szUrl, pBuffer, iBufSize, wCodePage)) { pStyleSheet->Release(); @@ -70,7 +70,7 @@ IFDE_CSSStyleSheet* IFDE_CSSStyleSheet::LoadFromBuffer( } return pStyleSheet; } -CFDE_CSSStyleSheet::CFDE_CSSStyleSheet(FX_DWORD dwMediaList) +CFDE_CSSStyleSheet::CFDE_CSSStyleSheet(uint32_t dwMediaList) : m_wCodePage(FX_CODEPAGE_UTF8), m_wRefCount(1), m_dwMediaList(dwMediaList), @@ -106,11 +106,11 @@ void CFDE_CSSStyleSheet::Reset() { m_pAllocator = NULL; } } -FX_DWORD CFDE_CSSStyleSheet::AddRef() { +uint32_t CFDE_CSSStyleSheet::AddRef() { return ++m_wRefCount; } -FX_DWORD CFDE_CSSStyleSheet::Release() { - FX_DWORD dwRefCount = --m_wRefCount; +uint32_t CFDE_CSSStyleSheet::Release() { + uint32_t dwRefCount = --m_wRefCount; if (dwRefCount == 0) { delete this; } @@ -188,7 +188,7 @@ FX_BOOL CFDE_CSSStyleSheet::LoadFromSyntax(IFDE_CSSSyntaxParser* pSyntax) { } FDE_CSSSYNTAXSTATUS CFDE_CSSStyleSheet::LoadMediaRule( IFDE_CSSSyntaxParser* pSyntax) { - FX_DWORD dwMediaList = 0; + uint32_t dwMediaList = 0; CFDE_CSSMediaRule* pMediaRule = NULL; for (;;) { switch (pSyntax->DoSyntaxParse()) { diff --git a/xfa/fde/css/fde_csssyntax.cpp b/xfa/fde/css/fde_csssyntax.cpp index 2d0d972f77..8a905f69b4 100644 --- a/xfa/fde/css/fde_csssyntax.cpp +++ b/xfa/fde/css/fde_csssyntax.cpp @@ -30,7 +30,7 @@ CFDE_CSSSyntaxParser::CFDE_CSSSyntaxParser() m_iStreamPos(0), m_iPlaneSize(0), m_iTextDatLen(0), - m_dwCheck((FX_DWORD)-1), + m_dwCheck((uint32_t)-1), m_eMode(FDE_CSSSYNTAXMODE_RuleSet), m_eStatus(FDE_CSSSYNTAXSTATUS_None) {} CFDE_CSSSyntaxParser::~CFDE_CSSSyntaxParser() { @@ -69,7 +69,7 @@ void CFDE_CSSSyntaxParser::Reset(FX_BOOL bOnlyDeclaration) { m_pStream = NULL; m_iStreamPos = 0; m_iTextDatLen = 0; - m_dwCheck = (FX_DWORD)-1; + m_dwCheck = (uint32_t)-1; m_eStatus = FDE_CSSSYNTAXSTATUS_None; m_eMode = bOnlyDeclaration ? FDE_CSSSYNTAXMODE_PropertyName : FDE_CSSSYNTAXMODE_RuleSet; |