From 275e260a6cd4a8e506ba974feb85ebcd926c1739 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Mon, 18 Sep 2017 14:23:18 -0400 Subject: 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 Commit-Queue: Ryan Harrison --- core/fxcrt/css/cfx_cssstyleselector.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'core/fxcrt/css/cfx_cssstyleselector.cpp') diff --git a/core/fxcrt/css/cfx_cssstyleselector.cpp b/core/fxcrt/css/cfx_cssstyleselector.cpp index 9a2bc8c498..9ae2b876f7 100644 --- a/core/fxcrt/css/cfx_cssstyleselector.cpp +++ b/core/fxcrt/css/cfx_cssstyleselector.cpp @@ -50,7 +50,7 @@ void CFX_CSSStyleSelector::UpdateStyleIndex() { } std::vector CFX_CSSStyleSelector::MatchDeclarations( - const CFX_WideString& tagname) { + const WideString& tagname) { std::vector matchedDecls; if (m_UARules.CountSelectors() == 0 || tagname.IsEmpty()) return matchedDecls; @@ -66,7 +66,7 @@ std::vector CFX_CSSStyleSelector::MatchDeclarations( return matchedDecls; } -bool CFX_CSSStyleSelector::MatchSelector(const CFX_WideString& tagname, +bool CFX_CSSStyleSelector::MatchSelector(const WideString& tagname, CFX_CSSSelector* pSel) { // TODO(dsinclair): The code only supports a single level of selector at this // point. None of the code using selectors required the complexity so lets @@ -80,8 +80,8 @@ bool CFX_CSSStyleSelector::MatchSelector(const CFX_WideString& tagname, void CFX_CSSStyleSelector::ComputeStyle( const std::vector& declArray, - const CFX_WideString& styleString, - const CFX_WideString& alignString, + const WideString& styleString, + const WideString& alignString, CFX_CSSComputedStyle* pDest) { std::unique_ptr pDecl; if (!styleString.IsEmpty() || !alignString.IsEmpty()) { @@ -91,7 +91,7 @@ void CFX_CSSStyleSelector::ComputeStyle( AppendInlineStyle(pDecl.get(), styleString); if (!alignString.IsEmpty()) { pDecl->AddProperty(CFX_GetCSSPropertyByEnum(CFX_CSSProperty::TextAlign), - alignString.AsStringC()); + alignString.AsStringView()); } } ApplyDeclarations(declArray, pDecl.get(), pDest); @@ -137,29 +137,29 @@ void CFX_CSSStyleSelector::ExtractValues( } void CFX_CSSStyleSelector::AppendInlineStyle(CFX_CSSDeclaration* pDecl, - const CFX_WideString& style) { + const WideString& style) { ASSERT(pDecl && !style.IsEmpty()); auto pSyntax = pdfium::MakeUnique( style.c_str(), style.GetLength(), 32, true); int32_t iLen2 = 0; const CFX_CSSPropertyTable* table = nullptr; - CFX_WideString wsName; + WideString wsName; while (1) { CFX_CSSSyntaxStatus eStatus = pSyntax->DoSyntaxParse(); if (eStatus == CFX_CSSSyntaxStatus::PropertyName) { - CFX_WideStringC strValue = pSyntax->GetCurrentString(); + WideStringView strValue = pSyntax->GetCurrentString(); table = CFX_GetCSSPropertyByName(strValue); if (!table) - wsName = CFX_WideString(strValue); + wsName = WideString(strValue); } else if (eStatus == CFX_CSSSyntaxStatus::PropertyValue) { if (table || iLen2 > 0) { - CFX_WideStringC strValue = pSyntax->GetCurrentString(); + WideStringView strValue = pSyntax->GetCurrentString(); if (!strValue.IsEmpty()) { if (table) pDecl->AddProperty(table, strValue); else if (iLen2 > 0) - pDecl->AddProperty(wsName, CFX_WideString(strValue)); + pDecl->AddProperty(wsName, WideString(strValue)); } } } else { -- cgit v1.2.3