Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Unified Diff: xfa/fxfa/parser/xfa_document_imp.cpp

Issue 1882043004: Remove implicit cast from CFX_WideString to (const wchar_t*) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: win error #2 Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxfa/parser/xfa_document_datamerger_imp.cpp ('k') | xfa/fxfa/parser/xfa_document_serialize.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/xfa_document_imp.cpp
diff --git a/xfa/fxfa/parser/xfa_document_imp.cpp b/xfa/fxfa/parser/xfa_document_imp.cpp
index 9bdee05a55e99f9140d45d9c95bef25d735da1f6..2b848ab1b38e8567f2a24131bd834c0a2a98deba 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".")) {
« no previous file with comments | « xfa/fxfa/parser/xfa_document_datamerger_imp.cpp ('k') | xfa/fxfa/parser/xfa_document_serialize.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698