diff options
Diffstat (limited to 'xfa/fde/css')
-rw-r--r-- | xfa/fde/css/fde_csscache.cpp | 19 | ||||
-rw-r--r-- | xfa/fde/css/fde_cssdatatable.cpp | 44 | ||||
-rw-r--r-- | xfa/fde/css/fde_cssdatatable.h | 18 | ||||
-rw-r--r-- | xfa/fde/css/fde_cssdeclaration.cpp | 33 | ||||
-rw-r--r-- | xfa/fde/css/fde_cssstyleselector.cpp | 12 | ||||
-rw-r--r-- | xfa/fde/css/fde_cssstylesheet.cpp | 16 | ||||
-rw-r--r-- | xfa/fde/css/fde_cssstylesheet.h | 7 |
7 files changed, 70 insertions, 79 deletions
diff --git a/xfa/fde/css/fde_csscache.cpp b/xfa/fde/css/fde_csscache.cpp index e23b4c6377..9a259e1844 100644 --- a/xfa/fde/css/fde_csscache.cpp +++ b/xfa/fde/css/fde_csscache.cpp @@ -29,26 +29,19 @@ FDE_CSSTagCache::FDE_CSSTagCache(FDE_CSSTagCache* parent, dwTagHash(0), iClassIndex(0), dwClassHashs(1) { - 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); - - CFX_WideString wsTag = pTag->GetTagName(); - dwTagHash = FX_HashCode_String_GetW(wsTag.c_str(), wsTag.GetLength(), TRUE); + static const uint32_t s_dwIDHash = FX_HashCode_GetW(L"id", true); + static const uint32_t s_dwClassHash = FX_HashCode_GetW(L"class", true); + dwTagHash = FX_HashCode_GetW(pTag->GetTagName().AsStringC(), true); for (auto it : *pTag) { CFX_WideString wsValue = it.first; CFX_WideString wsName = it.second; - - uint32_t dwNameHash = - FX_HashCode_String_GetW(wsName.c_str(), wsName.GetLength(), TRUE); - + uint32_t dwNameHash = FX_HashCode_GetW(wsName.AsStringC(), true); if (dwNameHash == s_dwClassHash) { - uint32_t dwHash = - FX_HashCode_String_GetW(wsValue.c_str(), wsValue.GetLength()); + uint32_t dwHash = FX_HashCode_GetW(wsValue.AsStringC(), false); dwClassHashs.Add(dwHash); } else if (dwNameHash == s_dwIDHash) { - dwIDHash = FX_HashCode_String_GetW(wsValue.c_str(), wsValue.GetLength()); + dwIDHash = FX_HashCode_GetW(wsValue.AsStringC(), false); } } } diff --git a/xfa/fde/css/fde_cssdatatable.cpp b/xfa/fde/css/fde_cssdatatable.cpp index 6abe5a7a26..f37f77b86c 100644 --- a/xfa/fde/css/fde_cssdatatable.cpp +++ b/xfa/fde/css/fde_cssdatatable.cpp @@ -557,10 +557,10 @@ FDE_LPCCSSPERSUDOTABLE FDE_GetCSSPersudoByEnum(FDE_CSSPERSUDO ePersudo) { return (ePersudo < FDE_CSSPERSUDO_NONE) ? (g_FDE_CSSPersudoType + ePersudo) : NULL; } -FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByName(const FX_WCHAR* pszName, - int32_t iLength) { - FXSYS_assert(pszName != NULL && iLength > 0); - uint32_t dwHash = FX_HashCode_String_GetW(pszName, iLength, TRUE); +FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByName( + const CFX_WideStringC& wsName) { + FXSYS_assert(!wsName.IsEmpty()); + uint32_t dwHash = FX_HashCode_GetW(wsName, true); int32_t iEnd = FDE_CSSPROPERTY_MAX - 1; int32_t iMid, iStart = 0; uint32_t dwMid; @@ -581,10 +581,9 @@ FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByEnum(FDE_CSSPROPERTY eName) { return (eName < FDE_CSSPROPERTY_MAX) ? (g_FDE_CSSProperties + eName) : NULL; } FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByName( - const FX_WCHAR* pszName, - int32_t iLength) { - FXSYS_assert(pszName != NULL && iLength > 0); - uint32_t dwHash = FX_HashCode_String_GetW(pszName, iLength, TRUE); + const CFX_WideStringC& wsName) { + FXSYS_assert(!wsName.IsEmpty()); + uint32_t dwHash = FX_HashCode_GetW(wsName, true); int32_t iEnd = FDE_CSSPROPERTYVALUE_MAX - 1; int32_t iMid, iStart = 0; uint32_t dwMid; @@ -606,10 +605,10 @@ FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByEnum( return (eName < FDE_CSSPROPERTYVALUE_MAX) ? (g_FDE_CSSPropertyValues + eName) : NULL; } -FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName(const FX_WCHAR* pszName, - int32_t iLength) { - FXSYS_assert(pszName != NULL && iLength > 0); - uint16_t wHash = (uint16_t)FX_HashCode_String_GetW(pszName, iLength, TRUE); +FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName( + const CFX_WideStringC& wsName) { + FXSYS_assert(!wsName.IsEmpty()); + uint16_t wHash = FX_HashCode_GetW(wsName, true); int32_t iEnd = sizeof(g_FDE_CSSMediaTypes) / sizeof(FDE_CSSMEDIATYPETABLE) - 1; int32_t iMid, iStart = 0; @@ -627,10 +626,10 @@ FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName(const FX_WCHAR* pszName, } while (iStart <= iEnd); return NULL; } -FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName(const FX_WCHAR* pszName, - int32_t iLength) { - FXSYS_assert(pszName != NULL && iLength > 0); - uint16_t wHash = (uint16_t)FX_HashCode_String_GetW(pszName, iLength, TRUE); +FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName( + const CFX_WideStringC& wsName) { + FXSYS_assert(!wsName.IsEmpty()); + uint16_t wHash = FX_HashCode_GetW(wsName, true); int32_t iEnd = sizeof(g_FDE_CSSLengthUnits) / sizeof(FDE_CSSLENGTHUNITTABLE) - 1; int32_t iMid, iStart = 0; @@ -648,10 +647,9 @@ FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName(const FX_WCHAR* pszName, } while (iStart <= iEnd); return NULL; } -FDE_LPCCSSCOLORTABLE FDE_GetCSSColorByName(const FX_WCHAR* pszName, - int32_t iLength) { - FXSYS_assert(pszName != NULL && iLength > 0); - uint32_t dwHash = FX_HashCode_String_GetW(pszName, iLength, TRUE); +FDE_LPCCSSCOLORTABLE FDE_GetCSSColorByName(const CFX_WideStringC& wsName) { + FXSYS_assert(!wsName.IsEmpty()); + uint32_t dwHash = FX_HashCode_GetW(wsName, true); int32_t iEnd = sizeof(g_FDE_CSSColors) / sizeof(FDE_CSSCOLORTABLE) - 1; int32_t iMid, iStart = 0; uint32_t dwMid; @@ -684,7 +682,8 @@ FX_BOOL FDE_ParseCSSNumber(const FX_WCHAR* pszValue, if (iValueLen >= 1 && *pszValue == '%') { eUnit = FDE_CSSPRIMITIVETYPE_Percent; } else if (iValueLen == 2) { - FDE_LPCCSSLENGTHUNITTABLE pUnit = FDE_GetCSSLengthUnitByName(pszValue, 2); + FDE_LPCCSSLENGTHUNITTABLE pUnit = + FDE_GetCSSLengthUnitByName(CFX_WideStringC(pszValue, 2)); if (pUnit != NULL) { eUnit = (FDE_CSSPRIMITIVETYPE)pUnit->wValue; } @@ -770,7 +769,8 @@ FX_BOOL FDE_ParseCSSColor(const FX_WCHAR* pszValue, dwColor = ArgbEncode(255, rgb[0], rgb[1], rgb[2]); return TRUE; } else { - FDE_LPCCSSCOLORTABLE pColor = FDE_GetCSSColorByName(pszValue, iValueLen); + FDE_LPCCSSCOLORTABLE pColor = + FDE_GetCSSColorByName(CFX_WideStringC(pszValue, iValueLen)); if (pColor != NULL) { dwColor = pColor->dwValue; return TRUE; diff --git a/xfa/fde/css/fde_cssdatatable.h b/xfa/fde/css/fde_cssdatatable.h index 8d17901d1d..a066c29f94 100644 --- a/xfa/fde/css/fde_cssdatatable.h +++ b/xfa/fde/css/fde_cssdatatable.h @@ -137,8 +137,7 @@ struct FDE_CSSPROPERTYTABLE { }; typedef FDE_CSSPROPERTYTABLE const* FDE_LPCCSSPROPERTYTABLE; -FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByName(const FX_WCHAR* pszName, - int32_t iLength); +FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByName(const CFX_WideStringC& wsName); FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByEnum(FDE_CSSPROPERTY eName); struct FDE_CSSPROPERTYVALUETABLE { FDE_CSSPROPERTYVALUE eName; @@ -148,8 +147,7 @@ struct FDE_CSSPROPERTYVALUETABLE { typedef FDE_CSSPROPERTYVALUETABLE const* FDE_LPCCSSPROPERTYVALUETABLE; FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByName( - const FX_WCHAR* pszName, - int32_t iLength); + const CFX_WideStringC& wsName); FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByEnum( FDE_CSSPROPERTYVALUE eName); struct FDE_CSSMEDIATYPETABLE { @@ -157,22 +155,22 @@ struct FDE_CSSMEDIATYPETABLE { uint16_t wValue; }; typedef FDE_CSSMEDIATYPETABLE const* FDE_LPCCSSMEDIATYPETABLE; -FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName(const FX_WCHAR* pszName, - int32_t iLength); +FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName( + const CFX_WideStringC& wsName); struct FDE_CSSLENGTHUNITTABLE { uint16_t wHash; uint16_t wValue; }; typedef FDE_CSSLENGTHUNITTABLE const* FDE_LPCCSSLENGTHUNITTABLE; -FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName(const FX_WCHAR* pszName, - int32_t iLength); +FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName( + const CFX_WideStringC& wsName); struct FDE_CSSCOLORTABLE { uint32_t dwHash; FX_ARGB dwValue; }; typedef FDE_CSSCOLORTABLE const* FDE_LPCCSSCOLORTABLE; -FDE_LPCCSSCOLORTABLE FDE_GetCSSColorByName(const FX_WCHAR* pszName, - int32_t iLength); +FDE_LPCCSSCOLORTABLE FDE_GetCSSColorByName(const CFX_WideStringC& wsName); + struct FDE_CSSPERSUDOTABLE { FDE_CSSPERSUDO eName; const FX_WCHAR* pszName; diff --git a/xfa/fde/css/fde_cssdeclaration.cpp b/xfa/fde/css/fde_cssdeclaration.cpp index 5517d85cb2..e48372c2ed 100644 --- a/xfa/fde/css/fde_cssdeclaration.cpp +++ b/xfa/fde/css/fde_cssdeclaration.cpp @@ -57,8 +57,8 @@ const FX_WCHAR* CFDE_CSSDeclaration::CopyToLocal( void* pKey = NULL; if (pCache) { void* pszCached = NULL; - pKey = - (void*)(uintptr_t)FX_HashCode_String_GetW(pszValue, iValueLen, FALSE); + pKey = (void*)(uintptr_t)FX_HashCode_GetW( + CFX_WideStringC(pszValue, iValueLen), false); if (pCache->Lookup(pKey, pszCached)) { return (const FX_WCHAR*)pszCached; } @@ -298,7 +298,7 @@ IFDE_CSSValue* CFDE_CSSDeclaration::ParseEnum(const FDE_CSSPROPERTYARGS* pArgs, const FX_WCHAR* pszValue, int32_t iValueLen) { const FDE_CSSPROPERTYVALUETABLE* pValue = - FDE_GetCSSPropertyValueByName(pszValue, iValueLen); + FDE_GetCSSPropertyValueByName(CFX_WideStringC(pszValue, iValueLen)); return pValue ? NewEnumValue(pArgs->pStaticStore, pValue->eName) : NULL; } IFDE_CSSValue* CFDE_CSSDeclaration::ParseColor(const FDE_CSSPROPERTYARGS* pArgs, @@ -371,7 +371,7 @@ IFDE_CSSValue* CFDE_CSSDeclaration::ParseFunction( switch (ePrimitiveType) { case FDE_CSSPRIMITIVETYPE_String: { const FDE_CSSPROPERTYVALUETABLE* pPropertyValue = - FDE_GetCSSPropertyValueByName(pszValue, iValueLen); + FDE_GetCSSPropertyValueByName(CFX_WideStringC(pszValue, iValueLen)); if (pPropertyValue != NULL) { argumentArr.Add( NewEnumValue(pArgs->pStaticStore, pPropertyValue->eName)); @@ -429,7 +429,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseContentProperty( return FALSE; case FDE_CSSPRIMITIVETYPE_String: { const FDE_CSSPROPERTYVALUETABLE* pValue = - FDE_GetCSSPropertyValueByName(pszValue, iValueLen); + FDE_GetCSSPropertyValueByName(CFX_WideStringC(pszValue, iValueLen)); if (pValue != NULL) { switch (pValue->eName) { case FDE_CSSPROPERTYVALUE_Normal: @@ -563,7 +563,8 @@ FX_BOOL CFDE_CSSDeclaration::ParseValueListProperty( } if (dwType & FDE_CSSVALUETYPE_MaybeEnum) { const FDE_CSSPROPERTYVALUETABLE* pValue = - FDE_GetCSSPropertyValueByName(pszValue, iValueLen); + FDE_GetCSSPropertyValueByName( + CFX_WideStringC(pszValue, iValueLen)); if (pValue != NULL) { list.Add(NewEnumValue(pStaticStore, pValue->eName)); continue; @@ -695,7 +696,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseBorderPropoerty( break; case FDE_CSSPRIMITIVETYPE_String: { const FDE_CSSCOLORTABLE* pColorItem = - FDE_GetCSSColorByName(pszValue, iValueLen); + FDE_GetCSSColorByName(CFX_WideStringC(pszValue, iValueLen)); if (pColorItem != NULL) { if (pColor == NULL) { pColor = FXTARGET_NewWith(pStaticStore) @@ -704,7 +705,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseBorderPropoerty( continue; } const FDE_CSSPROPERTYVALUETABLE* pValue = - FDE_GetCSSPropertyValueByName(pszValue, iValueLen); + FDE_GetCSSPropertyValueByName(CFX_WideStringC(pszValue, iValueLen)); if (pValue == NULL) { continue; } @@ -786,7 +787,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseListStyleProperty( break; case FDE_CSSPRIMITIVETYPE_String: { const FDE_CSSPROPERTYVALUETABLE* pValue = - FDE_GetCSSPropertyValueByName(pszValue, iValueLen); + FDE_GetCSSPropertyValueByName(CFX_WideStringC(pszValue, iValueLen)); if (pValue == NULL) { break; } @@ -878,7 +879,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseBackgroundProperty( } break; case FDE_CSSPRIMITIVETYPE_String: { const FDE_CSSPROPERTYVALUETABLE* pValue = - FDE_GetCSSPropertyValueByName(pszValue, iValueLen); + FDE_GetCSSPropertyValueByName(CFX_WideStringC(pszValue, iValueLen)); if (pValue != NULL) { switch (pValue->eName) { case FDE_CSSPROPERTYVALUE_None: @@ -931,7 +932,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseBackgroundProperty( break; } const FDE_CSSCOLORTABLE* pColorItem = - FDE_GetCSSColorByName(pszValue, iValueLen); + FDE_GetCSSColorByName(CFX_WideStringC(pszValue, iValueLen)); if (pColorItem != NULL) { if (pColor == NULL) { pColor = FXTARGET_NewWith(pStaticStore) @@ -1001,7 +1002,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseFontProperty(const FDE_CSSPROPERTYARGS* pArgs, switch (eType) { case FDE_CSSPRIMITIVETYPE_String: { const FDE_CSSPROPERTYVALUETABLE* pValue = - FDE_GetCSSPropertyValueByName(pszValue, iValueLen); + FDE_GetCSSPropertyValueByName(CFX_WideStringC(pszValue, iValueLen)); if (pValue != NULL) { switch (pValue->eName) { case FDE_CSSPROPERTYVALUE_XxSmall: @@ -1139,7 +1140,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseColumnRuleProperty( switch (eType) { case FDE_CSSPRIMITIVETYPE_String: { const FDE_CSSPROPERTYVALUETABLE* pValue = - FDE_GetCSSPropertyValueByName(pszValue, iValueLen); + FDE_GetCSSPropertyValueByName(CFX_WideStringC(pszValue, iValueLen)); if (pValue != NULL) { switch (pValue->eName) { case FDE_CSSPROPERTYVALUE_None: @@ -1236,7 +1237,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseTextEmphasisProperty( switch (eType) { case FDE_CSSPRIMITIVETYPE_String: { const FDE_CSSPROPERTYVALUETABLE* pValue = - FDE_GetCSSPropertyValueByName(pszValue, iValueLen); + FDE_GetCSSPropertyValueByName(CFX_WideStringC(pszValue, iValueLen)); if (pValue != NULL) { arrEmphasisStyle.Add(NewEnumValue(pStaticStore, pValue->eName)); continue; @@ -1289,7 +1290,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseColumnsProperty( switch (eType) { case FDE_CSSPRIMITIVETYPE_String: { const FDE_CSSPROPERTYVALUETABLE* pValue = - FDE_GetCSSPropertyValueByName(pszValue, iValueLen); + FDE_GetCSSPropertyValueByName(CFX_WideStringC(pszValue, iValueLen)); if (pValue == NULL && pValue->eName == FDE_CSSPROPERTYVALUE_Auto) { pColumnWidth = NewEnumValue(pStaticStore, pValue->eName); } @@ -1341,7 +1342,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseOverflowProperty( while (parser.NextValue(eType, pszValue, iValueLen)) { if (eType == FDE_CSSPRIMITIVETYPE_String) { const FDE_CSSPROPERTYVALUETABLE* pValue = - FDE_GetCSSPropertyValueByName(pszValue, iValueLen); + FDE_GetCSSPropertyValueByName(CFX_WideStringC(pszValue, iValueLen)); if (pValue != NULL) { switch (pValue->eName) { case FDE_CSSOVERFLOW_Visible: diff --git a/xfa/fde/css/fde_cssstyleselector.cpp b/xfa/fde/css/fde_cssstyleselector.cpp index 30502303f4..4f88c0d5d7 100644 --- a/xfa/fde/css/fde_cssstyleselector.cpp +++ b/xfa/fde/css/fde_cssstyleselector.cpp @@ -424,10 +424,8 @@ void CFDE_CSSStyleSelector::ComputeStyle( FXSYS_assert(iDeclCount >= 0); FXSYS_assert(pDestStyle); - static const uint32_t s_dwStyleHash = - FX_HashCode_String_GetW(L"style", 5, TRUE); - static const uint32_t s_dwAlignHash = - FX_HashCode_String_GetW(L"align", 5, TRUE); + static const uint32_t s_dwStyleHash = FX_HashCode_GetW(L"style", true); + static const uint32_t s_dwAlignHash = FX_HashCode_GetW(L"align", true); if (!pTag->empty()) { if (!m_pInlineStyleStore) @@ -437,9 +435,7 @@ void CFDE_CSSStyleSelector::ComputeStyle( for (auto it : *pTag) { CFX_WideString wsAttri = it.first; CFX_WideString wsValue = it.second; - - uint32_t dwAttriHash = - FX_HashCode_String_GetW(wsAttri.c_str(), wsAttri.GetLength(), TRUE); + uint32_t dwAttriHash = FX_HashCode_GetW(wsAttri.AsStringC(), true); if (dwAttriHash == s_dwStyleHash) { if (!pDecl) pDecl = FXTARGET_NewWith(m_pInlineStyleStore) CFDE_CSSDeclaration; @@ -565,7 +561,7 @@ void CFDE_CSSStyleSelector::AppendInlineStyle(CFDE_CSSDeclaration* pDecl, FDE_CSSSYNTAXSTATUS eStatus = pSyntax->DoSyntaxParse(); if (eStatus == FDE_CSSSYNTAXSTATUS_PropertyName) { psz = pSyntax->GetCurrentString(iLen); - args.pProperty = FDE_GetCSSPropertyByName(psz, iLen); + args.pProperty = FDE_GetCSSPropertyByName(CFX_WideStringC(psz, iLen)); if (args.pProperty == NULL) { wsName = CFX_WideStringC(psz, iLen); } diff --git a/xfa/fde/css/fde_cssstylesheet.cpp b/xfa/fde/css/fde_cssstylesheet.cpp index 4afb0cee63..15358c2942 100644 --- a/xfa/fde/css/fde_cssstylesheet.cpp +++ b/xfa/fde/css/fde_cssstylesheet.cpp @@ -196,7 +196,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSStyleSheet::LoadMediaRule( int32_t iLen; const FX_WCHAR* psz = pSyntax->GetCurrentString(iLen); FDE_LPCCSSMEDIATYPETABLE pMediaType = - FDE_GetCSSMediaTypeByName(psz, iLen); + FDE_GetCSSMediaTypeByName(CFX_WideStringC(psz, iLen)); if (pMediaType != NULL) { dwMediaList |= pMediaType->wValue; } @@ -249,7 +249,8 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSStyleSheet::LoadStyleRule( } break; case FDE_CSSSYNTAXSTATUS_PropertyName: pszValue = pSyntax->GetCurrentString(iValueLen); - propertyArgs.pProperty = FDE_GetCSSPropertyByName(pszValue, iValueLen); + propertyArgs.pProperty = + FDE_GetCSSPropertyByName(CFX_WideStringC(pszValue, iValueLen)); if (propertyArgs.pProperty == NULL) { wsName = CFX_WideStringC(pszValue, iValueLen); } @@ -305,7 +306,8 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSStyleSheet::LoadFontFaceRule( switch (pSyntax->DoSyntaxParse()) { case FDE_CSSSYNTAXSTATUS_PropertyName: pszValue = pSyntax->GetCurrentString(iValueLen); - propertyArgs.pProperty = FDE_GetCSSPropertyByName(pszValue, iValueLen); + propertyArgs.pProperty = + FDE_GetCSSPropertyByName(CFX_WideStringC(pszValue, iValueLen)); break; case FDE_CSSSYNTAXSTATUS_PropertyValue: if (propertyArgs.pProperty != NULL) { @@ -434,7 +436,7 @@ IFDE_CSSSelector* CFDE_CSSSelector::FromString(IFX_MEMAllocator* pStaticStore, if (wch == '.' || wch == '#') { if (psz == pStart || psz[-1] == ' ') { CFDE_CSSSelector* p = FXTARGET_NewWith(pStaticStore) - CFDE_CSSSelector(FDE_CSSSELECTORTYPE_Element, L"*", 1, TRUE); + CFDE_CSSSelector(FDE_CSSSELECTORTYPE_Element, L"*", 1, true); if (p == NULL) { return NULL; } @@ -452,7 +454,7 @@ IFDE_CSSSelector* CFDE_CSSSelector::FromString(IFX_MEMAllocator* pStaticStore, FDE_CSSSELECTORTYPE eType = wch == '.' ? FDE_CSSSELECTORTYPE_Class : FDE_CSSSELECTORTYPE_ID; CFDE_CSSSelector* p = FXTARGET_NewWith(pStaticStore) - CFDE_CSSSelector(eType, psz, iNameLen, FALSE); + CFDE_CSSSelector(eType, psz, iNameLen, false); if (p == NULL) { return NULL; } @@ -466,7 +468,7 @@ IFDE_CSSSelector* CFDE_CSSSelector::FromString(IFX_MEMAllocator* pStaticStore, return NULL; } CFDE_CSSSelector* p = FXTARGET_NewWith(pStaticStore) - CFDE_CSSSelector(FDE_CSSSELECTORTYPE_Element, psz, iNameLen, TRUE); + CFDE_CSSSelector(FDE_CSSSELECTORTYPE_Element, psz, iNameLen, true); if (p == NULL) { return NULL; } @@ -484,7 +486,7 @@ IFDE_CSSSelector* CFDE_CSSSelector::FromString(IFX_MEMAllocator* pStaticStore, return NULL; } CFDE_CSSSelector* p = FXTARGET_NewWith(pStaticStore) - CFDE_CSSSelector(FDE_CSSSELECTORTYPE_Persudo, psz, iNameLen, TRUE); + CFDE_CSSSelector(FDE_CSSSELECTORTYPE_Persudo, psz, iNameLen, true); if (p == NULL) { return NULL; } diff --git a/xfa/fde/css/fde_cssstylesheet.h b/xfa/fde/css/fde_cssstylesheet.h index 8ae8bd5393..21770bfe2b 100644 --- a/xfa/fde/css/fde_cssstylesheet.h +++ b/xfa/fde/css/fde_cssstylesheet.h @@ -15,10 +15,10 @@ class CFDE_CSSSelector : public IFDE_CSSSelector, public CFX_Target { CFDE_CSSSelector(FDE_CSSSELECTORTYPE eType, const FX_WCHAR* psz, int32_t iLen, - FX_BOOL bIgnoreCase) + bool bIgnoreCase) : m_eType(eType), - m_dwHash(FX_HashCode_String_GetW(psz, iLen, bIgnoreCase)), - m_pNext(NULL) {} + m_dwHash(FX_HashCode_GetW(CFX_WideStringC(psz, iLen), bIgnoreCase)), + m_pNext(nullptr) {} virtual FDE_CSSSELECTORTYPE GetType() const { return m_eType; } virtual uint32_t GetNameHash() const { return m_dwHash; } @@ -41,6 +41,7 @@ class CFDE_CSSSelector : public IFDE_CSSSelector, public CFX_Target { IFDE_CSSSelector* m_pNext; }; typedef CFX_ArrayTemplate<IFDE_CSSSelector*> CFDE_CSSSelectorArray; + class CFDE_CSSStyleRule : public IFDE_CSSStyleRule, public CFX_Target { public: CFDE_CSSStyleRule() : m_ppSelector(NULL), m_iSelectors(0) {} |