summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_nodelocale.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_nodelocale.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_nodelocale.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_nodelocale.cpp61
1 files changed, 29 insertions, 32 deletions
diff --git a/xfa/fxfa/parser/cxfa_nodelocale.cpp b/xfa/fxfa/parser/cxfa_nodelocale.cpp
index 78b0cef278..d0d1fd34e4 100644
--- a/xfa/fxfa/parser/cxfa_nodelocale.cpp
+++ b/xfa/fxfa/parser/cxfa_nodelocale.cpp
@@ -24,7 +24,7 @@ const wchar_t g_FX_Integer[] = L"z,zzz,zzz,zzz,zzz,zzz";
} // namespace
-CFX_WideString XFA_PatternToString(FX_LOCALENUMSUBCATEGORY category) {
+WideString XFA_PatternToString(FX_LOCALENUMSUBCATEGORY category) {
switch (category) {
case FX_LOCALENUMPATTERN_Percent:
return g_FX_Percent;
@@ -35,20 +35,19 @@ CFX_WideString XFA_PatternToString(FX_LOCALENUMSUBCATEGORY category) {
case FX_LOCALENUMPATTERN_Integer:
return g_FX_Integer;
}
- return CFX_WideString();
+ return WideString();
}
CXFA_NodeLocale::CXFA_NodeLocale(CXFA_Node* pLocale) : m_pLocale(pLocale) {}
CXFA_NodeLocale::~CXFA_NodeLocale() {}
-CFX_WideString CXFA_NodeLocale::GetName() const {
- return CFX_WideString(m_pLocale ? m_pLocale->GetCData(XFA_ATTRIBUTE_Name)
- : nullptr);
+WideString CXFA_NodeLocale::GetName() const {
+ return WideString(m_pLocale ? m_pLocale->GetCData(XFA_ATTRIBUTE_Name)
+ : nullptr);
}
-CFX_WideString CXFA_NodeLocale::GetNumbericSymbol(
- FX_LOCALENUMSYMBOL eType) const {
+WideString CXFA_NodeLocale::GetNumbericSymbol(FX_LOCALENUMSYMBOL eType) const {
switch (eType) {
case FX_LOCALENUMSYMBOL_Decimal:
return GetSymbol(XFA_Element::NumberSymbols, L"decimal");
@@ -65,25 +64,25 @@ CFX_WideString CXFA_NodeLocale::GetNumbericSymbol(
case FX_LOCALENUMSYMBOL_CurrencyName:
return GetSymbol(XFA_Element::CurrencySymbols, L"isoname");
}
- return CFX_WideString();
+ return WideString();
}
-CFX_WideString CXFA_NodeLocale::GetDateTimeSymbols() const {
+WideString CXFA_NodeLocale::GetDateTimeSymbols() const {
CXFA_Node* pSymbols =
m_pLocale ? m_pLocale->GetChild(0, XFA_Element::DateTimeSymbols)
: nullptr;
- return pSymbols ? pSymbols->GetContent() : CFX_WideString();
+ return pSymbols ? pSymbols->GetContent() : WideString();
}
-CFX_WideString CXFA_NodeLocale::GetMonthName(int32_t nMonth, bool bAbbr) const {
+WideString CXFA_NodeLocale::GetMonthName(int32_t nMonth, bool bAbbr) const {
return GetCalendarSymbol(XFA_Element::MonthNames, nMonth, bAbbr);
}
-CFX_WideString CXFA_NodeLocale::GetDayName(int32_t nWeek, bool bAbbr) const {
+WideString CXFA_NodeLocale::GetDayName(int32_t nWeek, bool bAbbr) const {
return GetCalendarSymbol(XFA_Element::DayNames, nWeek, bAbbr);
}
-CFX_WideString CXFA_NodeLocale::GetMeridiemName(bool bAM) const {
+WideString CXFA_NodeLocale::GetMeridiemName(bool bAM) const {
return GetCalendarSymbol(XFA_Element::MeridiemNames, bAM ? 0 : 1, false);
}
@@ -91,11 +90,11 @@ FX_TIMEZONE CXFA_NodeLocale::GetTimeZone() const {
return CXFA_TimeZoneProvider().GetTimeZone();
}
-CFX_WideString CXFA_NodeLocale::GetEraName(bool bAD) const {
+WideString CXFA_NodeLocale::GetEraName(bool bAD) const {
return GetCalendarSymbol(XFA_Element::EraNames, bAD ? 1 : 0, false);
}
-CFX_WideString CXFA_NodeLocale::GetDatePattern(
+WideString CXFA_NodeLocale::GetDatePattern(
FX_LOCALEDATETIMESUBCATEGORY eType) const {
switch (eType) {
case FX_LOCALEDATETIMESUBCATEGORY_Short:
@@ -108,10 +107,10 @@ CFX_WideString CXFA_NodeLocale::GetDatePattern(
case FX_LOCALEDATETIMESUBCATEGORY_Long:
return GetSymbol(XFA_Element::DatePatterns, L"long");
}
- return CFX_WideString();
+ return WideString();
}
-CFX_WideString CXFA_NodeLocale::GetTimePattern(
+WideString CXFA_NodeLocale::GetTimePattern(
FX_LOCALEDATETIMESUBCATEGORY eType) const {
switch (eType) {
case FX_LOCALEDATETIMESUBCATEGORY_Short:
@@ -124,20 +123,19 @@ CFX_WideString CXFA_NodeLocale::GetTimePattern(
case FX_LOCALEDATETIMESUBCATEGORY_Long:
return GetSymbol(XFA_Element::TimePatterns, L"long");
}
- return CFX_WideString();
+ return WideString();
}
-CFX_WideString CXFA_NodeLocale::GetNumPattern(
- FX_LOCALENUMSUBCATEGORY eType) const {
+WideString CXFA_NodeLocale::GetNumPattern(FX_LOCALENUMSUBCATEGORY eType) const {
return XFA_PatternToString(eType);
}
CXFA_Node* CXFA_NodeLocale::GetNodeByName(CXFA_Node* pParent,
- const CFX_WideStringC& wsName) const {
+ const WideStringView& wsName) const {
CXFA_Node* pChild =
pParent ? pParent->GetNodeItem(XFA_NODEITEM_FirstChild) : nullptr;
while (pChild) {
- CFX_WideString wsChild;
+ WideString wsChild;
if (pChild->GetAttribute(XFA_ATTRIBUTE_Name, wsChild)) {
if (wsChild == wsName)
return pChild;
@@ -147,29 +145,28 @@ CXFA_Node* CXFA_NodeLocale::GetNodeByName(CXFA_Node* pParent,
return nullptr;
}
-CFX_WideString CXFA_NodeLocale::GetSymbol(
- XFA_Element eElement,
- const CFX_WideStringC& symbol_type) const {
+WideString CXFA_NodeLocale::GetSymbol(XFA_Element eElement,
+ const WideStringView& symbol_type) const {
CXFA_Node* pSymbols = m_pLocale ? m_pLocale->GetChild(0, eElement) : nullptr;
CXFA_Node* pSymbol = GetNodeByName(pSymbols, symbol_type);
- return pSymbol ? pSymbol->GetContent() : CFX_WideString();
+ return pSymbol ? pSymbol->GetContent() : WideString();
}
-CFX_WideString CXFA_NodeLocale::GetCalendarSymbol(XFA_Element eElement,
- int index,
- bool bAbbr) const {
+WideString CXFA_NodeLocale::GetCalendarSymbol(XFA_Element eElement,
+ int index,
+ bool bAbbr) const {
CXFA_Node* pCalendar =
m_pLocale ? m_pLocale->GetChild(0, XFA_Element::CalendarSymbols)
: nullptr;
if (!pCalendar)
- return CFX_WideString();
+ return WideString();
CXFA_Node* pNode = pCalendar->GetFirstChildByClass(eElement);
for (; pNode; pNode = pNode->GetNextSameClassSibling(eElement)) {
if (pNode->GetBoolean(XFA_ATTRIBUTE_Abbr) == bAbbr) {
CXFA_Node* pSymbol = pNode->GetChild(index, XFA_Element::Unknown);
- return pSymbol ? pSymbol->GetContent() : CFX_WideString();
+ return pSymbol ? pSymbol->GetContent() : WideString();
}
}
- return CFX_WideString();
+ return WideString();
}