summaryrefslogtreecommitdiff
path: root/xfa/fde/css/fde_cssstylesheet.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-25 11:23:43 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-25 11:23:43 -0700
commitb6853cfe4fd1ee089dfdd0cb09bbc4063532ef82 (patch)
tree1404031e845c8b4b09d5a68fd81f09a7d2865d59 /xfa/fde/css/fde_cssstylesheet.cpp
parent2a8a20cde4c8e2294f6868bb097fe450960a709f (diff)
downloadpdfium-b6853cfe4fd1ee089dfdd0cb09bbc4063532ef82.tar.xz
Pass CFX_*StringCs to FX_HashCode_GETA and _GETW hash functions.
Too many calls were of the form fn(x.c_str(), x.GetLength()) which is an anti-pattern given the StringC classes which tie these together. There are a few places where explicit CFX_*StringCs are constructed, but this can be avoided by changing the args to these functions in the same manner. Removed String_ from name of functions since it added little value. Also removed default argument. Review URL: https://codereview.chromium.org/1919563002
Diffstat (limited to 'xfa/fde/css/fde_cssstylesheet.cpp')
-rw-r--r--xfa/fde/css/fde_cssstylesheet.cpp16
1 files changed, 9 insertions, 7 deletions
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;
}