summaryrefslogtreecommitdiff
path: root/xfa/fgas
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-04 16:41:35 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-04 16:41:35 -0700
commit28f97ff783c16f3391384ce97b765ce4eb310ac7 (patch)
tree69c4c8bc9dd39d5336c96f28b633d197dd207c81 /xfa/fgas
parented9c4386713084f37548b46ab36f618021f716f5 (diff)
downloadpdfium-28f97ff783c16f3391384ce97b765ce4eb310ac7.tar.xz
Make down-conversion explicit from CFX_ByteString to CFX_ByteStringC.
Having this happen implicitly can be dangerous because the lifetime has to be considered; we should have caught the "red bots" in https://codereview.chromium.org/1847333004/#ps60001 at compile time. Review URL: https://codereview.chromium.org/1853233002
Diffstat (limited to 'xfa/fgas')
-rw-r--r--xfa/fgas/localization/fgas_locale.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/xfa/fgas/localization/fgas_locale.cpp b/xfa/fgas/localization/fgas_locale.cpp
index 2d72454038..8cf80ce4f1 100644
--- a/xfa/fgas/localization/fgas_locale.cpp
+++ b/xfa/fgas/localization/fgas_locale.cpp
@@ -111,12 +111,12 @@ void CFX_Locale::GetNumbericSymbol(FX_LOCALENUMSYMBOL eType,
CFX_ByteString bsSpace;
CFX_WideString wsName = gs_LocalNumberSymbols[eType];
CXML_Element* pNumberSymbols =
- m_pElement->GetElement(bsSpace, "numberSymbols");
+ m_pElement->GetElement(bsSpace.AsByteStringC(), "numberSymbols");
if (!pNumberSymbols) {
return;
}
- wsNumSymbol =
- FX_GetXMLContent(bsSpace, pNumberSymbols, "numberSymbol", wsName);
+ wsNumSymbol = FX_GetXMLContent(bsSpace.AsByteStringC(), pNumberSymbols,
+ "numberSymbol", wsName);
}
void CFX_Locale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const {
if (!m_pElement) {
@@ -124,7 +124,7 @@ void CFX_Locale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const {
}
CFX_ByteString bsSpace;
CXML_Element* pNumberSymbols =
- m_pElement->GetElement(bsSpace, "dateTimeSymbols");
+ m_pElement->GetElement(bsSpace.AsByteStringC(), "dateTimeSymbols");
if (!pNumberSymbols) {
return;
}
@@ -137,20 +137,23 @@ static void FX_GetCalendarSymbol(CXML_Element* pXmlElement,
CFX_WideString& wsName) {
CFX_ByteString bsSpace;
CFX_ByteString pstrSymbolNames = symbol_type + "Names";
- CXML_Element* pChild = pXmlElement->GetElement(bsSpace, "calendarSymbols");
+ CXML_Element* pChild =
+ pXmlElement->GetElement(bsSpace.AsByteStringC(), "calendarSymbols");
if (!pChild) {
return;
}
- CXML_Element* pSymbolNames = pChild->GetElement(bsSpace, pstrSymbolNames);
+ CXML_Element* pSymbolNames = pChild->GetElement(
+ bsSpace.AsByteStringC(), pstrSymbolNames.AsByteStringC());
if (!pSymbolNames) {
return;
}
if (pSymbolNames->GetAttrInteger("abbr") != bAbbr) {
- pSymbolNames = pChild->GetElement(bsSpace, pstrSymbolNames, 1);
+ pSymbolNames = pChild->GetElement(bsSpace.AsByteStringC(),
+ pstrSymbolNames.AsByteStringC(), 1);
}
if (pSymbolNames && pSymbolNames->GetAttrInteger("abbr") == bAbbr) {
- CXML_Element* pSymbolName =
- pSymbolNames->GetElement(bsSpace, symbol_type, index);
+ CXML_Element* pSymbolName = pSymbolNames->GetElement(
+ bsSpace.AsByteStringC(), symbol_type.AsByteStringC(), index);
if (pSymbolName) {
wsName = pSymbolName->GetContent(0);
}
@@ -228,13 +231,13 @@ static void FX_GetPattern(CXML_Element* pXmlElement,
const CFX_WideString& wsSubCategory,
CFX_WideString& wsPattern) {
CFX_ByteString bsSpace;
- CXML_Element* pDatePatterns =
- pXmlElement->GetElement(bsSpace, bsCategory + "s");
+ CXML_Element* pDatePatterns = pXmlElement->GetElement(
+ bsSpace.AsByteStringC(), (bsCategory + "s").AsByteStringC());
if (!pDatePatterns) {
return;
}
- wsPattern =
- FX_GetXMLContent(bsSpace, pDatePatterns, bsCategory, wsSubCategory);
+ wsPattern = FX_GetXMLContent(bsSpace.AsByteStringC(), pDatePatterns,
+ bsCategory.AsByteStringC(), wsSubCategory);
}
static void FX_GetDateTimePattern(CXML_Element* pXmlElement,
const CFX_ByteString& bsCategory,