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/fpdfdoc/cpdf_occontext.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'core/fpdfdoc/cpdf_occontext.cpp') diff --git a/core/fpdfdoc/cpdf_occontext.cpp b/core/fpdfdoc/cpdf_occontext.cpp index 7e746e0028..069292c65b 100644 --- a/core/fpdfdoc/cpdf_occontext.cpp +++ b/core/fpdfdoc/cpdf_occontext.cpp @@ -24,13 +24,13 @@ int32_t FindGroup(const CPDF_Array* pArray, const CPDF_Dictionary* pGroupDict) { } bool HasIntent(const CPDF_Dictionary* pDict, - const CFX_ByteStringC& csElement, - const CFX_ByteStringC& csDef) { + const ByteStringView& csElement, + const ByteStringView& csDef) { CPDF_Object* pIntent = pDict->GetDirectObjectFor("Intent"); if (!pIntent) return csElement == csDef; - CFX_ByteString bsIntent; + ByteString bsIntent; if (CPDF_Array* pArray = pIntent->AsArray()) { for (size_t i = 0; i < pArray->GetCount(); i++) { bsIntent = pArray->GetStringAt(i); @@ -70,8 +70,8 @@ CPDF_Dictionary* GetConfig(CPDF_Document* pDoc, return pConfig; } -CFX_ByteString GetUsageTypeString(CPDF_OCContext::UsageType eType) { - CFX_ByteString csState; +ByteString GetUsageTypeString(CPDF_OCContext::UsageType eType) { + ByteString csState; switch (eType) { case CPDF_OCContext::Design: csState = "Design"; @@ -99,7 +99,7 @@ CPDF_OCContext::CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType) CPDF_OCContext::~CPDF_OCContext() {} bool CPDF_OCContext::LoadOCGStateFromConfig( - const CFX_ByteString& csConfig, + const ByteString& csConfig, const CPDF_Dictionary* pOCGDict) const { CPDF_Dictionary* pConfig = GetConfig(m_pDocument.Get(), pOCGDict); if (!pConfig) @@ -120,7 +120,7 @@ bool CPDF_OCContext::LoadOCGStateFromConfig( if (!pArray) return bState; - CFX_ByteString csFind = csConfig + "State"; + ByteString csFind = csConfig + "State"; for (size_t i = 0; i < pArray->GetCount(); i++) { CPDF_Dictionary* pUsage = pArray->GetDictAt(i); if (!pUsage) @@ -149,12 +149,12 @@ bool CPDF_OCContext::LoadOCGState(const CPDF_Dictionary* pOCGDict) const { if (!HasIntent(pOCGDict, "View", "View")) return true; - CFX_ByteString csState = GetUsageTypeString(m_eUsageType); + ByteString csState = GetUsageTypeString(m_eUsageType); CPDF_Dictionary* pUsage = pOCGDict->GetDictFor("Usage"); if (pUsage) { CPDF_Dictionary* pState = pUsage->GetDictFor(csState); if (pState) { - CFX_ByteString csFind = csState + "State"; + ByteString csFind = csState + "State"; if (pState->KeyExist(csFind)) return pState->GetStringFor(csFind) != "OFF"; } @@ -196,7 +196,7 @@ bool CPDF_OCContext::GetOCGVE(CPDF_Array* pExpression, int nLevel) { if (nLevel > 32 || !pExpression) return false; - CFX_ByteString csOperator = pExpression->GetStringAt(0); + ByteString csOperator = pExpression->GetStringAt(0); if (csOperator == "Not") { CPDF_Object* pOCGObj = pExpression->GetDirectObjectAt(1); if (!pOCGObj) @@ -241,7 +241,7 @@ bool CPDF_OCContext::LoadOCMDState(const CPDF_Dictionary* pOCMDDict) { if (pVE) return GetOCGVE(pVE, 0); - CFX_ByteString csP = pOCMDDict->GetStringFor("P", "AnyOn"); + ByteString csP = pOCMDDict->GetStringFor("P", "AnyOn"); CPDF_Object* pOCGObj = pOCMDDict->GetDirectObjectFor("OCGs"); if (!pOCGObj) return true; @@ -279,7 +279,7 @@ bool CPDF_OCContext::CheckOCGVisible(const CPDF_Dictionary* pOCGDict) { if (!pOCGDict) return true; - CFX_ByteString csType = pOCGDict->GetStringFor("Type", "OCG"); + ByteString csType = pOCGDict->GetStringFor("Type", "OCG"); if (csType == "OCG") return GetOCGVisible(pOCGDict); return LoadOCMDState(pOCGDict); -- cgit v1.2.3