summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_document.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-09-18 14:23:18 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-18 18:40:16 +0000
commit275e260a6cd4a8e506ba974feb85ebcd926c1739 (patch)
tree2029b9158ec044764ceff122fe5fb5d0a3f123d1 /xfa/fxfa/parser/cxfa_document.cpp
parent450fbeaaabf1ab340c1018de2e58f1950657517e (diff)
downloadpdfium-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 'xfa/fxfa/parser/cxfa_document.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_document.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/xfa/fxfa/parser/cxfa_document.cpp b/xfa/fxfa/parser/cxfa_document.cpp
index 85d2758467..3a46e26cb7 100644
--- a/xfa/fxfa/parser/cxfa_document.cpp
+++ b/xfa/fxfa/parser/cxfa_document.cpp
@@ -151,11 +151,11 @@ CXFA_Object* CXFA_Document::GetXFAObject(XFA_HashCode dwNodeNameHash) {
if (pDatasetsChild->GetNameHash() != XFA_HASHCODE_Data)
continue;
- CFX_WideString wsNamespaceURI;
+ WideString wsNamespaceURI;
if (!pDatasetsChild->TryNamespace(wsNamespaceURI))
continue;
- CFX_WideString wsDatasetsURI;
+ WideString wsDatasetsURI;
if (!pDatasetsNode->TryNamespace(wsDatasetsURI))
continue;
if (wsNamespaceURI == wsDatasetsURI)
@@ -255,7 +255,7 @@ bool CXFA_Document::IsInteractive() {
if (!pConfig)
return false;
- CFX_WideString wsInteractive;
+ WideString wsInteractive;
CXFA_Node* pPresent = pConfig->GetFirstChildByClass(XFA_Element::Present);
if (!pPresent)
return false;
@@ -297,11 +297,11 @@ CXFA_ScriptContext* CXFA_Document::GetScriptContext() {
}
XFA_VERSION CXFA_Document::RecognizeXFAVersionNumber(
- const CFX_WideString& wsTemplateNS) {
- CFX_WideStringC wsTemplateURIPrefix =
+ const WideString& wsTemplateNS) {
+ WideStringView wsTemplateURIPrefix =
XFA_GetPacketByIndex(XFA_PACKET_Template)->pURI;
FX_STRSIZE nPrefixLength = wsTemplateURIPrefix.GetLength();
- if (CFX_WideStringC(wsTemplateNS.c_str(), wsTemplateNS.GetLength()) !=
+ if (WideStringView(wsTemplateNS.c_str(), wsTemplateNS.GetLength()) !=
wsTemplateURIPrefix) {
return XFA_VERSION_UNKNOWN;
}
@@ -325,14 +325,14 @@ XFA_VERSION CXFA_Document::RecognizeXFAVersionNumber(
}
CXFA_Node* CXFA_Document::GetNodeByID(CXFA_Node* pRoot,
- const CFX_WideStringC& wsID) {
+ const WideStringView& wsID) {
if (!pRoot || wsID.IsEmpty())
return nullptr;
CXFA_NodeIterator sIterator(pRoot);
for (CXFA_Node* pNode = sIterator.GetCurrent(); pNode;
pNode = sIterator.MoveToNext()) {
- CFX_WideStringC wsIDVal;
+ WideStringView wsIDVal;
if (pNode->TryCData(XFA_ATTRIBUTE_Id, wsIDVal) && !wsIDVal.IsEmpty()) {
if (wsIDVal == wsID)
return pNode;
@@ -351,11 +351,11 @@ void CXFA_Document::DoProtoMerge() {
CXFA_NodeIterator sIterator(pTemplateRoot);
for (CXFA_Node* pNode = sIterator.GetCurrent(); pNode;
pNode = sIterator.MoveToNext()) {
- CFX_WideStringC wsIDVal;
+ WideStringView wsIDVal;
if (pNode->TryCData(XFA_ATTRIBUTE_Id, wsIDVal) && !wsIDVal.IsEmpty()) {
mIDMap[FX_HashCode_GetW(wsIDVal, false)] = pNode;
}
- CFX_WideStringC wsUseVal;
+ WideStringView wsUseVal;
if (pNode->TryCData(XFA_ATTRIBUTE_Use, wsUseVal) && !wsUseVal.IsEmpty()) {
sUseNodes.insert(pNode);
} else if (pNode->TryCData(XFA_ATTRIBUTE_Usehref, wsUseVal) &&
@@ -365,33 +365,33 @@ void CXFA_Document::DoProtoMerge() {
}
for (CXFA_Node* pUseHrefNode : sUseNodes) {
- CFX_WideString wsUseVal;
- CFX_WideStringC wsURI, wsID, wsSOM;
+ WideString wsUseVal;
+ WideStringView wsURI, wsID, wsSOM;
if (pUseHrefNode->TryCData(XFA_ATTRIBUTE_Usehref, wsUseVal) &&
!wsUseVal.IsEmpty()) {
auto uSharpPos = wsUseVal.Find('#');
if (!uSharpPos.has_value()) {
- wsURI = wsUseVal.AsStringC();
+ wsURI = wsUseVal.AsStringView();
} else {
- wsURI = CFX_WideStringC(wsUseVal.c_str(), uSharpPos.value());
+ wsURI = WideStringView(wsUseVal.c_str(), uSharpPos.value());
FX_STRSIZE uLen = wsUseVal.GetLength();
if (uLen >= uSharpPos.value() + 5 &&
- CFX_WideStringC(wsUseVal.c_str() + uSharpPos.value(), 5) ==
+ WideStringView(wsUseVal.c_str() + uSharpPos.value(), 5) ==
L"#som(" &&
wsUseVal[uLen - 1] == ')') {
- wsSOM = CFX_WideStringC(wsUseVal.c_str() + uSharpPos.value() + 5,
- uLen - 1 - uSharpPos.value() - 5);
+ wsSOM = WideStringView(wsUseVal.c_str() + uSharpPos.value() + 5,
+ uLen - 1 - uSharpPos.value() - 5);
} else {
- wsID = CFX_WideStringC(wsUseVal.c_str() + uSharpPos.value() + 1,
- uLen - uSharpPos.value() - 1);
+ wsID = WideStringView(wsUseVal.c_str() + uSharpPos.value() + 1,
+ uLen - uSharpPos.value() - 1);
}
}
} else if (pUseHrefNode->TryCData(XFA_ATTRIBUTE_Use, wsUseVal) &&
!wsUseVal.IsEmpty()) {
if (wsUseVal[0] == '#')
- wsID = CFX_WideStringC(wsUseVal.c_str() + 1, wsUseVal.GetLength() - 1);
+ wsID = WideStringView(wsUseVal.c_str() + 1, wsUseVal.GetLength() - 1);
else
- wsSOM = CFX_WideStringC(wsUseVal.c_str(), wsUseVal.GetLength());
+ wsSOM = WideStringView(wsUseVal.c_str(), wsUseVal.GetLength());
}
if (!wsURI.IsEmpty() && wsURI != L".")