diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-09-18 14:23:18 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-18 18:40:16 +0000 |
commit | 275e260a6cd4a8e506ba974feb85ebcd926c1739 (patch) | |
tree | 2029b9158ec044764ceff122fe5fb5d0a3f123d1 /core/fxcrt/css/cfx_cssdeclaration.cpp | |
parent | 450fbeaaabf1ab340c1018de2e58f1950657517e (diff) | |
download | pdfium-275e260a6cd4a8e506ba974feb85ebcd926c1739.tar.xz |
Convert string class names
Automated using git grep & sed.
Replace StringC classes with StringView classes.
Remove the CFX_ prefix and put string classes in fxcrt namespace.
Change AsStringC() to AsStringView().
Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*,
Foo).
Couple of tests needed to have their names regularlized.
BUG=pdfium:894
Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d
Reviewed-on: https://pdfium-review.googlesource.com/14151
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxcrt/css/cfx_cssdeclaration.cpp')
-rw-r--r-- | core/fxcrt/css/cfx_cssdeclaration.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/core/fxcrt/css/cfx_cssdeclaration.cpp b/core/fxcrt/css/cfx_cssdeclaration.cpp index 344fc842c4..f2c7d3930b 100644 --- a/core/fxcrt/css/cfx_cssdeclaration.cpp +++ b/core/fxcrt/css/cfx_cssdeclaration.cpp @@ -113,7 +113,7 @@ const CFX_CSSColorTable g_CFX_CSSColors[] = { }; const CFX_CSSPropertyValueTable* GetCSSPropertyValueByName( - const CFX_WideStringC& wsName) { + const WideStringView& wsName) { ASSERT(!wsName.IsEmpty()); uint32_t dwHash = FX_HashCode_GetW(wsName, true); int32_t iEnd = g_iCSSPropertyValueCount; @@ -134,7 +134,7 @@ const CFX_CSSPropertyValueTable* GetCSSPropertyValueByName( } const CFX_CSSLengthUnitTable* GetCSSLengthUnitByName( - const CFX_WideStringC& wsName) { + const WideStringView& wsName) { ASSERT(!wsName.IsEmpty()); uint16_t wHash = FX_HashCode_GetW(wsName, true); int32_t iEnd = @@ -155,7 +155,7 @@ const CFX_CSSLengthUnitTable* GetCSSLengthUnitByName( return nullptr; } -const CFX_CSSColorTable* GetCSSColorByName(const CFX_WideStringC& wsName) { +const CFX_CSSColorTable* GetCSSColorByName(const WideStringView& wsName) { ASSERT(!wsName.IsEmpty()); uint32_t dwHash = FX_HashCode_GetW(wsName, true); int32_t iEnd = sizeof(g_CFX_CSSColors) / sizeof(CFX_CSSColorTable) - 1; @@ -192,7 +192,7 @@ bool ParseCSSNumber(const wchar_t* pszValue, eUnit = CFX_CSSNumberType::Percent; } else if (iValueLen == 2) { const CFX_CSSLengthUnitTable* pUnit = - GetCSSLengthUnitByName(CFX_WideStringC(pszValue, 2)); + GetCSSLengthUnitByName(WideStringView(pszValue, 2)); if (pUnit) eUnit = pUnit->wValue; } @@ -273,7 +273,7 @@ bool CFX_CSSDeclaration::ParseCSSColor(const wchar_t* pszValue, } const CFX_CSSColorTable* pColor = - GetCSSColorByName(CFX_WideStringC(pszValue, iValueLen)); + GetCSSColorByName(WideStringView(pszValue, iValueLen)); if (!pColor) return false; @@ -308,7 +308,7 @@ void CFX_CSSDeclaration::AddPropertyHolder(CFX_CSSProperty eProperty, } void CFX_CSSDeclaration::AddProperty(const CFX_CSSPropertyTable* pTable, - const CFX_WideStringC& value) { + const WideStringView& value) { ASSERT(!value.IsEmpty()); const wchar_t* pszValue = value.unterminated_c_str(); @@ -422,8 +422,8 @@ void CFX_CSSDeclaration::AddProperty(const CFX_CSSPropertyTable* pTable, } } -void CFX_CSSDeclaration::AddProperty(const CFX_WideString& prop, - const CFX_WideString& value) { +void CFX_CSSDeclaration::AddProperty(const WideString& prop, + const WideString& value) { custom_properties_.push_back( pdfium::MakeUnique<CFX_CSSCustomProperty>(prop, value)); } @@ -442,7 +442,7 @@ CFX_RetainPtr<CFX_CSSValue> CFX_CSSDeclaration::ParseEnum( const wchar_t* pszValue, int32_t iValueLen) { const CFX_CSSPropertyValueTable* pValue = - GetCSSPropertyValueByName(CFX_WideStringC(pszValue, iValueLen)); + GetCSSPropertyValueByName(WideStringView(pszValue, iValueLen)); return pValue ? pdfium::MakeRetain<CFX_CSSEnumValue>(pValue->eName) : nullptr; } @@ -466,7 +466,7 @@ CFX_RetainPtr<CFX_CSSValue> CFX_CSSDeclaration::ParseString( return nullptr; return pdfium::MakeRetain<CFX_CSSStringValue>( - CFX_WideString(pszValue + iOffset, iValueLen)); + WideString(pszValue + iOffset, iValueLen)); } void CFX_CSSDeclaration::ParseValueListProperty( @@ -502,7 +502,7 @@ void CFX_CSSDeclaration::ParseValueListProperty( } if (dwType & CFX_CSSVALUETYPE_MaybeEnum) { const CFX_CSSPropertyValueTable* pValue = - GetCSSPropertyValueByName(CFX_WideStringC(pszValue, iValueLen)); + GetCSSPropertyValueByName(WideStringView(pszValue, iValueLen)); if (pValue) { list.push_back(pdfium::MakeRetain<CFX_CSSEnumValue>(pValue->eName)); continue; @@ -510,7 +510,7 @@ void CFX_CSSDeclaration::ParseValueListProperty( } if (dwType & CFX_CSSVALUETYPE_MaybeString) { list.push_back(pdfium::MakeRetain<CFX_CSSStringValue>( - CFX_WideString(pszValue, iValueLen))); + WideString(pszValue, iValueLen))); } break; case CFX_CSSPrimitiveType::RGB: @@ -614,12 +614,12 @@ bool CFX_CSSDeclaration::ParseBorderProperty( } case CFX_CSSPrimitiveType::String: { const CFX_CSSColorTable* pColorItem = - GetCSSColorByName(CFX_WideStringC(pszValue, iValueLen)); + GetCSSColorByName(WideStringView(pszValue, iValueLen)); if (pColorItem) continue; const CFX_CSSPropertyValueTable* pValue = - GetCSSPropertyValueByName(CFX_WideStringC(pszValue, iValueLen)); + GetCSSPropertyValueByName(WideStringView(pszValue, iValueLen)); if (!pValue) continue; @@ -661,7 +661,7 @@ void CFX_CSSDeclaration::ParseFontProperty(const wchar_t* pszValue, switch (eType) { case CFX_CSSPrimitiveType::String: { const CFX_CSSPropertyValueTable* pValue = - GetCSSPropertyValueByName(CFX_WideStringC(pszValue, iValueLen)); + GetCSSPropertyValueByName(WideStringView(pszValue, iValueLen)); if (pValue) { switch (pValue->eName) { case CFX_CSSPropertyValue::XxSmall: @@ -710,7 +710,7 @@ void CFX_CSSDeclaration::ParseFontProperty(const wchar_t* pszValue, } if (pFontSize) { familyList.push_back(pdfium::MakeRetain<CFX_CSSStringValue>( - CFX_WideString(pszValue, iValueLen))); + WideString(pszValue, iValueLen))); } parser.m_Separator = ','; break; |