summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_utils.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/xfa_utils.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/xfa_utils.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_utils.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/xfa/fxfa/parser/xfa_utils.cpp b/xfa/fxfa/parser/xfa_utils.cpp
index fa75f18015..e1ee29d2b7 100644
--- a/xfa/fxfa/parser/xfa_utils.cpp
+++ b/xfa/fxfa/parser/xfa_utils.cpp
@@ -39,8 +39,8 @@ const double fraction_scales[] = {0.1,
0.000000000000001,
0.0000000000000001};
-double WideStringToDouble(const CFX_WideString& wsStringVal) {
- CFX_WideString wsValue = wsStringVal;
+double WideStringToDouble(const WideString& wsStringVal) {
+ WideString wsValue = wsStringVal;
wsValue.TrimLeft();
wsValue.TrimRight();
int64_t nIntegral = 0;
@@ -172,15 +172,15 @@ CXFA_LocaleValue XFA_GetLocaleValue(CXFA_WidgetData* pWidgetData) {
pWidgetData->GetNode()->GetDocument()->GetLocalMgr());
}
void XFA_GetPlainTextFromRichText(CFX_XMLNode* pXMLNode,
- CFX_WideString& wsPlainText) {
+ WideString& wsPlainText) {
if (!pXMLNode) {
return;
}
switch (pXMLNode->GetType()) {
case FX_XMLNODE_Element: {
CFX_XMLElement* pXMLElement = static_cast<CFX_XMLElement*>(pXMLNode);
- CFX_WideString wsTag = pXMLElement->GetLocalTagName();
- uint32_t uTag = FX_HashCode_GetW(wsTag.AsStringC(), true);
+ WideString wsTag = pXMLElement->GetLocalTagName();
+ uint32_t uTag = FX_HashCode_GetW(wsTag.AsStringView(), true);
if (uTag == 0x0001f714) {
wsPlainText += L"\n";
} else if (uTag == 0x00000070) {
@@ -197,7 +197,7 @@ void XFA_GetPlainTextFromRichText(CFX_XMLNode* pXMLNode,
}
case FX_XMLNODE_Text:
case FX_XMLNODE_CharData: {
- CFX_WideString wsContent = static_cast<CFX_XMLText*>(pXMLNode)->GetText();
+ WideString wsContent = static_cast<CFX_XMLText*>(pXMLNode)->GetText();
wsPlainText += wsContent;
break;
}
@@ -228,8 +228,8 @@ bool XFA_FieldIsMultiListBox(CXFA_Node* pFieldNode) {
return bRet;
}
-double XFA_ByteStringToDouble(const CFX_ByteStringC& szStringVal) {
- CFX_WideString wsValue = CFX_WideString::FromUTF8(szStringVal);
+double XFA_ByteStringToDouble(const ByteStringView& szStringVal) {
+ WideString wsValue = WideString::FromUTF8(szStringVal);
return WideStringToDouble(wsValue);
}
@@ -241,7 +241,7 @@ int32_t XFA_MapRotation(int32_t nRotation) {
const XFA_SCRIPTATTRIBUTEINFO* XFA_GetScriptAttributeByName(
XFA_Element eElement,
- const CFX_WideStringC& wsAttributeName) {
+ const WideStringView& wsAttributeName) {
if (wsAttributeName.IsEmpty())
return nullptr;
@@ -376,7 +376,7 @@ const XFA_ELEMENTINFO* XFA_GetElementByID(XFA_Element eName) {
: nullptr;
}
-XFA_Element XFA_GetElementTypeForName(const CFX_WideStringC& wsName) {
+XFA_Element XFA_GetElementTypeForName(const WideStringView& wsName) {
if (wsName.IsEmpty())
return XFA_Element::Unknown;
@@ -428,7 +428,7 @@ bool XFA_GetAttributeDefaultValue(void*& pValue,
return false;
}
-const XFA_ATTRIBUTEINFO* XFA_GetAttributeByName(const CFX_WideStringC& wsName) {
+const XFA_ATTRIBUTEINFO* XFA_GetAttributeByName(const WideStringView& wsName) {
if (wsName.IsEmpty())
return nullptr;
@@ -449,7 +449,7 @@ const XFA_ATTRIBUTEINFO* XFA_GetAttributeByID(XFA_ATTRIBUTE eName) {
}
const XFA_ATTRIBUTEENUMINFO* XFA_GetAttributeEnumByName(
- const CFX_WideStringC& wsName) {
+ const WideStringView& wsName) {
if (wsName.IsEmpty())
return nullptr;