summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r--xfa/fxfa/parser/cxfa_font.cpp4
-rw-r--r--xfa/fxfa/parser/cxfa_widgetdata.cpp14
-rw-r--r--xfa/fxfa/parser/xfa_basic_imp.cpp2
-rw-r--r--xfa/fxfa/parser/xfa_document_datamerger_imp.cpp4
-rw-r--r--xfa/fxfa/parser/xfa_document_imp.cpp23
-rw-r--r--xfa/fxfa/parser/xfa_document_serialize.cpp7
-rw-r--r--xfa/fxfa/parser/xfa_localevalue.cpp8
-rw-r--r--xfa/fxfa/parser/xfa_object_imp.cpp81
-rw-r--r--xfa/fxfa/parser/xfa_parser_imp.cpp6
-rw-r--r--xfa/fxfa/parser/xfa_script_imp.cpp2
-rw-r--r--xfa/fxfa/parser/xfa_script_nodehelper.cpp4
-rw-r--r--xfa/fxfa/parser/xfa_script_resolveprocessor.cpp16
-rw-r--r--xfa/fxfa/parser/xfa_utils_imp.cpp5
13 files changed, 92 insertions, 84 deletions
diff --git a/xfa/fxfa/parser/cxfa_font.cpp b/xfa/fxfa/parser/cxfa_font.cpp
index 8579fcba80..261ef1f9ea 100644
--- a/xfa/fxfa/parser/cxfa_font.cpp
+++ b/xfa/fxfa/parser/cxfa_font.cpp
@@ -19,14 +19,14 @@ FX_FLOAT CXFA_Font::GetBaselineShift() {
FX_FLOAT CXFA_Font::GetHorizontalScale() {
CFX_WideString wsValue;
m_pNode->TryCData(XFA_ATTRIBUTE_FontHorizontalScale, wsValue);
- int32_t iScale = FXSYS_wtoi((const FX_WCHAR*)wsValue);
+ int32_t iScale = FXSYS_wtoi(wsValue.c_str());
return iScale > 0 ? (FX_FLOAT)iScale : 100.0f;
}
FX_FLOAT CXFA_Font::GetVerticalScale() {
CFX_WideString wsValue;
m_pNode->TryCData(XFA_ATTRIBUTE_FontVerticalScale, wsValue);
- int32_t iScale = FXSYS_wtoi((const FX_WCHAR*)wsValue);
+ int32_t iScale = FXSYS_wtoi(wsValue.c_str());
return iScale > 0 ? (FX_FLOAT)iScale : 100.0f;
}
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp
index 0a6b5062bc..681516d8e8 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.cpp
+++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -928,8 +928,8 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString& wsLabel,
return;
m_pNode->GetDocument()->GetNotify()->OnWidgetDataEvent(
- this, XFA_WIDGETEVENT_ListItemAdded, (void*)(const FX_WCHAR*)wsLabel,
- (void*)(const FX_WCHAR*)wsValue, (void*)(uintptr_t)nIndex);
+ this, XFA_WIDGETEVENT_ListItemAdded, (void*)wsLabel.c_str(),
+ (void*)wsValue.c_str(), (void*)(uintptr_t)nIndex);
}
void CXFA_WidgetData::GetItemLabel(const CFX_WideStringC& wsValue,
@@ -1125,7 +1125,7 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_DataLength(int32_t& val) {
CXFA_Node* pUIChild = GetUIChild();
CFX_WideString wsDataLength;
if (pUIChild->TryCData(XFA_ATTRIBUTE_DataLength, wsDataLength)) {
- val = FXSYS_wtoi(wsDataLength);
+ val = FXSYS_wtoi(wsDataLength.c_str());
return TRUE;
}
return FALSE;
@@ -1159,7 +1159,7 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ECLevel(int32_t& val) {
CXFA_Node* pUIChild = GetUIChild();
CFX_WideString wsECLevel;
if (pUIChild->TryCData(XFA_ATTRIBUTE_ErrorCorrectionLevel, wsECLevel)) {
- val = FXSYS_wtoi(wsECLevel);
+ val = FXSYS_wtoi(wsECLevel.c_str());
return TRUE;
}
return FALSE;
@@ -1239,11 +1239,11 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_WideNarrowRatio(FX_FLOAT& val) {
FX_STRSIZE ptPos = wsWideNarrowRatio.Find(':');
FX_FLOAT fRatio = 0;
if (ptPos >= 0) {
- fRatio = (FX_FLOAT)FXSYS_wtoi(wsWideNarrowRatio);
+ fRatio = (FX_FLOAT)FXSYS_wtoi(wsWideNarrowRatio.c_str());
} else {
int32_t fA, fB;
- fA = FXSYS_wtoi(wsWideNarrowRatio.Left(ptPos));
- fB = FXSYS_wtoi(wsWideNarrowRatio.Mid(ptPos + 1));
+ fA = FXSYS_wtoi(wsWideNarrowRatio.Left(ptPos).c_str());
+ fB = FXSYS_wtoi(wsWideNarrowRatio.Mid(ptPos + 1).c_str());
if (fB)
fRatio = (FX_FLOAT)fA / fB;
}
diff --git a/xfa/fxfa/parser/xfa_basic_imp.cpp b/xfa/fxfa/parser/xfa_basic_imp.cpp
index 07f1b82301..112e247016 100644
--- a/xfa/fxfa/parser/xfa_basic_imp.cpp
+++ b/xfa/fxfa/parser/xfa_basic_imp.cpp
@@ -599,7 +599,7 @@ int32_t CXFA_WideTextRead::ReadString(FX_WCHAR* pStr,
if (iMaxLength > m_wsBuffer.GetLength() - m_iPosition) {
iMaxLength = m_wsBuffer.GetLength() - m_iPosition;
}
- FXSYS_wcsncpy(pStr, (const FX_WCHAR*)m_wsBuffer + m_iPosition, iMaxLength);
+ FXSYS_wcsncpy(pStr, m_wsBuffer.c_str() + m_iPosition, iMaxLength);
m_iPosition += iMaxLength;
bEOS = IsEOF();
return iMaxLength;
diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
index ea924165d1..a75a8ea72c 100644
--- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
@@ -563,8 +563,8 @@ static CXFA_Node* XFA_NodeMerge_CloneOrMergeInstanceManager(
CXFA_NodeArray& subforms) {
CFX_WideStringC wsSubformName = pTemplateNode->GetCData(XFA_ATTRIBUTE_Name);
CFX_WideString wsInstMgrNodeName = FX_WSTRC(L"_") + wsSubformName;
- uint32_t dwInstNameHash =
- FX_HashCode_String_GetW(wsInstMgrNodeName, wsInstMgrNodeName.GetLength());
+ uint32_t dwInstNameHash = FX_HashCode_String_GetW(
+ wsInstMgrNodeName.c_str(), wsInstMgrNodeName.GetLength());
CXFA_Node* pExistingNode = XFA_DataMerge_FindFormDOMInstance(
pDocument, XFA_ELEMENT_InstanceManager, dwInstNameHash, pFormParent);
if (pExistingNode) {
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".")) {
diff --git a/xfa/fxfa/parser/xfa_document_serialize.cpp b/xfa/fxfa/parser/xfa_document_serialize.cpp
index feaebdd7b7..4c826b6e59 100644
--- a/xfa/fxfa/parser/xfa_document_serialize.cpp
+++ b/xfa/fxfa/parser/xfa_document_serialize.cpp
@@ -407,7 +407,7 @@ static void XFA_DataExporter_RegenerateFormFile_Container(
wsOutput += wsAttr;
}
if (!wsOutput.IsEmpty()) {
- pStream->WriteString((const FX_WCHAR*)wsOutput, wsOutput.GetLength());
+ pStream->WriteString(wsOutput.c_str(), wsOutput.GetLength());
}
CXFA_Node* pChildNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
if (pChildNode) {
@@ -436,7 +436,7 @@ void XFA_DataExporter_RegenerateFormFile(CXFA_Node* pNode,
static const FX_WCHAR s_pwChecksum[] = L" checksum=\"";
CFX_WideString wsChecksum = CFX_WideString::FromUTF8(pChecksum);
pStream->WriteString(s_pwChecksum, FXSYS_wcslen(s_pwChecksum));
- pStream->WriteString((const FX_WCHAR*)wsChecksum, wsChecksum.GetLength());
+ pStream->WriteString(wsChecksum.c_str(), wsChecksum.GetLength());
pStream->WriteString(L"\"", 1);
}
pStream->WriteString(L" xmlns=\"", FXSYS_wcslen(L" xmlns=\""));
@@ -450,8 +450,7 @@ void XFA_DataExporter_RegenerateFormFile(CXFA_Node* pNode,
wsVersionNumber = FX_WSTRC(L"2.8");
}
wsVersionNumber += FX_WSTRC(L"/\"\n>");
- pStream->WriteString((const FX_WCHAR*)wsVersionNumber,
- wsVersionNumber.GetLength());
+ pStream->WriteString(wsVersionNumber.c_str(), wsVersionNumber.GetLength());
CXFA_Node* pChildNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
while (pChildNode) {
XFA_DataExporter_RegenerateFormFile_Container(pChildNode, pStream);
diff --git a/xfa/fxfa/parser/xfa_localevalue.cpp b/xfa/fxfa/parser/xfa_localevalue.cpp
index 57c8054168..e36595d840 100644
--- a/xfa/fxfa/parser/xfa_localevalue.cpp
+++ b/xfa/fxfa/parser/xfa_localevalue.cpp
@@ -219,7 +219,7 @@ FX_FLOAT CXFA_LocaleValue::GetNum() const {
int32_t nExponent = 0;
int cc = 0;
FX_BOOL bNegative = FALSE, bExpSign = FALSE;
- const FX_WCHAR* str = (const FX_WCHAR*)m_wsValue;
+ const FX_WCHAR* str = m_wsValue.c_str();
int len = m_wsValue.GetLength();
while (XFA_IsSpace(str[cc]) && cc < len) {
cc++;
@@ -294,7 +294,7 @@ FX_DOUBLE CXFA_LocaleValue::GetDoubleNum() const {
int32_t nExponent = 0;
int32_t cc = 0;
FX_BOOL bNegative = FALSE, bExpSign = FALSE;
- const FX_WCHAR* str = (const FX_WCHAR*)m_wsValue;
+ const FX_WCHAR* str = m_wsValue.c_str();
int len = m_wsValue.GetLength();
while (XFA_IsSpace(str[cc]) && cc < len) {
cc++;
@@ -615,7 +615,7 @@ FX_BOOL CXFA_LocaleValue::ValidateCanonicalDate(const CFX_WideString& wsDate,
uint16_t wYear = 0;
uint16_t wMonth = 0;
uint16_t wDay = 0;
- const FX_WCHAR* pDate = (const FX_WCHAR*)wsDate;
+ const FX_WCHAR* pDate = wsDate.c_str();
int nIndex = 0, nStart = 0;
while (pDate[nIndex] != '\0' && nIndex < wCountY) {
if (!XFA_IsDigit(pDate[nIndex])) {
@@ -701,7 +701,7 @@ FX_BOOL CXFA_LocaleValue::ValidateCanonicalTime(const CFX_WideString& wsTime) {
uint16_t wMinute = 0;
uint16_t wSecond = 0;
uint16_t wFraction = 0;
- const FX_WCHAR* pTime = (const FX_WCHAR*)wsTime;
+ const FX_WCHAR* pTime = wsTime.c_str();
int nIndex = 0;
int nStart = 0;
while (nIndex - nStart < wCountH && pTime[nIndex]) {
diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp
index 157d7dfa57..87941af070 100644
--- a/xfa/fxfa/parser/xfa_object_imp.cpp
+++ b/xfa/fxfa/parser/xfa_object_imp.cpp
@@ -71,10 +71,10 @@ void CXFA_Object::ThrowScriptErrorMessage(int32_t iStringID, ...) {
CFX_WideString wsMessage;
va_list arg_ptr;
va_start(arg_ptr, iStringID);
- wsMessage.FormatV((const FX_WCHAR*)wsFormat, arg_ptr);
+ wsMessage.FormatV(wsFormat.c_str(), arg_ptr);
va_end(arg_ptr);
FXJSE_ThrowMessage(
- "", FX_UTF8Encode(wsMessage, wsMessage.GetLength()).AsStringC());
+ "", FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC());
}
static void XFA_DeleteWideString(void* pData) {
@@ -753,7 +753,8 @@ void CXFA_Node::Script_TreeClass_Nodes(FXJSE_HVALUE hValue,
CFX_WideString wsMessage;
pAppProvider->LoadString(XFA_IDS_Unable_TO_SET, wsMessage);
FXJSE_ThrowMessage(
- "", FX_UTF8Encode(wsMessage, wsMessage.GetLength()).AsStringC());
+ "",
+ FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC());
} else {
CXFA_AttachNodeList* pNodeList = new CXFA_AttachNodeList(m_pDocument, this);
FXJSE_Value_SetObject(hValue, (CXFA_Object*)pNodeList,
@@ -1480,11 +1481,9 @@ void CXFA_Node::Script_Attribute_String(FXJSE_HVALUE hValue,
->GetFirstChildByClass(XFA_ELEMENT_Proto);
if (!wsUseVal.IsEmpty()) {
if (wsUseVal[0] == '#') {
- wsID = CFX_WideString((const FX_WCHAR*)wsUseVal + 1,
- wsUseVal.GetLength() - 1);
+ wsID = CFX_WideString(wsUseVal.c_str() + 1, wsUseVal.GetLength() - 1);
} else {
- wsSOM =
- CFX_WideString((const FX_WCHAR*)wsUseVal, wsUseVal.GetLength());
+ wsSOM = wsUseVal;
}
}
CXFA_Node* pProtoNode = NULL;
@@ -1527,7 +1526,8 @@ void CXFA_Node::Script_Attribute_String(FXJSE_HVALUE hValue,
CFX_WideString wsValue;
GetAttribute(eAttribute, wsValue);
FXJSE_Value_SetUTF8String(
- hValue, FX_UTF8Encode(wsValue, wsValue.GetLength()).AsStringC());
+ hValue,
+ FX_UTF8Encode(wsValue.c_str(), wsValue.GetLength()).AsStringC());
}
}
void CXFA_Node::Script_Attribute_StringRead(FXJSE_HVALUE hValue,
@@ -1537,7 +1537,8 @@ void CXFA_Node::Script_Attribute_StringRead(FXJSE_HVALUE hValue,
CFX_WideString wsValue;
GetAttribute(eAttribute, wsValue);
FXJSE_Value_SetUTF8String(
- hValue, FX_UTF8Encode(wsValue, wsValue.GetLength()).AsStringC());
+ hValue,
+ FX_UTF8Encode(wsValue.c_str(), wsValue.GetLength()).AsStringC());
} else {
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
}
@@ -1697,13 +1698,14 @@ void CXFA_Node::Script_Som_DefaultValue(FXJSE_HVALUE hValue,
classID != XFA_ELEMENT_SubmitUrl) {
FXJSE_Value_SetNull(hValue);
} else if (classID == XFA_ELEMENT_Integer) {
- FXJSE_Value_SetInteger(hValue, FXSYS_wtoi(content));
+ FXJSE_Value_SetInteger(hValue, FXSYS_wtoi(content.c_str()));
} else if (classID == XFA_ELEMENT_Float || classID == XFA_ELEMENT_Decimal) {
CFX_Decimal decimal(content.AsStringC());
FXJSE_Value_SetFloat(hValue, (FX_FLOAT)(double)decimal);
} else {
FXJSE_Value_SetUTF8String(
- hValue, FX_UTF8Encode(content, content.GetLength()).AsStringC());
+ hValue,
+ FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC());
}
}
}
@@ -1719,7 +1721,8 @@ void CXFA_Node::Script_Som_DefaultValue_Read(FXJSE_HVALUE hValue,
FXJSE_Value_SetNull(hValue);
} else {
FXJSE_Value_SetUTF8String(
- hValue, FX_UTF8Encode(content, content.GetLength()).AsStringC());
+ hValue,
+ FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC());
}
}
void CXFA_Node::Script_Boolean_Value(FXJSE_HVALUE hValue,
@@ -1959,7 +1962,8 @@ void CXFA_Node::Script_Draw_DefaultValue(FXJSE_HVALUE hValue,
FXJSE_Value_SetNull(hValue);
} else {
FXJSE_Value_SetUTF8String(
- hValue, FX_UTF8Encode(content, content.GetLength()).AsStringC());
+ hValue,
+ FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC());
}
}
}
@@ -2012,21 +2016,24 @@ void CXFA_Node::Script_Field_DefaultValue(FXJSE_HVALUE hValue,
if (eUI == XFA_ELEMENT_NumericEdit &&
(pNode->GetInteger(XFA_ATTRIBUTE_FracDigits) == -1)) {
FXJSE_Value_SetUTF8String(
- hValue, FX_UTF8Encode(content, content.GetLength()).AsStringC());
+ hValue,
+ FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC());
} else {
CFX_Decimal decimal(content.AsStringC());
FXJSE_Value_SetFloat(hValue, (FX_FLOAT)(double)decimal);
}
} else if (pNode && pNode->GetClassID() == XFA_ELEMENT_Integer) {
- FXJSE_Value_SetInteger(hValue, FXSYS_wtoi(content));
+ FXJSE_Value_SetInteger(hValue, FXSYS_wtoi(content.c_str()));
} else if (pNode && pNode->GetClassID() == XFA_ELEMENT_Boolean) {
- FXJSE_Value_SetBoolean(hValue, FXSYS_wtoi(content) == 0 ? FALSE : TRUE);
+ FXJSE_Value_SetBoolean(hValue,
+ FXSYS_wtoi(content.c_str()) == 0 ? FALSE : TRUE);
} else if (pNode && pNode->GetClassID() == XFA_ELEMENT_Float) {
CFX_Decimal decimal(content.AsStringC());
FXJSE_Value_SetFloat(hValue, (FX_FLOAT)(double)decimal);
} else {
FXJSE_Value_SetUTF8String(
- hValue, FX_UTF8Encode(content, content.GetLength()).AsStringC());
+ hValue,
+ FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC());
}
}
}
@@ -2230,7 +2237,7 @@ void CXFA_Node::Script_Field_GetSaveItem(CFXJSE_Arguments* pArguments) {
if (bHasItem) {
FXJSE_Value_SetUTF8String(
pArguments->GetReturnValue(),
- FX_UTF8Encode(wsValue, wsValue.GetLength()).AsStringC());
+ FX_UTF8Encode(wsValue.c_str(), wsValue.GetLength()).AsStringC());
} else {
FXJSE_Value_SetNull(pArguments->GetReturnValue());
}
@@ -2308,7 +2315,7 @@ void CXFA_Node::Script_Field_GetDisplayItem(CFXJSE_Arguments* pArguments) {
if (bHasItem) {
FXJSE_Value_SetUTF8String(
pArguments->GetReturnValue(),
- FX_UTF8Encode(wsValue, wsValue.GetLength()).AsStringC());
+ FX_UTF8Encode(wsValue.c_str(), wsValue.GetLength()).AsStringC());
} else {
FXJSE_Value_SetNull(pArguments->GetReturnValue());
}
@@ -2596,8 +2603,8 @@ void CXFA_Node::Script_Subform_Locale(FXJSE_HVALUE hValue,
CFX_WideString wsLocaleName;
GetLocaleName(wsLocaleName);
FXJSE_Value_SetUTF8String(
- hValue,
- FX_UTF8Encode(wsLocaleName, wsLocaleName.GetLength()).AsStringC());
+ hValue, FX_UTF8Encode(wsLocaleName.c_str(), wsLocaleName.GetLength())
+ .AsStringC());
}
}
void CXFA_Node::Script_Subform_ExecEvent(CFXJSE_Arguments* pArguments) {
@@ -2737,8 +2744,8 @@ void CXFA_Node::Script_Template_CreateNode(CFXJSE_Arguments* pArguments) {
pArguments->GetReturnValue(),
m_pDocument->GetScriptContext()->GetJSValueFromMap(pNewNode));
} else {
- ThrowScriptErrorMessage(XFA_IDS_NOT_HAVE_PROPERTY,
- (const FX_WCHAR*)strTagName, L"name");
+ ThrowScriptErrorMessage(XFA_IDS_NOT_HAVE_PROPERTY, strTagName.c_str(),
+ L"name");
}
} else {
FXJSE_Value_Set(
@@ -3296,7 +3303,7 @@ int32_t CXFA_Node::InstanceManager_SetInstances(int32_t iDesired) {
: wsInstManagerName.Mid(1);
uint32_t dInstanceNameHash =
wsInstanceName.IsEmpty() ? 0 : FX_HashCode_String_GetW(
- wsInstanceName,
+ wsInstanceName.c_str(),
wsInstanceName.GetLength());
CXFA_Node* pPrevSibling =
(iDesired == 0) ? this
@@ -3492,7 +3499,8 @@ void CXFA_Node::Script_Form_Checksum(FXJSE_HVALUE hValue,
CFX_WideString wsChecksum;
GetAttribute(XFA_ATTRIBUTE_Checksum, wsChecksum, FALSE);
FXJSE_Value_SetUTF8String(
- hValue, FX_UTF8Encode(wsChecksum, wsChecksum.GetLength()).AsStringC());
+ hValue,
+ FX_UTF8Encode(wsChecksum.c_str(), wsChecksum.GetLength()).AsStringC());
}
}
void CXFA_Node::Script_Packet_GetAttribute(CFXJSE_Arguments* pArguments) {
@@ -3502,13 +3510,13 @@ void CXFA_Node::Script_Packet_GetAttribute(CFXJSE_Arguments* pArguments) {
CFX_WideString wsAttributeValue;
CFDE_XMLNode* pXMLNode = GetXMLMappingNode();
if (pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element) {
- static_cast<CFDE_XMLElement*>(pXMLNode)
- ->GetString(CFX_WideString::FromUTF8(bsAttributeName.AsStringC()),
- wsAttributeValue);
+ static_cast<CFDE_XMLElement*>(pXMLNode)->GetString(
+ CFX_WideString::FromUTF8(bsAttributeName.AsStringC()).c_str(),
+ wsAttributeValue);
}
FXJSE_Value_SetUTF8String(
pArguments->GetReturnValue(),
- FX_UTF8Encode(wsAttributeValue, wsAttributeValue.GetLength())
+ FX_UTF8Encode(wsAttributeValue.c_str(), wsAttributeValue.GetLength())
.AsStringC());
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
@@ -3540,8 +3548,8 @@ void CXFA_Node::Script_Packet_RemoveAttribute(CFXJSE_Arguments* pArguments) {
CFDE_XMLNode* pXMLNode = GetXMLMappingNode();
if (pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element) {
CFDE_XMLElement* pXMLElement = static_cast<CFDE_XMLElement*>(pXMLNode);
- if (pXMLElement->HasAttribute(wsName)) {
- pXMLElement->RemoveAttribute(wsName);
+ if (pXMLElement->HasAttribute(wsName.c_str())) {
+ pXMLElement->RemoveAttribute(wsName.c_str());
}
}
FXJSE_Value_SetNull(pArguments->GetReturnValue());
@@ -3570,7 +3578,8 @@ void CXFA_Node::Script_Packet_Content(FXJSE_HVALUE hValue,
pXMLElement->GetTextData(wsTextData);
}
FXJSE_Value_SetUTF8String(
- hValue, FX_UTF8Encode(wsTextData, wsTextData.GetLength()).AsStringC());
+ hValue,
+ FX_UTF8Encode(wsTextData.c_str(), wsTextData.GetLength()).AsStringC());
}
}
void CXFA_Node::Script_Source_Next(CFXJSE_Arguments* pArguments) {
@@ -3937,7 +3946,7 @@ FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr,
FX_BOOL bNotify,
FX_BOOL bScriptModify) {
void* pKey = XFA_GetMapKey_Element(GetClassID(), eAttr);
- OnChanging(eAttr, (void*)(const FX_WCHAR*)wsValue, bNotify);
+ OnChanging(eAttr, (void*)wsValue.c_str(), bNotify);
if (eAttr == XFA_ATTRIBUTE_Value) {
CFX_WideString* pClone = new CFX_WideString(wsValue);
SetUserData(pKey, pClone, &deleteWideStringCallBack);
@@ -3946,7 +3955,7 @@ FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr,
if (eAttr == XFA_ATTRIBUTE_Name)
UpdateNameHash();
}
- OnChanged(eAttr, (void*)(const FX_WCHAR*)wsValue, bNotify, bScriptModify);
+ OnChanged(eAttr, (void*)wsValue.c_str(), bNotify, bScriptModify);
if (IsNeedSavingXMLNode() && eAttr != XFA_ATTRIBUTE_QualifiedName &&
eAttr != XFA_ATTRIBUTE_BindingNode) {
if (eAttr == XFA_ATTRIBUTE_Name &&
@@ -4006,10 +4015,10 @@ FX_BOOL CXFA_Node::SetAttributeValue(const CFX_WideString& wsValue,
FX_BOOL bNotify,
FX_BOOL bScriptModify) {
void* pKey = XFA_GetMapKey_Element(GetClassID(), XFA_ATTRIBUTE_Value);
- OnChanging(XFA_ATTRIBUTE_Value, (void*)(const FX_WCHAR*)wsValue, bNotify);
+ OnChanging(XFA_ATTRIBUTE_Value, (void*)wsValue.c_str(), bNotify);
CFX_WideString* pClone = new CFX_WideString(wsValue);
SetUserData(pKey, pClone, &deleteWideStringCallBack);
- OnChanged(XFA_ATTRIBUTE_Value, (void*)(const FX_WCHAR*)wsValue, bNotify,
+ OnChanged(XFA_ATTRIBUTE_Value, (void*)wsValue.c_str(), bNotify,
bScriptModify);
if (IsNeedSavingXMLNode()) {
FDE_XMLNODETYPE eXMLType = m_pXMLNode->GetType();
diff --git a/xfa/fxfa/parser/xfa_parser_imp.cpp b/xfa/fxfa/parser/xfa_parser_imp.cpp
index 5cd28e79df..4bb47ddc5d 100644
--- a/xfa/fxfa/parser/xfa_parser_imp.cpp
+++ b/xfa/fxfa/parser/xfa_parser_imp.cpp
@@ -212,8 +212,8 @@ FX_BOOL XFA_FDEExtension_ResolveNamespaceQualifier(
if (pNode->GetType() != FDE_XMLNODE_Element) {
continue;
}
- if (pNode->HasAttribute(wsNSAttribute)) {
- pNode->GetString(wsNSAttribute, wsNamespaceURI);
+ if (pNode->HasAttribute(wsNSAttribute.c_str())) {
+ pNode->GetString(wsNSAttribute.c_str(), wsNamespaceURI);
return TRUE;
}
}
@@ -1149,7 +1149,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode,
}
if (!bNeedValue) {
CFX_WideString wsNilName = FX_WSTRC(L"xsi:nil");
- pXMLElement->RemoveAttribute(wsNilName);
+ pXMLElement->RemoveAttribute(wsNilName.c_str());
}
}
pXFANode->InsertChild(pXFAChild);
diff --git a/xfa/fxfa/parser/xfa_script_imp.cpp b/xfa/fxfa/parser/xfa_script_imp.cpp
index d92cdc7271..84d84bd153 100644
--- a/xfa/fxfa/parser/xfa_script_imp.cpp
+++ b/xfa/fxfa/parser/xfa_script_imp.cpp
@@ -181,7 +181,7 @@ void CXFA_ScriptContext::GlobalPropertyGetter(FXJSE_HOBJECT hObject,
return;
}
uint32_t uHashCode =
- FX_HashCode_String_GetW(wsPropName, wsPropName.GetLength());
+ FX_HashCode_String_GetW(wsPropName.c_str(), wsPropName.GetLength());
if (uHashCode != XFA_HASHCODE_Layout) {
CXFA_Object* pObject =
lpScriptContext->GetDocument()->GetXFAObject(uHashCode);
diff --git a/xfa/fxfa/parser/xfa_script_nodehelper.cpp b/xfa/fxfa/parser/xfa_script_nodehelper.cpp
index 619ba65fff..1b79ad94be 100644
--- a/xfa/fxfa/parser/xfa_script_nodehelper.cpp
+++ b/xfa/fxfa/parser/xfa_script_nodehelper.cpp
@@ -284,13 +284,13 @@ void CXFA_NodeHelper::XFA_GetNameExpression(CXFA_Node* refNode,
(bIsProperty && refNode->GetClassID() != XFA_ELEMENT_PageSet)) {
refNode->GetClassName(wsTagName);
ws = wsTagName;
- wsName.Format(L"#%s[%d]", (const FX_WCHAR*)ws,
+ wsName.Format(L"#%s[%d]", ws.c_str(),
XFA_GetIndex(refNode, eLogicType, bIsProperty, TRUE));
return;
}
ws = refNode->GetCData(XFA_ATTRIBUTE_Name);
ws.Replace(L".", L"\\.");
- wsName.Format(L"%s[%d]", (const FX_WCHAR*)ws,
+ wsName.Format(L"%s[%d]", ws.c_str(),
XFA_GetIndex(refNode, eLogicType, bIsProperty, FALSE));
}
diff --git a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp
index 6ebec5da9c..09f513714c 100644
--- a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp
+++ b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp
@@ -96,8 +96,8 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_AnyChild(
bClassName = TRUE;
wsName = wsName.Right(wsName.GetLength() - 1);
}
- findNode = m_pNodeHelper->XFA_ResolveNodes_GetOneChild(ToNode(rnd.m_CurNode),
- wsName, bClassName);
+ findNode = m_pNodeHelper->XFA_ResolveNodes_GetOneChild(
+ ToNode(rnd.m_CurNode), wsName.c_str(), bClassName);
if (findNode == NULL) {
return 0;
}
@@ -124,7 +124,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Dollar(
return -1;
}
uint32_t dwNameHash =
- FX_HashCode_String_GetW((const FX_WCHAR*)wsName + 1, iNameLen - 1);
+ FX_HashCode_String_GetW(wsName.c_str() + 1, iNameLen - 1);
if (dwNameHash == XFA_HASHCODE_Xfa) {
nodes.Add(rnd.m_pSC->GetDocument()->GetRoot());
} else {
@@ -152,8 +152,8 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Excalmatory(
rndFind.m_pSC = rnd.m_pSC;
rndFind.m_CurNode = datasets;
rndFind.m_wsName = rnd.m_wsName.Right(rnd.m_wsName.GetLength() - 1);
- rndFind.m_uHashName =
- FX_HashCode_String_GetW(rndFind.m_wsName, rndFind.m_wsName.GetLength());
+ rndFind.m_uHashName = FX_HashCode_String_GetW(rndFind.m_wsName.c_str(),
+ rndFind.m_wsName.GetLength());
rndFind.m_nLevel = rnd.m_nLevel + 1;
rndFind.m_dwStyles = XFA_RESOLVENODE_Children;
rndFind.m_wsCondition = rnd.m_wsCondition;
@@ -179,8 +179,8 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_NumberSign(
rndFind.m_dwStyles |= XFA_RESOLVENODE_TagName;
rndFind.m_dwStyles &= ~XFA_RESOLVENODE_Attributes;
rndFind.m_wsName = wsName;
- rndFind.m_uHashName =
- FX_HashCode_String_GetW(rndFind.m_wsName, rndFind.m_wsName.GetLength());
+ rndFind.m_uHashName = FX_HashCode_String_GetW(rndFind.m_wsName.c_str(),
+ rndFind.m_wsName.GetLength());
rndFind.m_wsCondition = wsCondition;
rndFind.m_CurNode = curNode;
XFA_ResolveNodes_Normal(rndFind);
@@ -618,7 +618,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_GetFilter(
wsCondition.ReleaseBuffer(nConditionCount);
wsCondition.TrimLeft();
wsCondition.TrimRight();
- rnd.m_uHashName = FX_HashCode_String_GetW(wsName, wsName.GetLength());
+ rnd.m_uHashName = FX_HashCode_String_GetW(wsName.c_str(), wsName.GetLength());
return nStart;
}
void CXFA_ResolveProcessor::XFA_ResolveNode_ConditionArray(
diff --git a/xfa/fxfa/parser/xfa_utils_imp.cpp b/xfa/fxfa/parser/xfa_utils_imp.cpp
index 1b3dddc674..ec7a10c10d 100644
--- a/xfa/fxfa/parser/xfa_utils_imp.cpp
+++ b/xfa/fxfa/parser/xfa_utils_imp.cpp
@@ -197,7 +197,8 @@ void XFA_GetPlainTextFromRichText(CFDE_XMLNode* pXMLNode,
CFDE_XMLElement* pXMLElement = static_cast<CFDE_XMLElement*>(pXMLNode);
CFX_WideString wsTag;
pXMLElement->GetLocalTagName(wsTag);
- uint32_t uTag = FX_HashCode_String_GetW(wsTag, wsTag.GetLength(), TRUE);
+ uint32_t uTag =
+ FX_HashCode_String_GetW(wsTag.c_str(), wsTag.GetLength(), TRUE);
if (uTag == 0x0001f714) {
wsPlainText += L"\n";
} else if (uTag == 0x00000070) {
@@ -321,7 +322,7 @@ FX_DOUBLE XFA_WideStringToDouble(const CFX_WideString& wsStringVal) {
int32_t nExponent = 0;
int32_t cc = 0;
FX_BOOL bNegative = FALSE, bExpSign = FALSE;
- const FX_WCHAR* str = (const FX_WCHAR*)wsValue;
+ const FX_WCHAR* str = wsValue.c_str();
int32_t len = wsValue.GetLength();
if (str[0] == '+') {
cc++;