diff options
author | tsepez <tsepez@chromium.org> | 2016-04-08 12:20:38 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-08 12:20:39 -0700 |
commit | 4c3debb3c91f5842784be30a911b52cdabcab7df (patch) | |
tree | e0534dcb43a71376be8da0b376a97de37080ecc5 /xfa/fxfa/parser | |
parent | f172290a8dc527cd8bc73b0d0ad59e78797968c1 (diff) | |
download | pdfium-4c3debb3c91f5842784be30a911b52cdabcab7df.tar.xz |
Rename both As{Byte,Wide}StringC() helpers to AsStringC().
The naming is redundant given the base type, and will stand
in the way of consolidating Byte and Wide code.
BUG=
Review URL: https://codereview.chromium.org/1862123003
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r-- | xfa/fxfa/parser/cxfa_image.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_validate.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_widgetdata.cpp | 26 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_document_datamerger_imp.cpp | 19 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_document_serialize.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_layout_itemlayout.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp | 4 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_locale.cpp | 16 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_localemgr.cpp | 4 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_localevalue.cpp | 4 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_object_imp.cpp | 220 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_parser_imp.cpp | 26 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp | 4 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp | 76 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_script_imp.cpp | 32 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp | 6 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_script_nodehelper.cpp | 5 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_script_resolveprocessor.cpp | 14 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp | 9 |
19 files changed, 221 insertions, 252 deletions
diff --git a/xfa/fxfa/parser/cxfa_image.cpp b/xfa/fxfa/parser/cxfa_image.cpp index c54a580b80..bcc7466dce 100644 --- a/xfa/fxfa/parser/cxfa_image.cpp +++ b/xfa/fxfa/parser/cxfa_image.cpp @@ -42,7 +42,7 @@ FX_BOOL CXFA_Image::SetContentType(const CFX_WideString& wsContentType) { FX_BOOL CXFA_Image::SetHref(const CFX_WideString& wsHref) { if (m_bDefValue) return m_pNode->SetCData(XFA_ATTRIBUTE_Href, wsHref); - return m_pNode->SetAttribute(XFA_ATTRIBUTE_Href, wsHref.AsWideStringC()); + return m_pNode->SetAttribute(XFA_ATTRIBUTE_Href, wsHref.AsStringC()); } FX_BOOL CXFA_Image::SetTransferEncoding(int32_t iTransferEncoding) { diff --git a/xfa/fxfa/parser/cxfa_validate.cpp b/xfa/fxfa/parser/cxfa_validate.cpp index d226cbf52a..db0ffb4fa6 100644 --- a/xfa/fxfa/parser/cxfa_validate.cpp +++ b/xfa/fxfa/parser/cxfa_validate.cpp @@ -18,7 +18,7 @@ FX_BOOL CXFA_Validate::SetTestValue(int32_t iType, CFX_WideString& wsValue, XFA_ATTRIBUTEENUM eName) { const XFA_ATTRIBUTEENUMINFO* pInfo = - XFA_GetAttributeEnumByName(wsValue.AsWideStringC()); + XFA_GetAttributeEnumByName(wsValue.AsStringC()); if (pInfo) eName = pInfo->eName; diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index 91bb348b91..0a6b5062bc 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -820,7 +820,7 @@ void CXFA_WidgetData::SetItemState(int32_t nIndex, if (iSel < 0) { CFX_WideString wsSaveText = wsSaveTextArray[nIndex]; CFX_WideString wsFormatText(wsSaveText); - GetFormatDataValue(wsSaveText.AsWideStringC(), wsFormatText); + GetFormatDataValue(wsSaveText.AsStringC(), wsFormatText); m_pNode->SetContent(wsSaveText, wsFormatText, bNotify, bScriptModify, bSyncData); } @@ -850,7 +850,7 @@ void CXFA_WidgetData::SetSelectedItems(CFX_Int32Array& iSelArray, } CFX_WideString wsFormat(wsValue); if (GetChoiceListOpen() != XFA_ATTRIBUTEENUM_MultiSelect) - GetFormatDataValue(wsValue.AsWideStringC(), wsFormat); + GetFormatDataValue(wsValue.AsStringC(), wsFormat); m_pNode->SetContent(wsValue, wsFormat, bNotify, bScriptModify, bSyncData); } @@ -889,19 +889,19 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString& wsLabel, if (iCount < 1) { CXFA_Node* pItems = m_pNode->CreateSamePacketNode(XFA_ELEMENT_Items); m_pNode->InsertChild(-1, pItems); - InsertListTextItem(pItems, wsLabel.AsWideStringC(), nIndex); + InsertListTextItem(pItems, wsLabel.AsStringC(), nIndex); CXFA_Node* pSaveItems = m_pNode->CreateSamePacketNode(XFA_ELEMENT_Items); m_pNode->InsertChild(-1, pSaveItems); pSaveItems->SetBoolean(XFA_ATTRIBUTE_Save, TRUE); - InsertListTextItem(pSaveItems, wsNewValue.AsWideStringC(), nIndex); + InsertListTextItem(pSaveItems, wsNewValue.AsStringC(), nIndex); } else if (iCount > 1) { for (int32_t i = 0; i < 2; i++) { CXFA_Node* pNode = listitems[i]; FX_BOOL bHasSave = pNode->GetBoolean(XFA_ATTRIBUTE_Save); if (bHasSave) - InsertListTextItem(pNode, wsNewValue.AsWideStringC(), nIndex); + InsertListTextItem(pNode, wsNewValue.AsStringC(), nIndex); else - InsertListTextItem(pNode, wsLabel.AsWideStringC(), nIndex); + InsertListTextItem(pNode, wsLabel.AsStringC(), nIndex); } } else { CXFA_Node* pNode = listitems[0]; @@ -917,12 +917,12 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString& wsLabel, while (pListNode) { CFX_WideString wsOldValue; pListNode->TryContent(wsOldValue); - InsertListTextItem(pSaveItems, wsOldValue.AsWideStringC(), i); + InsertListTextItem(pSaveItems, wsOldValue.AsStringC(), i); i++; pListNode = pListNode->GetNodeItem(XFA_NODEITEM_NextSibling); } - InsertListTextItem(pNode, wsLabel.AsWideStringC(), nIndex); - InsertListTextItem(pSaveItems, wsNewValue.AsWideStringC(), nIndex); + InsertListTextItem(pNode, wsLabel.AsStringC(), nIndex); + InsertListTextItem(pSaveItems, wsNewValue.AsStringC(), nIndex); } if (!bNotify) return; @@ -1481,7 +1481,7 @@ IFX_Locale* CXFA_WidgetData::GetLocal() { pLocale = m_pNode->GetDocument()->GetLocalMgr()->GetDefLocale(); } else { pLocale = m_pNode->GetDocument()->GetLocalMgr()->GetLocaleByName( - wsLocaleName.AsWideStringC()); + wsLocaleName.AsStringC()); } } return pLocale; @@ -1492,7 +1492,7 @@ FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString& wsValue, wsValue = m_pNode->GetContent(); if (eValueType == XFA_VALUEPICTURE_Display) - GetItemLabel(wsValue.AsWideStringC(), wsValue); + GetItemLabel(wsValue.AsStringC(), wsValue); CFX_WideString wsPicture; GetPictureContent(wsPicture, eValueType); @@ -1738,7 +1738,7 @@ void CXFA_WidgetData::SyncValue(const CFX_WideString& wsValue, CFX_WideString wsFormatValue(wsValue); CXFA_WidgetData* pContainerWidgetData = m_pNode->GetContainerWidgetData(); if (pContainerWidgetData) - pContainerWidgetData->GetFormatDataValue(wsValue.AsWideStringC(), + pContainerWidgetData->GetFormatDataValue(wsValue.AsStringC(), wsFormatValue); m_pNode->SetContent(wsValue, wsFormatValue, bNotify); @@ -1780,7 +1780,7 @@ CFX_WideString CXFA_WidgetData::NumericLimit(const CFX_WideString& wsValue, iTread_++; if (iTread_ > iTread) { if (iTread != -1) { - CFX_Decimal wsDeci = CFX_Decimal(wsValue.AsWideStringC()); + CFX_Decimal wsDeci = CFX_Decimal(wsValue.AsStringC()); wsDeci.SetScale(iTread); wsRet = wsDeci; } diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp index f812d03032..ea924165d1 100644 --- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp @@ -132,8 +132,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, CFDE_XMLElement* pXMLDataElement = static_cast<CFDE_XMLElement*>(pDataNode->GetXMLMappingNode()); FXSYS_assert(pXMLDataElement); - pWidgetData->GetFormatDataValue(wsValue.AsWideStringC(), - wsFormatedValue); + pWidgetData->GetFormatDataValue(wsValue.AsStringC(), wsFormatedValue); pDataNode->SetAttributeValue(wsValue, wsFormatedValue); pDataNode->SetCData(XFA_ATTRIBUTE_ContentType, wsContentType); if (!wsHref.IsEmpty()) { @@ -162,8 +161,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, ->SetString(FX_WSTRC(L"xfa:dataNode"), FX_WSTRC(L"dataGroup")); } } else if (!wsValue.IsEmpty()) { - pWidgetData->GetFormatDataValue(wsValue.AsWideStringC(), - wsFormatedValue); + pWidgetData->GetFormatDataValue(wsValue.AsStringC(), wsFormatedValue); pDataNode->SetAttributeValue(wsValue, wsFormatedValue); } break; @@ -172,8 +170,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, if (wsValue.IsEmpty()) { break; } - pWidgetData->GetFormatDataValue(wsValue.AsWideStringC(), - wsFormatedValue); + pWidgetData->GetFormatDataValue(wsValue.AsStringC(), wsFormatedValue); pDataNode->SetAttributeValue(wsValue, wsFormatedValue); break; case XFA_ELEMENT_ExclGroup: { @@ -243,8 +240,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, CFX_WideString wsOutput; pWidgetData->NormalizeNumStr(wsValue, wsOutput); wsValue = wsOutput; - pWidgetData->GetFormatDataValue(wsValue.AsWideStringC(), - wsFormatedValue); + pWidgetData->GetFormatDataValue(wsValue.AsStringC(), wsFormatedValue); pDataNode->SetAttributeValue(wsValue, wsFormatedValue); CXFA_Node* pValue = pFormNode->GetProperty(0, XFA_ELEMENT_Value); XFA_DataMerge_FormValueNode_SetChildContent(pValue, wsValue, @@ -255,8 +251,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, if (wsValue.IsEmpty()) { break; } - pWidgetData->GetFormatDataValue(wsValue.AsWideStringC(), - wsFormatedValue); + pWidgetData->GetFormatDataValue(wsValue.AsStringC(), wsFormatedValue); pDataNode->SetAttributeValue(wsValue, wsFormatedValue); break; } @@ -264,7 +259,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, CFX_WideString wsXMLValue; pDataNode->TryContent(wsXMLValue); CFX_WideString wsNormailizeValue; - pWidgetData->GetNormalizeDataValue(wsXMLValue.AsWideStringC(), + pWidgetData->GetNormalizeDataValue(wsXMLValue.AsStringC(), wsNormailizeValue); pDataNode->SetAttributeValue(wsNormailizeValue, wsXMLValue); switch (eUIType) { @@ -319,7 +314,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, defValue.GetNode(), wsNormailizeValue, XFA_ELEMENT_Text); break; case XFA_ELEMENT_ExclGroup: { - pWidgetData->SetSelectedMemberByValue(wsNormailizeValue.AsWideStringC(), + pWidgetData->SetSelectedMemberByValue(wsNormailizeValue.AsStringC(), bNotify, FALSE, FALSE); } break; case XFA_ELEMENT_DateTimeEdit: diff --git a/xfa/fxfa/parser/xfa_document_serialize.cpp b/xfa/fxfa/parser/xfa_document_serialize.cpp index f08215aa4c..feaebdd7b7 100644 --- a/xfa/fxfa/parser/xfa_document_serialize.cpp +++ b/xfa/fxfa/parser/xfa_document_serialize.cpp @@ -297,7 +297,7 @@ static void XFA_DataExporter_RegenerateFormFile_Changed( buf << FX_WSTRC(L" xmlns=\"\"\n>"); for (int32_t i = 0; i < wsSelTextArray.GetSize(); i++) { buf << FX_WSTRC(L"<value\n>"); - buf << XFA_ExportEncodeContent(wsSelTextArray[i].AsWideStringC()); + buf << XFA_ExportEncodeContent(wsSelTextArray[i].AsStringC()); buf << FX_WSTRC(L"</value\n>"); } buf << FX_WSTRC(L"</"); diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp index d680128dde..6553dc07cc 100644 --- a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp +++ b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp @@ -1389,7 +1389,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) { wsWidth = widths[i]; wsWidth.TrimLeft(L' '); if (!wsWidth.IsEmpty()) { - CXFA_Measurement measure(wsWidth.AsWideStringC()); + CXFA_Measurement measure(wsWidth.AsStringC()); m_rgSpecifiedColumnWidths.Add(measure.ToUnit(XFA_UNIT_Pt)); } } diff --git a/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp b/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp index b12f4ce55d..78492c2702 100644 --- a/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp +++ b/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp @@ -297,7 +297,7 @@ static CXFA_Node* XFA_ResolveBreakTarget(CXFA_Node* pPageSetRoot, if (wsTargetExpr.GetAt(0) == '#') { CXFA_Node* pNode = pDocument->GetNodeByID( ToNode(pDocument->GetXFAObject(XFA_HASHCODE_Template)), - wsTargetExpr.Mid(1).AsWideStringC()); + wsTargetExpr.Mid(1).AsStringC()); if (pNode) { return pNode; } @@ -309,7 +309,7 @@ static CXFA_Node* XFA_ResolveBreakTarget(CXFA_Node* pPageSetRoot, } XFA_RESOLVENODE_RS rs; int32_t iCount = pDocument->GetScriptContext()->ResolveObjects( - pPageSetRoot, wsProcessedTarget.AsWideStringC(), rs, + pPageSetRoot, wsProcessedTarget.AsStringC(), rs, XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Attributes | XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent); diff --git a/xfa/fxfa/parser/xfa_locale.cpp b/xfa/fxfa/parser/xfa_locale.cpp index c77dc2637d..b974939f41 100644 --- a/xfa/fxfa/parser/xfa_locale.cpp +++ b/xfa/fxfa/parser/xfa_locale.cpp @@ -72,14 +72,13 @@ void CXFA_XMLLocale::GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, default: return; } - CXML_Element* pElement = - m_pLocaleData->GetElement("", bsSymbols.AsByteStringC()); + CXML_Element* pElement = m_pLocaleData->GetElement("", bsSymbols.AsStringC()); if (!pElement) { return; } GetPattern(pElement, CFX_ByteStringC((const FX_CHAR*)bsSymbols, bsSymbols.GetLength() - 1), - wsName.AsWideStringC(), wsNumSymbol); + wsName.AsStringC(), wsNumSymbol); } void CXFA_XMLLocale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const { if (!m_pLocaleData) { @@ -87,7 +86,7 @@ void CXFA_XMLLocale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const { } CFX_ByteString bsSpace; CXML_Element* pNumberSymbols = - m_pLocaleData->GetElement(bsSpace.AsByteStringC(), "dateTimeSymbols"); + m_pLocaleData->GetElement(bsSpace.AsStringC(), "dateTimeSymbols"); if (!pNumberSymbols) { return; } @@ -122,11 +121,10 @@ CFX_WideString CXFA_XMLLocale::GetCalendarSymbol(const CFX_ByteStringC& symbol, CXML_Element* pChild = m_pLocaleData->GetElement("", "calendarSymbols"); if (pChild) { CXML_Element* pSymbolNames = - pChild->GetElement("", pstrSymbolNames.AsByteStringC()); + pChild->GetElement("", pstrSymbolNames.AsStringC()); if (pSymbolNames) { if (pSymbolNames->GetAttrInteger("abbr") != bAbbr) { - pSymbolNames = - pChild->GetElement("", pstrSymbolNames.AsByteStringC(), 1); + pSymbolNames = pChild->GetElement("", pstrSymbolNames.AsStringC(), 1); } if (pSymbolNames && pSymbolNames->GetAttrInteger("abbr") == bAbbr) { CXML_Element* pSymbolName = @@ -162,7 +160,7 @@ void CXFA_XMLLocale::GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType, wsName = L"long"; break; } - GetPattern(pElement, "datePattern", wsName.AsWideStringC(), wsPattern); + GetPattern(pElement, "datePattern", wsName.AsStringC(), wsPattern); } void CXFA_XMLLocale::GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY eType, CFX_WideString& wsPattern) const { @@ -186,7 +184,7 @@ void CXFA_XMLLocale::GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY eType, wsName = L"long"; break; } - GetPattern(pElement, "timePattern", wsName.AsWideStringC(), wsPattern); + GetPattern(pElement, "timePattern", wsName.AsStringC(), wsPattern); } void CXFA_XMLLocale::GetNumPattern(FX_LOCALENUMSUBCATEGORY eType, CFX_WideString& wsPattern) const { diff --git a/xfa/fxfa/parser/xfa_localemgr.cpp b/xfa/fxfa/parser/xfa_localemgr.cpp index 828fcd8caa..f2b3f1f000 100644 --- a/xfa/fxfa/parser/xfa_localemgr.cpp +++ b/xfa/fxfa/parser/xfa_localemgr.cpp @@ -1132,7 +1132,7 @@ CXFA_LocaleMgr::CXFA_LocaleMgr(CXFA_Node* pLocaleSet, CFX_WideString wsDeflcid) pNodeLocale = pNodeLocale->GetNodeItem(XFA_NODEITEM_NextSibling); } } - m_pDefLocale = GetLocaleByName(wsDeflcid.AsWideStringC()); + m_pDefLocale = GetLocaleByName(wsDeflcid.AsStringC()); } CXFA_LocaleMgr::~CXFA_LocaleMgr() { int32_t iCount = m_LocaleArray.GetSize(); @@ -1266,7 +1266,7 @@ CFX_WideStringC CXFA_LocaleMgr::GetConfigLocaleName(CXFA_Node* pConfig) { } m_dwLocaleFlags |= 0x01; } - return m_wsConfigLocale.AsWideStringC(); + return m_wsConfigLocale.AsStringC(); } static CXFA_TimeZoneProvider* g_pProvider = NULL; diff --git a/xfa/fxfa/parser/xfa_localevalue.cpp b/xfa/fxfa/parser/xfa_localevalue.cpp index 99738c60ae..9bca7b71b9 100644 --- a/xfa/fxfa/parser/xfa_localevalue.cpp +++ b/xfa/fxfa/parser/xfa_localevalue.cpp @@ -369,7 +369,7 @@ CFX_Unitime CXFA_LocaleValue::GetTime() const { if (m_bValid && m_dwType == XFA_VT_TIME) { CFX_Unitime dt(0); FXSYS_assert(m_pLocaleMgr); - FX_TimeFromCanonical(m_wsValue.AsWideStringC(), dt, + FX_TimeFromCanonical(m_wsValue.AsStringC(), dt, m_pLocaleMgr->GetDefLocale()); return dt; } @@ -382,7 +382,7 @@ CFX_Unitime CXFA_LocaleValue::GetDateTime() const { FX_DateFromCanonical(m_wsValue.Left(index), dt); FXSYS_assert(m_pLocaleMgr); FX_TimeFromCanonical( - m_wsValue.Right(m_wsValue.GetLength() - index - 1).AsWideStringC(), dt, + m_wsValue.Right(m_wsValue.GetLength() - index - 1).AsStringC(), dt, m_pLocaleMgr->GetDefLocale()); return dt; } diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp index c0db8111d4..8b8db882ea 100644 --- a/xfa/fxfa/parser/xfa_object_imp.cpp +++ b/xfa/fxfa/parser/xfa_object_imp.cpp @@ -57,8 +57,8 @@ void CXFA_Object::Script_ObjectClass_ClassName(FXJSE_HVALUE hValue, CFX_WideStringC className; GetClassName(className); FXJSE_Value_SetUTF8String( - hValue, FX_UTF8Encode(className.c_str(), className.GetLength()) - .AsByteStringC()); + hValue, + FX_UTF8Encode(className.c_str(), className.GetLength()).AsStringC()); } else { ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); } @@ -74,7 +74,7 @@ void CXFA_Object::ThrowScriptErrorMessage(int32_t iStringID, ...) { wsMessage.FormatV((const FX_WCHAR*)wsFormat, arg_ptr); va_end(arg_ptr); FXJSE_ThrowMessage( - "", FX_UTF8Encode(wsMessage, wsMessage.GetLength()).AsByteStringC()); + "", FX_UTF8Encode(wsMessage, wsMessage.GetLength()).AsStringC()); } static void XFA_DeleteWideString(void* pData) { @@ -634,7 +634,7 @@ void CXFA_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) { return; } CFX_WideString wsExpression = - CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsByteStringC()); + CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsStringC()); CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { return; @@ -648,7 +648,7 @@ void CXFA_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) { XFA_RESOLVENODE_Siblings; XFA_RESOLVENODE_RS resoveNodeRS; int32_t iRet = pScriptContext->ResolveObjects( - refNode, wsExpression.AsWideStringC(), resoveNodeRS, dwFlag); + refNode, wsExpression.AsStringC(), resoveNodeRS, dwFlag); if (iRet < 1) { return FXJSE_Value_SetNull(pArguments->GetReturnValue()); } @@ -679,7 +679,7 @@ void CXFA_Node::Script_TreeClass_ResolveNodes(CFXJSE_Arguments* pArguments) { return; } CFX_WideString wsExpression = - CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsByteStringC()); + CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsStringC()); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (!hValue) { return; @@ -705,7 +705,7 @@ void CXFA_Node::Script_Som_ResolveNodeList(FXJSE_HVALUE hValue, if (refNode == NULL) { refNode = this; } - pScriptContext->ResolveObjects(refNode, wsExpression.AsWideStringC(), + pScriptContext->ResolveObjects(refNode, wsExpression.AsStringC(), resoveNodeRS, dwFlag); CXFA_ArrayNodeList* pNodeList = new CXFA_ArrayNodeList(m_pDocument); if (resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) { @@ -753,7 +753,7 @@ 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()).AsByteStringC()); + "", FX_UTF8Encode(wsMessage, wsMessage.GetLength()).AsStringC()); } else { CXFA_AttachNodeList* pNodeList = new CXFA_AttachNodeList(m_pDocument, this); FXJSE_Value_SetObject(hValue, (CXFA_Object*)pNodeList, @@ -815,7 +815,7 @@ void CXFA_Node::Script_TreeClass_SomExpression(FXJSE_HVALUE hValue, CFX_WideString wsSOMExpression; GetSOMExpression(wsSOMExpression); FXJSE_Value_SetUTF8String(hValue, - FX_UTF8Encode(wsSOMExpression).AsByteStringC()); + FX_UTF8Encode(wsSOMExpression).AsStringC()); } } void CXFA_Node::Script_NodeClass_ApplyXSL(CFXJSE_Arguments* pArguments) { @@ -825,7 +825,7 @@ void CXFA_Node::Script_NodeClass_ApplyXSL(CFXJSE_Arguments* pArguments) { return; } CFX_WideString wsExpression = - CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsByteStringC()); + CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsStringC()); // TODO(tsepez): actually do something here? } void CXFA_Node::Script_NodeClass_AssignNode(CFXJSE_Arguments* pArguments) { @@ -839,11 +839,11 @@ void CXFA_Node::Script_NodeClass_AssignNode(CFXJSE_Arguments* pArguments) { int32_t iAction = 0; if (iLength >= 1) { CFX_ByteString bsExpression = pArguments->GetUTF8String(0); - wsExpression = CFX_WideString::FromUTF8(bsExpression.AsByteStringC()); + wsExpression = CFX_WideString::FromUTF8(bsExpression.AsStringC()); } if (iLength >= 2) { CFX_ByteString bsValue = pArguments->GetUTF8String(1); - wsValue = CFX_WideString::FromUTF8(bsValue.AsByteStringC()); + wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC()); } if (iLength >= 3) { iAction = pArguments->GetInt32(2); @@ -870,12 +870,12 @@ void CXFA_Node::Script_NodeClass_GetAttribute(CFXJSE_Arguments* pArguments) { return; } CFX_WideString wsExpression = - CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsByteStringC()); + CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsStringC()); CFX_WideString wsValue; - GetAttribute(wsExpression.AsWideStringC(), wsValue); + GetAttribute(wsExpression.AsStringC(), wsValue); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsStringC()); } } void CXFA_Node::Script_NodeClass_GetElement(CFXJSE_Arguments* pArguments) { @@ -888,13 +888,13 @@ void CXFA_Node::Script_NodeClass_GetElement(CFXJSE_Arguments* pArguments) { int32_t iValue = 0; if (iLength >= 1) { CFX_ByteString bsExpression = pArguments->GetUTF8String(0); - wsExpression = CFX_WideString::FromUTF8(bsExpression.AsByteStringC()); + wsExpression = CFX_WideString::FromUTF8(bsExpression.AsStringC()); } if (iLength >= 2) { iValue = pArguments->GetInt32(1); } const XFA_ELEMENTINFO* pElementInfo = - XFA_GetElementByName(wsExpression.AsWideStringC()); + XFA_GetElementByName(wsExpression.AsStringC()); CXFA_Node* pNode = GetProperty(iValue, pElementInfo->eName); FXJSE_Value_Set(pArguments->GetReturnValue(), m_pDocument->GetScriptContext()->GetJSValueFromMap(pNode)); @@ -912,7 +912,7 @@ void CXFA_Node::Script_NodeClass_IsPropertySpecified( int32_t iIndex = 0; if (iLength >= 1) { CFX_ByteString bsExpression = pArguments->GetUTF8String(0); - wsExpression = CFX_WideString::FromUTF8(bsExpression.AsByteStringC()); + wsExpression = CFX_WideString::FromUTF8(bsExpression.AsStringC()); } if (iLength >= 2) { bParent = pArguments->GetInt32(1) == 0 ? FALSE : TRUE; @@ -922,14 +922,14 @@ void CXFA_Node::Script_NodeClass_IsPropertySpecified( } FX_BOOL bHas = FALSE; const XFA_ATTRIBUTEINFO* pAttributeInfo = - XFA_GetAttributeByName(wsExpression.AsWideStringC()); + XFA_GetAttributeByName(wsExpression.AsStringC()); CFX_WideString wsValue; if (pAttributeInfo) { bHas = HasAttribute(pAttributeInfo->eName); } if (!bHas) { const XFA_ELEMENTINFO* pElementInfo = - XFA_GetElementByName(wsExpression.AsWideStringC()); + XFA_GetElementByName(wsExpression.AsStringC()); bHas = (GetProperty(iIndex, pElementInfo->eName) != NULL); } FXJSE_HVALUE hValue = pArguments->GetReturnValue(); @@ -948,7 +948,7 @@ void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) { FX_BOOL bOverwrite = 0; if (iLength >= 1) { CFX_ByteString bsExpression = pArguments->GetUTF8String(0); - wsExpression = CFX_WideString::FromUTF8(bsExpression.AsByteStringC()); + wsExpression = CFX_WideString::FromUTF8(bsExpression.AsStringC()); if (wsExpression.IsEmpty()) { return; } @@ -1145,11 +1145,10 @@ void CXFA_Node::Script_NodeClass_SetAttribute(CFXJSE_Arguments* pArguments) { return; } CFX_WideString wsAttributeValue = - CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsByteStringC()); + CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsStringC()); CFX_WideString wsAttribute = - CFX_WideString::FromUTF8(pArguments->GetUTF8String(1).AsByteStringC()); - SetAttribute(wsAttribute.AsWideStringC(), wsAttributeValue.AsWideStringC(), - TRUE); + CFX_WideString::FromUTF8(pArguments->GetUTF8String(1).AsStringC()); + SetAttribute(wsAttribute.AsStringC(), wsAttributeValue.AsStringC(), TRUE); } void CXFA_Node::Script_NodeClass_SetElement(CFXJSE_Arguments* pArguments) { int32_t iLength = pArguments->GetLength(); @@ -1164,7 +1163,7 @@ void CXFA_Node::Script_NodeClass_SetElement(CFXJSE_Arguments* pArguments) { } if (iLength >= 2) { CFX_ByteString bsName = pArguments->GetUTF8String(1); - wsName = CFX_WideString::FromUTF8(bsName.AsByteStringC()); + wsName = CFX_WideString::FromUTF8(bsName.AsStringC()); } } void CXFA_Node::Script_NodeClass_Ns(FXJSE_HVALUE hValue, @@ -1175,8 +1174,7 @@ void CXFA_Node::Script_NodeClass_Ns(FXJSE_HVALUE hValue, } else { CFX_WideString wsNameSpace; TryNamespace(wsNameSpace); - FXJSE_Value_SetUTF8String(hValue, - FX_UTF8Encode(wsNameSpace).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsNameSpace).AsStringC()); } } void CXFA_Node::Script_NodeClass_Model(FXJSE_HVALUE hValue, @@ -1248,7 +1246,7 @@ void CXFA_Node::Script_ModelClass_IsCompatibleNS(CFXJSE_Arguments* pArguments) { CFX_WideString wsNameSpace; if (iLength >= 1) { CFX_ByteString bsNameSpace = pArguments->GetUTF8String(0); - wsNameSpace = CFX_WideString::FromUTF8(bsNameSpace.AsByteStringC()); + wsNameSpace = CFX_WideString::FromUTF8(bsNameSpace.AsStringC()); } CFX_WideString wsNodeNameSpace; TryNamespace(wsNodeNameSpace); @@ -1471,8 +1469,8 @@ void CXFA_Node::Script_Attribute_String(FXJSE_HVALUE hValue, if (bSetting) { CFX_ByteString szValue; FXJSE_Value_ToUTF8String(hValue, szValue); - CFX_WideString wsValue = CFX_WideString::FromUTF8(szValue.AsByteStringC()); - SetAttribute(eAttribute, wsValue.AsWideStringC(), TRUE); + CFX_WideString wsValue = CFX_WideString::FromUTF8(szValue.AsStringC()); + SetAttribute(eAttribute, wsValue.AsStringC(), TRUE); if (eAttribute == XFA_ATTRIBUTE_Use && GetClassID() == XFA_ELEMENT_Desc) { CFX_WideString wsUseVal = wsValue, wsID, wsSOM; CXFA_Node* pTemplateNode = @@ -1497,12 +1495,12 @@ void CXFA_Node::Script_Attribute_String(FXJSE_HVALUE hValue, XFA_RESOLVENODE_Siblings; XFA_RESOLVENODE_RS resoveNodeRS; int32_t iRet = m_pDocument->GetScriptContext()->ResolveObjects( - pProtoRoot, wsSOM.AsWideStringC(), resoveNodeRS, dwFlag); + pProtoRoot, wsSOM.AsStringC(), resoveNodeRS, dwFlag); if (iRet > 0 && resoveNodeRS.nodes[0]->IsNode()) { pProtoNode = resoveNodeRS.nodes[0]->AsNode(); } } else if (!wsID.IsEmpty()) { - pProtoNode = m_pDocument->GetNodeByID(pProtoRoot, wsID.AsWideStringC()); + pProtoNode = m_pDocument->GetNodeByID(pProtoRoot, wsID.AsStringC()); } if (pProtoNode) { CXFA_Node* pHeadChild = GetNodeItem(XFA_NODEITEM_FirstChild); @@ -1529,7 +1527,7 @@ void CXFA_Node::Script_Attribute_String(FXJSE_HVALUE hValue, CFX_WideString wsValue; GetAttribute(eAttribute, wsValue); FXJSE_Value_SetUTF8String( - hValue, FX_UTF8Encode(wsValue, wsValue.GetLength()).AsByteStringC()); + hValue, FX_UTF8Encode(wsValue, wsValue.GetLength()).AsStringC()); } } void CXFA_Node::Script_Attribute_StringRead(FXJSE_HVALUE hValue, @@ -1539,7 +1537,7 @@ void CXFA_Node::Script_Attribute_StringRead(FXJSE_HVALUE hValue, CFX_WideString wsValue; GetAttribute(eAttribute, wsValue); FXJSE_Value_SetUTF8String( - hValue, FX_UTF8Encode(wsValue, wsValue.GetLength()).AsByteStringC()); + hValue, FX_UTF8Encode(wsValue, wsValue.GetLength()).AsStringC()); } else { ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); } @@ -1587,15 +1585,15 @@ void CXFA_Node::Script_Som_Message(FXJSE_HVALUE hValue, switch (iMessageType) { case XFA_SOM_ValidationMessage: validate.SetScriptMessageText( - CFX_WideString::FromUTF8(bsMessage.AsByteStringC())); + CFX_WideString::FromUTF8(bsMessage.AsStringC())); break; case XFA_SOM_FormatMessage: validate.SetFormatMessageText( - CFX_WideString::FromUTF8(bsMessage.AsByteStringC())); + CFX_WideString::FromUTF8(bsMessage.AsStringC())); break; case XFA_SOM_MandatoryMessage: validate.SetNullMessageText( - CFX_WideString::FromUTF8(bsMessage.AsByteStringC())); + CFX_WideString::FromUTF8(bsMessage.AsStringC())); break; default: break; @@ -1622,7 +1620,7 @@ void CXFA_Node::Script_Som_Message(FXJSE_HVALUE hValue, default: break; } - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsMessage).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsMessage).AsStringC()); } } void CXFA_Node::Script_Som_ValidationMessage(FXJSE_HVALUE hValue, @@ -1663,8 +1661,7 @@ void CXFA_Node::Script_Som_DefaultValue(FXJSE_HVALUE hValue, if (!(FXJSE_Value_IsNull(hValue) || FXJSE_Value_IsUndefined(hValue))) { FXJSE_Value_ToUTF8String(hValue, newValue); } - CFX_WideString wsNewValue = - CFX_WideString::FromUTF8(newValue.AsByteStringC()); + CFX_WideString wsNewValue = CFX_WideString::FromUTF8(newValue.AsStringC()); CFX_WideString wsFormatValue(wsNewValue); CXFA_WidgetData* pContainerWidgetData = NULL; if (GetPacketID() == XFA_XDPPACKET_Datasets) { @@ -1690,7 +1687,7 @@ void CXFA_Node::Script_Som_DefaultValue(FXJSE_HVALUE hValue, pContainerWidgetData = GetContainerWidgetData(); } if (pContainerWidgetData) { - pContainerWidgetData->GetFormatDataValue(wsNewValue.AsWideStringC(), + pContainerWidgetData->GetFormatDataValue(wsNewValue.AsStringC(), wsFormatValue); } SetScriptContent(wsNewValue, wsFormatValue, TRUE, TRUE); @@ -1702,11 +1699,11 @@ void CXFA_Node::Script_Som_DefaultValue(FXJSE_HVALUE hValue, } else if (classID == XFA_ELEMENT_Integer) { FXJSE_Value_SetInteger(hValue, FXSYS_wtoi(content)); } else if (classID == XFA_ELEMENT_Float || classID == XFA_ELEMENT_Decimal) { - CFX_Decimal decimal(content.AsWideStringC()); + CFX_Decimal decimal(content.AsStringC()); FXJSE_Value_SetFloat(hValue, (FX_FLOAT)(double)decimal); } else { FXJSE_Value_SetUTF8String( - hValue, FX_UTF8Encode(content, content.GetLength()).AsByteStringC()); + hValue, FX_UTF8Encode(content, content.GetLength()).AsStringC()); } } } @@ -1722,7 +1719,7 @@ void CXFA_Node::Script_Som_DefaultValue_Read(FXJSE_HVALUE hValue, FXJSE_Value_SetNull(hValue); } else { FXJSE_Value_SetUTF8String( - hValue, FX_UTF8Encode(content, content.GetLength()).AsByteStringC()); + hValue, FX_UTF8Encode(content, content.GetLength()).AsStringC()); } } void CXFA_Node::Script_Boolean_Value(FXJSE_HVALUE hValue, @@ -1738,7 +1735,7 @@ void CXFA_Node::Script_Boolean_Value(FXJSE_HVALUE hValue, CFX_WideString wsFormatValue(wsNewValue); CXFA_WidgetData* pContainerWidgetData = GetContainerWidgetData(); if (pContainerWidgetData) { - pContainerWidgetData->GetFormatDataValue(wsNewValue.AsWideStringC(), + pContainerWidgetData->GetFormatDataValue(wsNewValue.AsStringC(), wsFormatValue); } SetScriptContent(wsNewValue, wsFormatValue, TRUE, TRUE); @@ -1849,7 +1846,7 @@ void CXFA_Node::Script_Som_BorderColor(FXJSE_HVALUE hValue, if (bSetting) { CFX_ByteString bsValue; FXJSE_Value_ToUTF8String(hValue, bsValue); - strColor = CFX_WideString::FromUTF8(bsValue.AsByteStringC()); + strColor = CFX_WideString::FromUTF8(bsValue.AsStringC()); int32_t r = 0, g = 0, b = 0; XFA_STRING_TO_RGB(strColor, r, g, b); FX_ARGB rgb = ArgbEncode(100, r, g, b); @@ -1863,7 +1860,7 @@ void CXFA_Node::Script_Som_BorderColor(FXJSE_HVALUE hValue, int32_t a, r, g, b; ArgbDecode(color, a, r, g, b); strColor.Format(L"%d,%d,%d", r, g, b); - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(strColor).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(strColor).AsStringC()); } } void CXFA_Node::Script_Som_BorderWidth(FXJSE_HVALUE hValue, @@ -1879,18 +1876,17 @@ void CXFA_Node::Script_Som_BorderWidth(FXJSE_HVALUE hValue, if (bSetting) { CFX_ByteString bsValue; FXJSE_Value_ToUTF8String(hValue, bsValue); - wsThickness = CFX_WideString::FromUTF8(bsValue.AsByteStringC()); + wsThickness = CFX_WideString::FromUTF8(bsValue.AsStringC()); for (int32_t i = 0; i < iSize; ++i) { CXFA_Edge edge = border.GetEdge(i); - CXFA_Measurement thickness(wsThickness.AsWideStringC()); + CXFA_Measurement thickness(wsThickness.AsStringC()); edge.SetMSThickness(thickness); } } else { CXFA_Edge edge = border.GetEdge(0); CXFA_Measurement thickness = edge.GetMSThickness(); thickness.ToString(wsThickness); - FXJSE_Value_SetUTF8String(hValue, - FX_UTF8Encode(wsThickness).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsThickness).AsStringC()); } } void CXFA_Node::Script_Som_FillColor(FXJSE_HVALUE hValue, @@ -1910,7 +1906,7 @@ void CXFA_Node::Script_Som_FillColor(FXJSE_HVALUE hValue, if (bSetting) { CFX_ByteString bsValue; FXJSE_Value_ToUTF8String(hValue, bsValue); - wsColor = CFX_WideString::FromUTF8(bsValue.AsByteStringC()); + wsColor = CFX_WideString::FromUTF8(bsValue.AsStringC()); int32_t r, g, b; XFA_STRING_TO_RGB(wsColor, r, g, b); FX_ARGB color = ArgbEncode(0xff, r, g, b); @@ -1920,7 +1916,7 @@ void CXFA_Node::Script_Som_FillColor(FXJSE_HVALUE hValue, int32_t a, r, g, b; ArgbDecode(color, a, r, g, b); wsColor.Format(L"%d,%d,%d", r, g, b); - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsColor).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsColor).AsStringC()); } } void CXFA_Node::Script_Som_DataNode(FXJSE_HVALUE hValue, @@ -1951,7 +1947,7 @@ void CXFA_Node::Script_Draw_DefaultValue(FXJSE_HVALUE hValue, CFX_ByteString newValue; FXJSE_Value_ToUTF8String(hValue, newValue); CFX_WideString wsNewValue = - CFX_WideString::FromUTF8(newValue.AsByteStringC()); + CFX_WideString::FromUTF8(newValue.AsStringC()); CFX_WideString wsFormatValue(wsNewValue); SetScriptContent(wsNewValue, wsFormatValue, TRUE, TRUE); } else if (uiType != XFA_ELEMENT_Image) { @@ -1963,7 +1959,7 @@ void CXFA_Node::Script_Draw_DefaultValue(FXJSE_HVALUE hValue, FXJSE_Value_SetNull(hValue); } else { FXJSE_Value_SetUTF8String( - hValue, FX_UTF8Encode(content, content.GetLength()).AsByteStringC()); + hValue, FX_UTF8Encode(content, content.GetLength()).AsStringC()); } } } @@ -1986,8 +1982,7 @@ void CXFA_Node::Script_Field_DefaultValue(FXJSE_HVALUE hValue, if (!(FXJSE_Value_IsNull(hValue) || FXJSE_Value_IsUndefined(hValue))) { FXJSE_Value_ToUTF8String(hValue, newValue); } - CFX_WideString wsNewText = - CFX_WideString::FromUTF8(newValue.AsByteStringC()); + CFX_WideString wsNewText = CFX_WideString::FromUTF8(newValue.AsStringC()); CXFA_Node* pUIChild = pWidgetData->GetUIChild(); if (pUIChild->GetClassID() == XFA_ELEMENT_NumericEdit) { int32_t iLeadDigits = 0; @@ -2000,7 +1995,7 @@ void CXFA_Node::Script_Field_DefaultValue(FXJSE_HVALUE hValue, CXFA_WidgetData* pContainerWidgetData = GetContainerWidgetData(); CFX_WideString wsFormatText(wsNewText); if (pContainerWidgetData) { - pContainerWidgetData->GetFormatDataValue(wsNewText.AsWideStringC(), + pContainerWidgetData->GetFormatDataValue(wsNewText.AsStringC(), wsFormatText); } SetScriptContent(wsNewText, wsFormatText, TRUE, TRUE); @@ -2017,10 +2012,9 @@ 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()).AsByteStringC()); + hValue, FX_UTF8Encode(content, content.GetLength()).AsStringC()); } else { - CFX_Decimal decimal(content.AsWideStringC()); + CFX_Decimal decimal(content.AsStringC()); FXJSE_Value_SetFloat(hValue, (FX_FLOAT)(double)decimal); } } else if (pNode && pNode->GetClassID() == XFA_ELEMENT_Integer) { @@ -2028,12 +2022,11 @@ void CXFA_Node::Script_Field_DefaultValue(FXJSE_HVALUE hValue, } else if (pNode && pNode->GetClassID() == XFA_ELEMENT_Boolean) { FXJSE_Value_SetBoolean(hValue, FXSYS_wtoi(content) == 0 ? FALSE : TRUE); } else if (pNode && pNode->GetClassID() == XFA_ELEMENT_Float) { - CFX_Decimal decimal(content.AsWideStringC()); + CFX_Decimal decimal(content.AsStringC()); FXJSE_Value_SetFloat(hValue, (FX_FLOAT)(double)decimal); } else { FXJSE_Value_SetUTF8String( - hValue, - FX_UTF8Encode(content, content.GetLength()).AsByteStringC()); + hValue, FX_UTF8Encode(content, content.GetLength()).AsStringC()); } } } @@ -2049,11 +2042,11 @@ void CXFA_Node::Script_Field_EditValue(FXJSE_HVALUE hValue, if (bSetting) { CFX_ByteString bsValue; FXJSE_Value_ToUTF8String(hValue, bsValue); - wsValue = CFX_WideString::FromUTF8(bsValue.AsByteStringC()); + wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC()); pWidgetData->SetValue(wsValue, XFA_VALUEPICTURE_Edit); } else { pWidgetData->GetValue(wsValue, XFA_VALUEPICTURE_Edit); - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsStringC()); } } void CXFA_Node::Script_Som_FontColor(FXJSE_HVALUE hValue, @@ -2072,7 +2065,7 @@ void CXFA_Node::Script_Som_FontColor(FXJSE_HVALUE hValue, if (bSetting) { CFX_ByteString bsValue; FXJSE_Value_ToUTF8String(hValue, bsValue); - wsColor = CFX_WideString::FromUTF8(bsValue.AsByteStringC()); + wsColor = CFX_WideString::FromUTF8(bsValue.AsStringC()); int32_t r, g, b; XFA_STRING_TO_RGB(wsColor, r, g, b); FX_ARGB color = ArgbEncode(0xff, r, g, b); @@ -2082,7 +2075,7 @@ void CXFA_Node::Script_Som_FontColor(FXJSE_HVALUE hValue, int32_t a, r, g, b; ArgbDecode(color, a, r, g, b); wsColor.Format(L"%d,%d,%d", r, g, b); - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsColor).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsColor).AsStringC()); } } void CXFA_Node::Script_Field_FormatMessage(FXJSE_HVALUE hValue, @@ -2101,11 +2094,11 @@ void CXFA_Node::Script_Field_FormattedValue(FXJSE_HVALUE hValue, if (bSetting) { CFX_ByteString bsValue; FXJSE_Value_ToUTF8String(hValue, bsValue); - wsValue = CFX_WideString::FromUTF8(bsValue.AsByteStringC()); + wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC()); pWidgetData->SetValue(wsValue, XFA_VALUEPICTURE_Display); } else { pWidgetData->GetValue(wsValue, XFA_VALUEPICTURE_Display); - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsStringC()); } } void CXFA_Node::Script_Som_Mandatory(FXJSE_HVALUE hValue, @@ -2120,7 +2113,7 @@ void CXFA_Node::Script_Som_Mandatory(FXJSE_HVALUE hValue, if (bSetting) { CFX_ByteString bsValue; FXJSE_Value_ToUTF8String(hValue, bsValue); - wsValue = CFX_WideString::FromUTF8(bsValue.AsByteStringC()); + wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC()); validate.SetNullTest(wsValue); } else { int32_t iValue = validate.GetNullTest(); @@ -2129,7 +2122,7 @@ void CXFA_Node::Script_Som_Mandatory(FXJSE_HVALUE hValue, if (pInfo) { wsValue = pInfo->pName; } - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsStringC()); } } void CXFA_Node::Script_Som_MandatoryMessage(FXJSE_HVALUE hValue, @@ -2176,7 +2169,7 @@ void CXFA_Node::Script_Field_ExecEvent(CFXJSE_Arguments* pArguments) { if (argc == 1) { CFX_ByteString eventString = pArguments->GetUTF8String(0); int32_t iRet = execSingleEventByName( - CFX_WideString::FromUTF8(eventString.AsByteStringC()).AsWideStringC(), + CFX_WideString::FromUTF8(eventString.AsStringC()).AsStringC(), XFA_ELEMENT_Field); if (eventString == "validate") { FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), @@ -2237,7 +2230,7 @@ void CXFA_Node::Script_Field_GetSaveItem(CFXJSE_Arguments* pArguments) { if (bHasItem) { FXJSE_Value_SetUTF8String( pArguments->GetReturnValue(), - FX_UTF8Encode(wsValue, wsValue.GetLength()).AsByteStringC()); + FX_UTF8Encode(wsValue, wsValue.GetLength()).AsStringC()); } else { FXJSE_Value_SetNull(pArguments->GetReturnValue()); } @@ -2253,13 +2246,12 @@ void CXFA_Node::Script_Field_BoundItem(CFXJSE_Arguments* pArguments) { return; } CFX_ByteString bsValue = pArguments->GetUTF8String(0); - CFX_WideString wsValue = CFX_WideString::FromUTF8(bsValue.AsByteStringC()); + CFX_WideString wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC()); CFX_WideString wsBoundValue; - pWidgetData->GetItemValue(wsValue.AsWideStringC(), wsBoundValue); + pWidgetData->GetItemValue(wsValue.AsStringC(), wsBoundValue); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { - FXJSE_Value_SetUTF8String(hValue, - FX_UTF8Encode(wsBoundValue).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsBoundValue).AsStringC()); } } void CXFA_Node::Script_Field_GetItemState(CFXJSE_Arguments* pArguments) { @@ -2316,7 +2308,7 @@ void CXFA_Node::Script_Field_GetDisplayItem(CFXJSE_Arguments* pArguments) { if (bHasItem) { FXJSE_Value_SetUTF8String( pArguments->GetReturnValue(), - FX_UTF8Encode(wsValue, wsValue.GetLength()).AsByteStringC()); + FX_UTF8Encode(wsValue, wsValue.GetLength()).AsStringC()); } else { FXJSE_Value_SetNull(pArguments->GetReturnValue()); } @@ -2355,11 +2347,11 @@ void CXFA_Node::Script_Field_AddItem(CFXJSE_Arguments* pArguments) { CFX_WideString wsValue; if (iLength >= 1) { CFX_ByteString bsLabel = pArguments->GetUTF8String(0); - wsLabel = CFX_WideString::FromUTF8(bsLabel.AsByteStringC()); + wsLabel = CFX_WideString::FromUTF8(bsLabel.AsStringC()); } if (iLength >= 2) { CFX_ByteString bsValue = pArguments->GetUTF8String(1); - wsValue = CFX_WideString::FromUTF8(bsValue.AsByteStringC()); + wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC()); } pWidgetData->InsertItem(wsLabel, wsValue, -1, TRUE); } @@ -2399,15 +2391,14 @@ void CXFA_Node::Script_ExclGroup_DefaultAndRawValue(FXJSE_HVALUE hValue, CFX_ByteString bsValue; FXJSE_Value_ToUTF8String(hValue, bsValue); pWidgetData->SetSelectedMemberByValue( - CFX_WideString::FromUTF8(bsValue.AsByteStringC()).AsWideStringC(), TRUE, - TRUE); + CFX_WideString::FromUTF8(bsValue.AsStringC()).AsStringC(), TRUE, TRUE); } else { CFX_WideString wsValue = GetScriptContent(TRUE); XFA_VERSION curVersion = GetDocument()->GetCurVersionMode(); if (wsValue.IsEmpty() && curVersion >= XFA_VERSION_300) { FXJSE_Value_SetNull(hValue); } else { - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsStringC()); } } } @@ -2419,7 +2410,7 @@ void CXFA_Node::Script_ExclGroup_ExecEvent(CFXJSE_Arguments* pArguments) { if (argc == 1) { CFX_ByteString eventString = pArguments->GetUTF8String(0); execSingleEventByName( - CFX_WideString::FromUTF8(eventString.AsByteStringC()).AsWideStringC(), + CFX_WideString::FromUTF8(eventString.AsStringC()).AsStringC(), XFA_ELEMENT_ExclGroup); } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execEvent"); @@ -2439,7 +2430,7 @@ void CXFA_Node::Script_ExclGroup_SelectedMember(CFXJSE_Arguments* pArguments) { CFX_ByteString szName; szName = pArguments->GetUTF8String(0); pReturnNode = pWidgetData->SetSelectedMember( - CFX_WideString::FromUTF8(szName.AsByteStringC()).AsWideStringC()); + CFX_WideString::FromUTF8(szName.AsStringC()).AsStringC()); } if (pReturnNode) { FXJSE_Value_Set( @@ -2600,14 +2591,13 @@ void CXFA_Node::Script_Subform_Locale(FXJSE_HVALUE hValue, CFX_ByteString bsLocaleName; FXJSE_Value_ToUTF8String(hValue, bsLocaleName); SetCData(XFA_ATTRIBUTE_Locale, - CFX_WideString::FromUTF8(bsLocaleName.AsByteStringC()), TRUE, - TRUE); + CFX_WideString::FromUTF8(bsLocaleName.AsStringC()), TRUE, TRUE); } else { CFX_WideString wsLocaleName; GetLocaleName(wsLocaleName); FXJSE_Value_SetUTF8String( hValue, - FX_UTF8Encode(wsLocaleName, wsLocaleName.GetLength()).AsByteStringC()); + FX_UTF8Encode(wsLocaleName, wsLocaleName.GetLength()).AsStringC()); } } void CXFA_Node::Script_Subform_ExecEvent(CFXJSE_Arguments* pArguments) { @@ -2615,7 +2605,7 @@ void CXFA_Node::Script_Subform_ExecEvent(CFXJSE_Arguments* pArguments) { if (argc == 1) { CFX_ByteString eventString = pArguments->GetUTF8String(0); execSingleEventByName( - CFX_WideString::FromUTF8(eventString.AsByteStringC()).AsWideStringC(), + CFX_WideString::FromUTF8(eventString.AsStringC()).AsStringC(), XFA_ELEMENT_Subform); } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execEvent"); @@ -2721,17 +2711,17 @@ void CXFA_Node::Script_Template_CreateNode(CFXJSE_Arguments* pArguments) { CFX_WideString strName; CFX_WideString strNameSpace; CFX_ByteString bsTagName = pArguments->GetUTF8String(0); - strTagName = CFX_WideString::FromUTF8(bsTagName.AsByteStringC()); + strTagName = CFX_WideString::FromUTF8(bsTagName.AsStringC()); if (argc > 1) { CFX_ByteString bsName = pArguments->GetUTF8String(1); - strName = CFX_WideString::FromUTF8(bsName.AsByteStringC()); + strName = CFX_WideString::FromUTF8(bsName.AsStringC()); if (argc == 3) { CFX_ByteString bsNameSpace = pArguments->GetUTF8String(2); - strNameSpace = CFX_WideString::FromUTF8(bsNameSpace.AsByteStringC()); + strNameSpace = CFX_WideString::FromUTF8(bsNameSpace.AsStringC()); } } const XFA_ELEMENTINFO* pElement = - XFA_GetElementByName(strTagName.AsWideStringC()); + XFA_GetElementByName(strTagName.AsStringC()); CXFA_Node* pNewNode = CreateSamePacketNode(pElement->eName); if (!pNewNode) { FXJSE_Value_SetNull(pArguments->GetReturnValue()); @@ -2739,8 +2729,7 @@ void CXFA_Node::Script_Template_CreateNode(CFXJSE_Arguments* pArguments) { if (!strName.IsEmpty()) { if (XFA_GetAttributeOfElement(pElement->eName, XFA_ATTRIBUTE_Name, XFA_XDPPACKET_UNKNOWN)) { - pNewNode->SetAttribute(XFA_ATTRIBUTE_Name, strName.AsWideStringC(), - TRUE); + pNewNode->SetAttribute(XFA_ATTRIBUTE_Name, strName.AsStringC(), TRUE); if (pNewNode->GetPacketID() == XFA_XDPPACKET_Datasets) { pNewNode->CreateXMLMappingNode(); } @@ -3497,15 +3486,13 @@ void CXFA_Node::Script_Form_Checksum(FXJSE_HVALUE hValue, if (bSetting) { CFX_ByteString bsChecksum; FXJSE_Value_ToUTF8String(hValue, bsChecksum); - SetAttribute( - XFA_ATTRIBUTE_Checksum, - CFX_WideString::FromUTF8(bsChecksum.AsByteStringC()).AsWideStringC()); + SetAttribute(XFA_ATTRIBUTE_Checksum, + CFX_WideString::FromUTF8(bsChecksum.AsStringC()).AsStringC()); } else { CFX_WideString wsChecksum; GetAttribute(XFA_ATTRIBUTE_Checksum, wsChecksum, FALSE); FXJSE_Value_SetUTF8String( - hValue, - FX_UTF8Encode(wsChecksum, wsChecksum.GetLength()).AsByteStringC()); + hValue, FX_UTF8Encode(wsChecksum, wsChecksum.GetLength()).AsStringC()); } } void CXFA_Node::Script_Packet_GetAttribute(CFXJSE_Arguments* pArguments) { @@ -3516,13 +3503,13 @@ void CXFA_Node::Script_Packet_GetAttribute(CFXJSE_Arguments* pArguments) { CFDE_XMLNode* pXMLNode = GetXMLMappingNode(); if (pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element) { static_cast<CFDE_XMLElement*>(pXMLNode) - ->GetString(CFX_WideString::FromUTF8(bsAttributeName.AsByteStringC()), + ->GetString(CFX_WideString::FromUTF8(bsAttributeName.AsStringC()), wsAttributeValue); } FXJSE_Value_SetUTF8String( pArguments->GetReturnValue(), FX_UTF8Encode(wsAttributeValue, wsAttributeValue.GetLength()) - .AsByteStringC()); + .AsStringC()); } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"getAttribute"); @@ -3536,8 +3523,8 @@ void CXFA_Node::Script_Packet_SetAttribute(CFXJSE_Arguments* pArguments) { CFDE_XMLNode* pXMLNode = GetXMLMappingNode(); if (pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element) { static_cast<CFDE_XMLElement*>(pXMLNode) - ->SetString(CFX_WideString::FromUTF8(bsName.AsByteStringC()), - CFX_WideString::FromUTF8(bsValue.AsByteStringC())); + ->SetString(CFX_WideString::FromUTF8(bsName.AsStringC()), + CFX_WideString::FromUTF8(bsValue.AsStringC())); } FXJSE_Value_SetNull(pArguments->GetReturnValue()); } else { @@ -3549,7 +3536,7 @@ void CXFA_Node::Script_Packet_RemoveAttribute(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if (argc == 1) { CFX_ByteString bsName = pArguments->GetUTF8String(0); - CFX_WideString wsName = CFX_WideString::FromUTF8(bsName.AsByteStringC()); + CFX_WideString wsName = CFX_WideString::FromUTF8(bsName.AsStringC()); CFDE_XMLNode* pXMLNode = GetXMLMappingNode(); if (pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element) { CFDE_XMLElement* pXMLElement = static_cast<CFDE_XMLElement*>(pXMLNode); @@ -3573,7 +3560,7 @@ void CXFA_Node::Script_Packet_Content(FXJSE_HVALUE hValue, if (pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element) { CFDE_XMLElement* pXMLElement = static_cast<CFDE_XMLElement*>(pXMLNode); pXMLElement->SetTextData( - CFX_WideString::FromUTF8(bsNewContent.AsByteStringC())); + CFX_WideString::FromUTF8(bsNewContent.AsStringC())); } } else { CFX_WideString wsTextData; @@ -3583,8 +3570,7 @@ void CXFA_Node::Script_Packet_Content(FXJSE_HVALUE hValue, pXMLElement->GetTextData(wsTextData); } FXJSE_Value_SetUTF8String( - hValue, - FX_UTF8Encode(wsTextData, wsTextData.GetLength()).AsByteStringC()); + hValue, FX_UTF8Encode(wsTextData, wsTextData.GetLength()).AsStringC()); } } void CXFA_Node::Script_Source_Next(CFXJSE_Arguments* pArguments) { @@ -3736,8 +3722,7 @@ void CXFA_Node::Script_Script_Stateless(FXJSE_HVALUE hValue, ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); return; } - FXJSE_Value_SetUTF8String(hValue, - FX_UTF8Encode(FX_WSTRC(L"0")).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(FX_WSTRC(L"0")).AsStringC()); } void CXFA_Node::Script_Encrypt_Format(FXJSE_HVALUE hValue, FX_BOOL bSetting, @@ -3957,7 +3942,7 @@ FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr, CFX_WideString* pClone = new CFX_WideString(wsValue); SetUserData(pKey, pClone, &deleteWideStringCallBack); } else { - SetMapModuleString(pKey, wsValue.AsWideStringC()); + SetMapModuleString(pKey, wsValue.AsStringC()); if (eAttr == XFA_ATTRIBUTE_Name) UpdateNameHash(); } @@ -4314,8 +4299,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); if (wsContentType == FX_WSTRC(L"text/html")) { wsContentType = FX_WSTRC(L""); - SetAttribute(XFA_ATTRIBUTE_ContentType, - wsContentType.AsWideStringC()); + SetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType.AsStringC()); } } CXFA_Node* pContentRawDataNode = GetNodeItem(XFA_NODEITEM_FirstChild); @@ -5227,7 +5211,7 @@ void CXFA_Node::MoveBufferMapData(CXFA_Node* pDstModule, void* pKey) { CFX_WideString wsFormatValue(wsValue); CXFA_WidgetData* pWidgetData = pDstModule->GetContainerWidgetData(); if (pWidgetData) { - pWidgetData->GetFormatDataValue(wsValue.AsWideStringC(), wsFormatValue); + pWidgetData->GetFormatDataValue(wsValue.AsStringC(), wsFormatValue); } pDstModule->SetScriptContent(wsValue, wsFormatValue, TRUE, TRUE); } @@ -5326,8 +5310,8 @@ void CXFA_NodeList::Script_TreelistClass_NamedItem( int32_t argc = pArguments->GetLength(); if (argc == 1) { CFX_ByteString szName = pArguments->GetUTF8String(0); - CXFA_Node* pNode = NamedItem( - CFX_WideString::FromUTF8(szName.AsByteStringC()).AsWideStringC()); + CXFA_Node* pNode = + NamedItem(CFX_WideString::FromUTF8(szName.AsStringC()).AsStringC()); if (!pNode) { return; } diff --git a/xfa/fxfa/parser/xfa_parser_imp.cpp b/xfa/fxfa/parser/xfa_parser_imp.cpp index 7b8e73410e..5cd28e79df 100644 --- a/xfa/fxfa/parser/xfa_parser_imp.cpp +++ b/xfa/fxfa/parser/xfa_parser_imp.cpp @@ -226,7 +226,7 @@ static inline void XFA_FDEExtension_GetElementTagNamespaceURI( CFX_WideString wsNodeStr; pElement->GetNamespacePrefix(wsNodeStr); if (!XFA_FDEExtension_ResolveNamespaceQualifier( - pElement, wsNodeStr.AsWideStringC(), wsNamespaceURI)) { + pElement, wsNodeStr.AsStringC(), wsNamespaceURI)) { wsNamespaceURI.Empty(); } } @@ -284,7 +284,7 @@ static FX_BOOL XFA_FDEExtension_ResolveAttribute( return FALSE; } if (!XFA_FDEExtension_ResolveNamespaceQualifier( - pElement, wsNSPrefix.AsWideStringC(), wsNamespaceURI)) { + pElement, wsNSPrefix.AsStringC(), wsNamespaceURI)) { wsNamespaceURI.Empty(); return FALSE; } @@ -319,7 +319,7 @@ static FX_BOOL XFA_FDEExtension_FindAttributeWithNS( wsNSPrefix = wsAttrName.Left(iFind); } if (!XFA_FDEExtension_ResolveNamespaceQualifier( - pElement, wsNSPrefix.AsWideStringC(), wsAttrNS)) { + pElement, wsNSPrefix.AsStringC(), wsAttrNS)) { continue; } if (bMatchNSAsPrefix) { @@ -434,7 +434,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP( CFX_WideString wsPacketName; pElement->GetLocalTagName(wsPacketName); const XFA_PACKETINFO* pPacketInfo = - XFA_GetPacketByName(wsPacketName.AsWideStringC()); + XFA_GetPacketByName(wsPacketName.AsStringC()); if (pPacketInfo && pPacketInfo->pURI) { if (!XFA_FDEExtension_MatchNodeName(pElement, pPacketInfo->pName, pPacketInfo->pURI, @@ -586,7 +586,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_TemplateForm( } pNode->SetCData(XFA_ATTRIBUTE_Name, XFA_GetPacketByIndex(XFA_PACKET_Form)->pName); - pNode->SetAttribute(XFA_ATTRIBUTE_Checksum, wsChecksum.AsWideStringC()); + pNode->SetAttribute(XFA_ATTRIBUTE_Checksum, wsChecksum.AsStringC()); CXFA_Node* pTemplateRoot = m_pRootNode->GetFirstChildByClass(XFA_ELEMENT_Template); CXFA_Node* pTemplateChosen = @@ -823,7 +823,7 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode, CFX_WideString wsTagName; pXMLElement->GetLocalTagName(wsTagName); const XFA_ELEMENTINFO* pElemInfo = - XFA_GetElementByName(wsTagName.AsWideStringC()); + XFA_GetElementByName(wsTagName.AsStringC()); if (!pElemInfo) { continue; } @@ -843,8 +843,7 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode, return NULL; } if (ePacketID == XFA_XDPPACKET_Config) { - pXFAChild->SetAttribute(XFA_ATTRIBUTE_Name, - wsTagName.AsWideStringC()); + pXFAChild->SetAttribute(XFA_ATTRIBUTE_Name, wsTagName.AsStringC()); } FX_BOOL IsNeedValue = TRUE; for (int32_t i = 0, count = pXMLElement->CountAttributes(); i < count; @@ -854,13 +853,13 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode, CFX_WideString wsAttrValue; pXMLElement->GetAttribute(i, wsAttrQualifiedName, wsAttrValue); XFA_FDEExtension_GetAttributeLocalName( - wsAttrQualifiedName.AsWideStringC(), wsAttrName); + wsAttrQualifiedName.AsStringC(), wsAttrName); if (wsAttrName == FX_WSTRC(L"nil") && wsAttrValue == FX_WSTRC(L"true")) { IsNeedValue = FALSE; } const XFA_ATTRIBUTEINFO* lpAttrInfo = - XFA_GetAttributeByName(wsAttrName.AsWideStringC()); + XFA_GetAttributeByName(wsAttrName.AsStringC()); if (!lpAttrInfo) { continue; } @@ -868,8 +867,7 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode, lpAttrInfo->eName != XFA_ATTRIBUTE_Save) { continue; } - pXFAChild->SetAttribute(lpAttrInfo->eName, - wsAttrValue.AsWideStringC()); + pXFAChild->SetAttribute(lpAttrInfo->eName, wsAttrValue.AsStringC()); } pXFANode->InsertChild(pXFAChild); if (pElemInfo->eName == XFA_ELEMENT_Validate || @@ -1112,8 +1110,8 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode, CFX_WideString wsAttrNamespaceURI; pXMLElement->GetAttribute(i, wsAttrQualifiedName, wsAttrValue); if (!XFA_FDEExtension_ResolveAttribute( - pXMLElement, wsAttrQualifiedName.AsWideStringC(), - wsAttrName, wsAttrNamespaceURI)) { + pXMLElement, wsAttrQualifiedName.AsStringC(), wsAttrName, + wsAttrNamespaceURI)) { continue; } if (wsAttrName == FX_WSTRC(L"nil") && diff --git a/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp index 5d48e3eaf7..64f6b93cb9 100644 --- a/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp +++ b/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp @@ -32,9 +32,9 @@ void Script_EventPseudoModel_StringProperty(FXJSE_HVALUE hValue, if (bSetting) { CFX_ByteString bsValue; FXJSE_Value_ToUTF8String(hValue, bsValue); - wsValue = CFX_WideString::FromUTF8(bsValue.AsByteStringC()); + wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC()); } else { - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsStringC()); } } void Script_EventPseudoModel_InterProperty(FXJSE_HVALUE hValue, diff --git a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp index 48edc73777..647962a2ab 100644 --- a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp +++ b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp @@ -32,7 +32,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_LoadString( uint32_t dwFlag) { CFX_WideString wsValue; pNotify->GetAppProvider()->LoadString(dwFlag, wsValue); - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsStringC()); } void CScript_HostPseudoModel::Script_HostPseudoModel_AppType( FXJSE_HVALUE hValue, @@ -48,7 +48,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_AppType( } CFX_WideString wsAppType; pNotify->GetAppProvider()->GetAppType(wsAppType); - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppType).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppType).AsStringC()); } void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitAppType( FXJSE_HVALUE hValue, @@ -64,7 +64,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitAppType( } CFX_WideString wsAppType; pNotify->GetAppProvider()->GetFoxitAppType(wsAppType); - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppType).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppType).AsStringC()); } void CScript_HostPseudoModel::Script_HostPseudoModel_CalculationsEnabled( FXJSE_HVALUE hValue, @@ -114,7 +114,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Language( } CFX_WideString wsLanguage; pNotify->GetAppProvider()->GetLanguage(wsLanguage); - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsLanguage).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsLanguage).AsStringC()); } void CScript_HostPseudoModel::Script_HostPseudoModel_NumPages( FXJSE_HVALUE hValue, @@ -146,7 +146,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Platform( } CFX_WideString wsPlatform; pNotify->GetAppProvider()->GetPlatform(wsPlatform); - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsPlatform).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsPlatform).AsStringC()); } void CScript_HostPseudoModel::Script_HostPseudoModel_Title( FXJSE_HVALUE hValue, @@ -164,13 +164,12 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Title( CFX_ByteString bsValue; FXJSE_Value_ToUTF8String(hValue, bsValue); pNotify->GetDocProvider()->SetTitle( - hDoc, - CFX_WideString::FromUTF8(bsValue.AsByteStringC()).AsWideStringC()); + hDoc, CFX_WideString::FromUTF8(bsValue.AsStringC()).AsStringC()); return; } CFX_WideString wsTitle; pNotify->GetDocProvider()->GetTitle(hDoc, wsTitle); - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsTitle).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsTitle).AsStringC()); } void CScript_HostPseudoModel::Script_HostPseudoModel_ValidationsEnabled( FXJSE_HVALUE hValue, @@ -206,7 +205,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Variation( } CFX_WideString wsVariation; pNotify->GetAppProvider()->GetVariation(wsVariation); - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVariation).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVariation).AsStringC()); } void CScript_HostPseudoModel::Script_HostPseudoModel_Version( FXJSE_HVALUE hValue, @@ -222,7 +221,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Version( } CFX_WideString wsVersion; pNotify->GetAppProvider()->GetVersion(wsVersion); - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVersion).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVersion).AsStringC()); } void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitVersion( FXJSE_HVALUE hValue, @@ -238,7 +237,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitVersion( } CFX_WideString wsVersion; pNotify->GetAppProvider()->GetFoxitVersion(wsVersion); - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVersion).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVersion).AsStringC()); } void CScript_HostPseudoModel::Script_HostPseudoModel_Name( FXJSE_HVALUE hValue, @@ -254,7 +253,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Name( } CFX_WideString wsAppName; pNotify->GetAppProvider()->GetAppName(wsAppName); - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppName).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppName).AsStringC()); } void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitName( FXJSE_HVALUE hValue, @@ -270,8 +269,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitName( } CFX_WideString wsFoxitAppName; pNotify->GetAppProvider()->GetFoxitAppName(wsFoxitAppName); - FXJSE_Value_SetUTF8String(hValue, - FX_UTF8Encode(wsFoxitAppName).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsFoxitAppName).AsStringC()); } void CScript_HostPseudoModel::Script_HostPseudoModel_GotoURL( CFXJSE_Arguments* pArguments) { @@ -291,9 +289,9 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_GotoURL( CFX_WideString wsURL; if (iLength >= 1) { CFX_ByteString bsURL = pArguments->GetUTF8String(0); - wsURL = CFX_WideString::FromUTF8(bsURL.AsByteStringC()); + wsURL = CFX_WideString::FromUTF8(bsURL.AsStringC()); } - pNotify->GetDocProvider()->GotoURL(hDoc, wsURL.AsWideStringC()); + pNotify->GetDocProvider()->GotoURL(hDoc, wsURL.AsStringC()); } void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList( CFXJSE_Arguments* pArguments) { @@ -318,7 +316,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList( CFX_ByteString bsString; FXJSE_Value_ToUTF8String(hValue, bsString); CFX_WideString wsExpression = - CFX_WideString::FromUTF8(bsString.AsByteStringC()); + CFX_WideString::FromUTF8(bsString.AsStringC()); CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { FXJSE_Value_Release(hValue); @@ -333,7 +331,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList( XFA_RESOLVENODE_Siblings; XFA_RESOLVENODE_RS resoveNodeRS; int32_t iRet = pScriptContext->ResolveObjects( - pObject, wsExpression.AsWideStringC(), resoveNodeRS, dwFlag); + pObject, wsExpression.AsStringC(), resoveNodeRS, dwFlag); if (iRet < 1 || !resoveNodeRS.nodes[0]->IsNode()) { FXJSE_Value_Release(hValue); return; @@ -371,26 +369,26 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Response( FX_BOOL bMark = FALSE; if (iLength >= 1) { CFX_ByteString bsQuestion = pArguments->GetUTF8String(0); - wsQuestion = CFX_WideString::FromUTF8(bsQuestion.AsByteStringC()); + wsQuestion = CFX_WideString::FromUTF8(bsQuestion.AsStringC()); } if (iLength >= 2) { CFX_ByteString bsTitle = pArguments->GetUTF8String(1); - wsTitle = CFX_WideString::FromUTF8(bsTitle.AsByteStringC()); + wsTitle = CFX_WideString::FromUTF8(bsTitle.AsStringC()); } if (iLength >= 3) { CFX_ByteString bsDefaultAnswer = pArguments->GetUTF8String(2); - wsDefaultAnswer = CFX_WideString::FromUTF8(bsDefaultAnswer.AsByteStringC()); + wsDefaultAnswer = CFX_WideString::FromUTF8(bsDefaultAnswer.AsStringC()); } if (iLength >= 4) { bMark = pArguments->GetInt32(3) == 0 ? FALSE : TRUE; } CFX_WideString wsAnswer; - pNotify->GetAppProvider()->Response(wsAnswer, wsQuestion.AsWideStringC(), - wsTitle.AsWideStringC(), - wsDefaultAnswer.AsWideStringC(), bMark); + pNotify->GetAppProvider()->Response(wsAnswer, wsQuestion.AsStringC(), + wsTitle.AsStringC(), + wsDefaultAnswer.AsStringC(), bMark); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { - FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAnswer).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAnswer).AsStringC()); } } void CScript_HostPseudoModel::Script_HostPseudoModel_DocumentInBatch( @@ -443,7 +441,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ResetData( CFX_WideString wsExpression; if (iLength >= 1) { CFX_ByteString bsExpression = pArguments->GetUTF8String(0); - wsExpression = CFX_WideString::FromUTF8(bsExpression.AsByteStringC()); + wsExpression = CFX_WideString::FromUTF8(bsExpression.AsStringC()); } if (wsExpression.IsEmpty()) { pNotify->ResetData(); @@ -454,7 +452,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ResetData( CXFA_Node* pNode = NULL; int32_t iExpLength = wsExpression.GetLength(); while (iStart < iExpLength) { - iStart = XFA_FilterName(wsExpression.AsWideStringC(), iStart, wsName); + iStart = XFA_FilterName(wsExpression.AsStringC(), iStart, wsName); CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { return; @@ -466,8 +464,8 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ResetData( uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings; XFA_RESOLVENODE_RS resoveNodeRS; - int32_t iRet = pScriptContext->ResolveObjects( - pObject, wsName.AsWideStringC(), resoveNodeRS, dwFlag); + int32_t iRet = pScriptContext->ResolveObjects(pObject, wsName.AsStringC(), + resoveNodeRS, dwFlag); if (iRet < 1 || !resoveNodeRS.nodes[0]->IsNode()) { continue; } @@ -521,7 +519,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus( CFX_ByteString bsString; FXJSE_Value_ToUTF8String(hValue, bsString); CFX_WideString wsExpression = - CFX_WideString::FromUTF8(bsString.AsByteStringC()); + CFX_WideString::FromUTF8(bsString.AsStringC()); CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { FXJSE_Value_Release(hValue); @@ -536,7 +534,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus( XFA_RESOLVENODE_Siblings; XFA_RESOLVENODE_RS resoveNodeRS; int32_t iRet = pScriptContext->ResolveObjects( - pObject, wsExpression.AsWideStringC(), resoveNodeRS, dwFlag); + pObject, wsExpression.AsStringC(), resoveNodeRS, dwFlag); if (iRet < 1 || !resoveNodeRS.nodes[0]->IsNode()) { FXJSE_Value_Release(hValue); return; @@ -601,8 +599,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_MessageBox( } } int32_t iValue = pNotify->GetAppProvider()->MsgBox( - wsMessage.AsWideStringC(), bsTitle.AsWideStringC(), dwMessageType, - dwButtonType); + wsMessage.AsStringC(), bsTitle.AsStringC(), dwMessageType, dwButtonType); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { FXJSE_Value_SetInteger(hValue, iValue); @@ -631,7 +628,7 @@ FX_BOOL CScript_HostPseudoModel::Script_HostPseudoModel_ValidateArgsForMsg( } else { CFX_ByteString byMessage; FXJSE_Value_ToUTF8String(hValueArg, byMessage); - wsValue = CFX_WideString::FromUTF8(byMessage.AsByteStringC()); + wsValue = CFX_WideString::FromUTF8(byMessage.AsStringC()); } FXJSE_Value_Release(hValueArg); return TRUE; @@ -731,10 +728,10 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ImportData( CFX_WideString wsFilePath; if (iLength > 0) { CFX_ByteString bsFilePath = pArguments->GetUTF8String(0); - wsFilePath = CFX_WideString::FromUTF8(bsFilePath.AsByteStringC()); + wsFilePath = CFX_WideString::FromUTF8(bsFilePath.AsStringC()); } CXFA_FFDoc* hDoc = pNotify->GetHDOC(); - pNotify->GetDocProvider()->ImportData(hDoc, wsFilePath.AsWideStringC()); + pNotify->GetDocProvider()->ImportData(hDoc, wsFilePath.AsStringC()); } void CScript_HostPseudoModel::Script_HostPseudoModel_ExportData( CFXJSE_Arguments* pArguments) { @@ -752,12 +749,12 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ExportData( FX_BOOL bXDP = TRUE; if (iLength >= 1) { CFX_ByteString bsFilePath = pArguments->GetUTF8String(0); - wsFilePath = CFX_WideString::FromUTF8(bsFilePath.AsByteStringC()); + wsFilePath = CFX_WideString::FromUTF8(bsFilePath.AsStringC()); } if (iLength >= 2) { bXDP = pArguments->GetInt32(1) == 0 ? FALSE : TRUE; } - pNotify->GetDocProvider()->ExportData(hDoc, wsFilePath.AsWideStringC(), bXDP); + pNotify->GetDocProvider()->ExportData(hDoc, wsFilePath.AsStringC(), bXDP); } void CScript_HostPseudoModel::Script_HostPseudoModel_PageUp( CFXJSE_Arguments* pArguments) { @@ -803,7 +800,6 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_CurrentDateTime( CFX_WideString wsDataTime = pNotify->GetCurrentDateTime(); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { - FXJSE_Value_SetUTF8String(hValue, - FX_UTF8Encode(wsDataTime).AsByteStringC()); + FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsDataTime).AsStringC()); } } diff --git a/xfa/fxfa/parser/xfa_script_imp.cpp b/xfa/fxfa/parser/xfa_script_imp.cpp index e0536fc136..71fec27814 100644 --- a/xfa/fxfa/parser/xfa_script_imp.cpp +++ b/xfa/fxfa/parser/xfa_script_imp.cpp @@ -123,8 +123,8 @@ void CXFA_ScriptContext::GlobalPropertySetter(FXJSE_HOBJECT hObject, if (lpOrginalNode->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) { pRefNode = ToNode(lpCurNode); } - if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsWideStringC(), - hValue, dwFlag, TRUE)) { + if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), hValue, + dwFlag, TRUE)) { return; } if (lpOrginalNode->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) { @@ -196,13 +196,13 @@ void CXFA_ScriptContext::GlobalPropertyGetter(FXJSE_HOBJECT hObject, if (pOrginalObject->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) { pRefNode = ToNode(lpCurNode); } - if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsWideStringC(), - hValue, dwFlag, FALSE)) { + if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), hValue, + dwFlag, FALSE)) { return; } dwFlag = XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings; - if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsWideStringC(), - hValue, dwFlag, FALSE)) { + if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), hValue, + dwFlag, FALSE)) { return; } CXFA_Object* pScriptObject = @@ -241,7 +241,7 @@ void CXFA_ScriptContext::NormalPropertyGetter(FXJSE_HOBJECT hObject, uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Attributes; FX_BOOL bRet = lpScriptContext->QueryNodeByFlag( - ToNode(pObject), wsPropName.AsWideStringC(), hValue, dwFlag, FALSE); + ToNode(pObject), wsPropName.AsStringC(), hValue, dwFlag, FALSE); if (bRet) { return; } @@ -250,7 +250,7 @@ void CXFA_ScriptContext::NormalPropertyGetter(FXJSE_HOBJECT hObject, !lpScriptContext->IsStrictScopeInJavaScript())) { dwFlag = XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings; bRet = lpScriptContext->QueryNodeByFlag( - ToNode(pObject), wsPropName.AsWideStringC(), hValue, dwFlag, FALSE); + ToNode(pObject), wsPropName.AsStringC(), hValue, dwFlag, FALSE); } if (bRet) { return; @@ -278,7 +278,7 @@ void CXFA_ScriptContext::NormalPropertySetter(FXJSE_HOBJECT hObject, CXFA_Object* pObject = lpScriptContext->GetVariablesThis(pOrginalObject); CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo = XFA_GetScriptAttributeByName( - pObject->GetClassID(), wsPropName.AsWideStringC()); + pObject->GetClassID(), wsPropName.AsStringC()); if (lpAttributeInfo) { (pObject->*(lpAttributeInfo->lpfnCallback))( hValue, TRUE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute); @@ -290,17 +290,17 @@ void CXFA_ScriptContext::NormalPropertySetter(FXJSE_HOBJECT hObject, CXFA_Node* pNode = ToNode(pObject); CXFA_Node* pPropOrChild = NULL; const XFA_ELEMENTINFO* lpElementInfo = - XFA_GetElementByName(wsPropName.AsWideStringC()); + XFA_GetElementByName(wsPropName.AsStringC()); if (lpElementInfo) { pPropOrChild = pNode->GetProperty(0, lpElementInfo->eName); } else { - pPropOrChild = pNode->GetFirstChildByName(wsPropName.AsWideStringC()); + pPropOrChild = pNode->GetFirstChildByName(wsPropName.AsStringC()); } if (pPropOrChild) { CFX_WideString wsDefaultName = FX_WSTRC(L"{default}"); const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo = XFA_GetScriptAttributeByName(pPropOrChild->GetClassID(), - wsDefaultName.AsWideStringC()); + wsDefaultName.AsStringC()); if (lpAttributeInfo) { (pPropOrChild->*(lpAttributeInfo->lpfnCallback))( hValue, TRUE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute); @@ -329,11 +329,11 @@ int32_t CXFA_ScriptContext::NormalPropTypeGetter( pObject = lpScriptContext->GetVariablesThis(pObject); XFA_ELEMENT objElement = pObject->GetClassID(); CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); - if (XFA_GetMethodByName(objElement, wsPropName.AsWideStringC())) { + if (XFA_GetMethodByName(objElement, wsPropName.AsStringC())) { return FXJSE_ClassPropType_Method; } if (bQueryIn && - !XFA_GetScriptAttributeByName(objElement, wsPropName.AsWideStringC())) { + !XFA_GetScriptAttributeByName(objElement, wsPropName.AsStringC())) { return FXJSE_ClassPropType_None; } return FXJSE_ClassPropType_Property; @@ -351,7 +351,7 @@ int32_t CXFA_ScriptContext::GlobalPropTypeGetter( pObject = lpScriptContext->GetVariablesThis(pObject); XFA_ELEMENT objElement = pObject->GetClassID(); CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); - if (XFA_GetMethodByName(objElement, wsPropName.AsWideStringC())) { + if (XFA_GetMethodByName(objElement, wsPropName.AsStringC())) { return FXJSE_ClassPropType_Method; } return FXJSE_ClassPropType_Property; @@ -368,7 +368,7 @@ void CXFA_ScriptContext::NormalMethodCall(FXJSE_HOBJECT hThis, pObject = lpScriptContext->GetVariablesThis(pObject); CFX_WideString wsFunName = CFX_WideString::FromUTF8(szFuncName); const XFA_METHODINFO* lpMethodInfo = - XFA_GetMethodByName(pObject->GetClassID(), wsFunName.AsWideStringC()); + XFA_GetMethodByName(pObject->GetClassID(), wsFunName.AsStringC()); if (NULL == lpMethodInfo) { return; } diff --git a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp index da19b381bb..ab7f6923d4 100644 --- a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp +++ b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp @@ -74,7 +74,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_HWXY( if (iLength >= 2) { CFX_ByteString bsUnit = pArguments->GetUTF8String(1); if (!bsUnit.IsEmpty()) { - wsUnit = CFX_WideString::FromUTF8(bsUnit.AsByteStringC()); + wsUnit = CFX_WideString::FromUTF8(bsUnit.AsStringC()); } } if (iLength >= 3) { @@ -117,7 +117,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_HWXY( measure.Set(rtRect.top, XFA_UNIT_Pt); break; } - XFA_UNIT unit = measure.GetUnit(wsUnit.AsWideStringC()); + XFA_UNIT unit = measure.GetUnit(wsUnit.AsStringC()); FX_FLOAT fValue = measure.ToUnit(unit); fValue = FXSYS_round(fValue * 1000) / 1000.0f; if (hValue) { @@ -367,7 +367,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageContent( } if (iLength >= 2) { CFX_ByteString bsType = pArguments->GetUTF8String(1); - wsType = CFX_WideString::FromUTF8(bsType.AsByteStringC()); + wsType = CFX_WideString::FromUTF8(bsType.AsStringC()); } if (iLength >= 3) { bOnPageArea = pArguments->GetInt32(2) == 0 ? FALSE : TRUE; diff --git a/xfa/fxfa/parser/xfa_script_nodehelper.cpp b/xfa/fxfa/parser/xfa_script_nodehelper.cpp index 9e8ff5191c..619ba65fff 100644 --- a/xfa/fxfa/parser/xfa_script_nodehelper.cpp +++ b/xfa/fxfa/parser/xfa_script_nodehelper.cpp @@ -368,8 +368,7 @@ FX_BOOL CXFA_NodeHelper::XFA_ResolveNodes_CreateNode( XFA_CreateNode_ForCondition(wsCondition); } if (bIsClassName) { - const XFA_ELEMENTINFO* lpElement = - XFA_GetElementByName(wsName.AsWideStringC()); + const XFA_ELEMENTINFO* lpElement = XFA_GetElementByName(wsName.AsStringC()); if (lpElement == NULL) { return FALSE; } @@ -392,7 +391,7 @@ FX_BOOL CXFA_NodeHelper::XFA_ResolveNodes_CreateNode( for (int32_t iIndex = 0; iIndex < m_iCreateCount; iIndex++) { CXFA_Node* pNewNode = m_pCreateParent->CreateSamePacketNode(eClassType); if (pNewNode) { - pNewNode->SetAttribute(XFA_ATTRIBUTE_Name, wsName.AsWideStringC()); + pNewNode->SetAttribute(XFA_ATTRIBUTE_Name, wsName.AsStringC()); pNewNode->CreateXMLMappingNode(); m_pCreateParent->InsertChild(pNewNode); if (iIndex == m_iCreateCount - 1) { diff --git a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp index f86a65e712..6ebec5da9c 100644 --- a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp +++ b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp @@ -36,7 +36,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes(CXFA_ResolveNodesData& rnd) { if (!rnd.m_CurNode->IsNode()) { if (rnd.m_dwStyles & XFA_RESOLVENODE_Attributes) { return XFA_ResolveNodes_ForAttributeRs(rnd.m_CurNode, rnd, - rnd.m_wsName.AsWideStringC()); + rnd.m_wsName.AsStringC()); } return 0; } @@ -71,7 +71,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes(CXFA_ResolveNodesData& rnd) { rnd.m_Nodes.Add(rnd.m_CurNode); } else if ((rnd.m_dwStyles & XFA_RESOLVENODE_Attributes) && XFA_ResolveNodes_ForAttributeRs(rnd.m_CurNode, rnd, - rnd.m_wsName.AsWideStringC())) { + rnd.m_wsName.AsStringC())) { return 1; } if (rnd.m_Nodes.GetSize() > 0) { @@ -169,7 +169,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_NumberSign( CFX_WideString wsName = rnd.m_wsName.Right(rnd.m_wsName.GetLength() - 1); CFX_WideString wsCondition = rnd.m_wsCondition; CXFA_Node* curNode = ToNode(rnd.m_CurNode); - if (XFA_ResolveNodes_ForAttributeRs(curNode, rnd, wsName.AsWideStringC())) { + if (XFA_ResolveNodes_ForAttributeRs(curNode, rnd, wsName.AsStringC())) { return 1; } CXFA_ResolveNodesData rndFind; @@ -332,7 +332,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Normal( } } if (dwStyles & XFA_RESOLVENODE_Attributes) { - if (XFA_ResolveNodes_ForAttributeRs(curNode, rnd, wsName.AsWideStringC())) { + if (XFA_ResolveNodes_ForAttributeRs(curNode, rnd, wsName.AsStringC())) { return 1; } } @@ -367,7 +367,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Normal( } } else { const XFA_ELEMENTINFO* pElement = - XFA_GetElementByName(wsName.AsWideStringC()); + XFA_GetElementByName(wsName.AsStringC()); if (pElement) { pProp = curNode->AsNode()->GetProperty( 0, pElement->eName, pElement->eName != XFA_ELEMENT_PageSet); @@ -713,8 +713,8 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_DoPredicateFilter( CXFA_Object* node = findNodes[i]; FX_BOOL bRet = FALSE; FXJSE_HVALUE pRetValue = FXJSE_Value_Create(rnd.m_pSC->GetRuntime()); - bRet = pContext->RunScript(eLangType, wsExpression.AsWideStringC(), - pRetValue, node); + bRet = pContext->RunScript(eLangType, wsExpression.AsStringC(), pRetValue, + node); if (!bRet || !FXJSE_Value_ToBoolean(pRetValue)) { findNodes.RemoveAt(i); } diff --git a/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp b/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp index c5858e3e66..4f2f2eeca6 100644 --- a/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp +++ b/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp @@ -68,15 +68,14 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Sign( } if (iLength >= 2) { CFX_ByteString bsExpression = pArguments->GetUTF8String(1); - wsExpression = CFX_WideString::FromUTF8(bsExpression.AsByteStringC()); + wsExpression = CFX_WideString::FromUTF8(bsExpression.AsStringC()); } if (iLength >= 3) { CFX_ByteString bsXMLIdent = pArguments->GetUTF8String(2); - wsXMLIdent = CFX_WideString::FromUTF8(bsXMLIdent.AsByteStringC()); + wsXMLIdent = CFX_WideString::FromUTF8(bsXMLIdent.AsStringC()); } - FX_BOOL bSign = pNotify->GetDocProvider()->Sign(hDoc, pNodeList, - wsExpression.AsWideStringC(), - wsXMLIdent.AsWideStringC()); + FX_BOOL bSign = pNotify->GetDocProvider()->Sign( + hDoc, pNodeList, wsExpression.AsStringC(), wsXMLIdent.AsStringC()); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { FXJSE_Value_SetBoolean(hValue, bSign); |