summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_document_imp.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-13 21:40:19 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-13 21:40:19 -0700
commitbd9748d504555f100d34025d76a9e0119986bc3f (patch)
tree829a03f0064b6593f6eff9551ed24b862a06006e /xfa/fxfa/parser/xfa_document_imp.cpp
parent6e0d67d4f55fc7cb4632f4c5d08cd7565a237d30 (diff)
downloadpdfium-bd9748d504555f100d34025d76a9e0119986bc3f.tar.xz
Remove implicit cast from CFX_WideString to (const wchar_t*)
BUG= Review URL: https://codereview.chromium.org/1882043004
Diffstat (limited to 'xfa/fxfa/parser/xfa_document_imp.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_document_imp.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/xfa/fxfa/parser/xfa_document_imp.cpp b/xfa/fxfa/parser/xfa_document_imp.cpp
index 9bdee05a55..2b848ab1b3 100644
--- a/xfa/fxfa/parser/xfa_document_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_imp.cpp
@@ -264,7 +264,7 @@ XFA_VERSION CXFA_Document::RecognizeXFAVersionNumber(
CFX_WideStringC wsTemplateURIPrefix =
XFA_GetPacketByIndex(XFA_PACKET_Template)->pURI;
FX_STRSIZE nPrefixLength = wsTemplateURIPrefix.GetLength();
- if (CFX_WideStringC(wsTemplateNS, wsTemplateNS.GetLength()) !=
+ if (CFX_WideStringC(wsTemplateNS.c_str(), wsTemplateNS.GetLength()) !=
wsTemplateURIPrefix) {
return XFA_VERSION_UNKNOWN;
}
@@ -272,10 +272,11 @@ XFA_VERSION CXFA_Document::RecognizeXFAVersionNumber(
if (nDotPos == (FX_STRSIZE)-1) {
return XFA_VERSION_UNKNOWN;
}
- int8_t iMajor =
- FXSYS_wtoi(wsTemplateNS.Mid(nPrefixLength, nDotPos - nPrefixLength));
+ int8_t iMajor = FXSYS_wtoi(
+ wsTemplateNS.Mid(nPrefixLength, nDotPos - nPrefixLength).c_str());
int8_t iMinor = FXSYS_wtoi(
- wsTemplateNS.Mid(nDotPos + 1, wsTemplateNS.GetLength() - nDotPos - 2));
+ wsTemplateNS.Mid(nDotPos + 1, wsTemplateNS.GetLength() - nDotPos - 2)
+ .c_str());
XFA_VERSION eVersion = (XFA_VERSION)((int32_t)iMajor * 100 + iMinor);
if (eVersion < XFA_VERSION_MIN || eVersion > XFA_VERSION_MAX) {
return XFA_VERSION_UNKNOWN;
@@ -390,27 +391,25 @@ void CXFA_Document::DoProtoMerge() {
if (uSharpPos < 0) {
wsURI = wsUseVal;
} else {
- wsURI = CFX_WideStringC((const FX_WCHAR*)wsUseVal, uSharpPos);
+ wsURI = CFX_WideStringC(wsUseVal.c_str(), uSharpPos);
FX_STRSIZE uLen = wsUseVal.GetLength();
if (uLen >= uSharpPos + 5 &&
- CFX_WideStringC((const FX_WCHAR*)wsUseVal + uSharpPos, 5) ==
+ CFX_WideStringC(wsUseVal.c_str() + uSharpPos, 5) ==
FX_WSTRC(L"#som(") &&
wsUseVal[uLen - 1] == ')') {
- wsSOM = CFX_WideStringC((const FX_WCHAR*)wsUseVal + uSharpPos + 5,
+ wsSOM = CFX_WideStringC(wsUseVal.c_str() + uSharpPos + 5,
uLen - 1 - uSharpPos - 5);
} else {
- wsID = CFX_WideStringC((const FX_WCHAR*)wsUseVal + uSharpPos + 1,
+ wsID = CFX_WideStringC(wsUseVal.c_str() + uSharpPos + 1,
uLen - uSharpPos - 1);
}
}
} else if (pUseHrefNode->TryCData(XFA_ATTRIBUTE_Use, wsUseVal) &&
!wsUseVal.IsEmpty()) {
if (wsUseVal[0] == '#') {
- wsID = CFX_WideStringC((const FX_WCHAR*)wsUseVal + 1,
- wsUseVal.GetLength() - 1);
+ wsID = CFX_WideStringC(wsUseVal.c_str() + 1, wsUseVal.GetLength() - 1);
} else {
- wsSOM =
- CFX_WideStringC((const FX_WCHAR*)wsUseVal, wsUseVal.GetLength());
+ wsSOM = CFX_WideStringC(wsUseVal.c_str(), wsUseVal.GetLength());
}
}
if (!wsURI.IsEmpty() && wsURI != FX_WSTRC(L".")) {