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 | |
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')
33 files changed, 444 insertions, 497 deletions
diff --git a/xfa/fxfa/app/xfa_checksum.cpp b/xfa/fxfa/app/xfa_checksum.cpp index 39bdb64e47..69cb8350a3 100644 --- a/xfa/fxfa/app/xfa_checksum.cpp +++ b/xfa/fxfa/app/xfa_checksum.cpp @@ -73,7 +73,7 @@ void CXFA_SAXReaderHandler::OnTagClose(void* pTag, uint32_t dwEndPos) { if (pSAXContext->m_eNode == FX_SAXNODE_Instruction) { textBuf << "?>"; } else if (pSAXContext->m_eNode == FX_SAXNODE_Tag) { - textBuf << "></" << pSAXContext->m_bsTagName.AsByteStringC() << ">"; + textBuf << "></" << pSAXContext->m_bsTagName.AsStringC() << ">"; } UpdateChecksum(FALSE); } diff --git a/xfa/fxfa/app/xfa_ffbarcode.cpp b/xfa/fxfa/app/xfa_ffbarcode.cpp index 5987627f7f..567882d546 100644 --- a/xfa/fxfa/app/xfa_ffbarcode.cpp +++ b/xfa/fxfa/app/xfa_ffbarcode.cpp @@ -167,7 +167,7 @@ void CXFA_FFBarcode::UpdateWidgetProperty() { CFWL_Barcode* pBarCodeWidget = (CFWL_Barcode*)m_pNormalWidget; CFX_WideString wsType = GetDataAcc()->GetBarcodeType(); XFA_LPCBARCODETYPEENUMINFO pBarcodeTypeInfo = - XFA_GetBarcodeTypeByName(wsType.AsWideStringC()); + XFA_GetBarcodeTypeByName(wsType.AsStringC()); pBarCodeWidget->SetType(pBarcodeTypeInfo->eBCType); CXFA_WidgetAcc* pAcc = GetDataAcc(); int32_t intVal; diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp index 41564c6b04..fe7943cfb1 100644 --- a/xfa/fxfa/app/xfa_ffchoicelist.cpp +++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp @@ -44,7 +44,7 @@ FX_BOOL CXFA_FFListBox::LoadWidget() { m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE); int32_t iItems = wsLabelArray.GetSize(); for (int32_t i = 0; i < iItems; i++) { - pListBox->AddString(wsLabelArray[i].AsWideStringC()); + pListBox->AddString(wsLabelArray[i].AsStringC()); } uint32_t dwExtendedStyle = FWL_STYLEEXT_LTB_ShowScrollBarFocus; if (m_pDataAcc->GetChoiceListOpen() == XFA_ATTRIBUTEENUM_MultiSelect) { @@ -166,7 +166,7 @@ void CXFA_FFListBox::SetItemState(int32_t nIndex, FX_BOOL bSelected) { void CXFA_FFListBox::InsertItem(const CFX_WideStringC& wsLabel, int32_t nIndex) { CFX_WideString wsTemp(wsLabel); - ((CFWL_ListBox*)m_pNormalWidget)->AddString(wsTemp.AsWideStringC()); + ((CFWL_ListBox*)m_pNormalWidget)->AddString(wsTemp.AsStringC()); m_pNormalWidget->Update(); AddInvalidateRect(); } @@ -240,7 +240,7 @@ FX_BOOL CXFA_FFComboBox::LoadWidget() { m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE); int32_t iItems = wsLabelArray.GetSize(); for (int32_t i = 0; i < iItems; i++) { - pComboBox->AddString(wsLabelArray[i].AsWideStringC()); + pComboBox->AddString(wsLabelArray[i].AsStringC()); } CFX_Int32Array iSelArray; m_pDataAcc->GetSelectedItems(iSelArray); @@ -250,7 +250,7 @@ FX_BOOL CXFA_FFComboBox::LoadWidget() { } else { CFX_WideString wsText; m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Raw); - pComboBox->SetEditText(wsText.AsWideStringC()); + pComboBox->SetEditText(wsText.AsStringC()); } UpdateWidgetProperty(); m_pNormalWidget->UnlockUpdate(); @@ -382,7 +382,7 @@ FX_BOOL CXFA_FFComboBox::UpdateFWLData() { CFX_WideString wsText; ((CFWL_ComboBox*)m_pNormalWidget)->SetCurSel(-1); m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Raw); - ((CFWL_ComboBox*)m_pNormalWidget)->SetEditText(wsText.AsWideStringC()); + ((CFWL_ComboBox*)m_pNormalWidget)->SetEditText(wsText.AsStringC()); } m_pNormalWidget->Update(); return TRUE; diff --git a/xfa/fxfa/app/xfa_ffdocview.cpp b/xfa/fxfa/app/xfa_ffdocview.cpp index b9b3b9a4a8..79bba442ad 100644 --- a/xfa/fxfa/app/xfa_ffdocview.cpp +++ b/xfa/fxfa/app/xfa_ffdocview.cpp @@ -163,7 +163,7 @@ void CXFA_FFDocView::ShowNullTestMsg() { } CFX_WideString wsTitle; pAppProvider->LoadString(XFA_IDS_AppName, wsTitle); - pAppProvider->MsgBox(wsMsg.AsWideStringC(), wsTitle.AsWideStringC(), + pAppProvider->MsgBox(wsMsg.AsStringC(), wsTitle.AsStringC(), XFA_MBICON_Status, XFA_MB_OK); } m_arrNullTestMsg.RemoveAll(); @@ -518,7 +518,7 @@ CXFA_WidgetAcc* CXFA_FFDocView::GetWidgetAccByName( } XFA_RESOLVENODE_RS resoveNodeRS; int32_t iRet = pScriptContext->ResolveObjects( - refNode, wsExpression.AsWideStringC(), resoveNodeRS, dwStyle); + refNode, wsExpression.AsStringC(), resoveNodeRS, dwStyle); if (iRet < 1) { return NULL; } diff --git a/xfa/fxfa/app/xfa_fffield.cpp b/xfa/fxfa/app/xfa_fffield.cpp index dc1cebbf66..e91dd96b95 100644 --- a/xfa/fxfa/app/xfa_fffield.cpp +++ b/xfa/fxfa/app/xfa_fffield.cpp @@ -731,9 +731,8 @@ int32_t CXFA_FFField::CalculateWidgetAcc(CXFA_WidgetAcc* pAcc) { wsMessage += wsWarning; CFX_WideString wsTitle; pAppProvider->LoadString(XFA_IDS_CalcOverride, wsTitle); - pAppProvider->MsgBox(wsMessage.AsWideStringC(), - wsTitle.AsWideStringC(), XFA_MBICON_Warning, - XFA_MB_OK); + pAppProvider->MsgBox(wsMessage.AsStringC(), wsTitle.AsStringC(), + XFA_MBICON_Warning, XFA_MB_OK); } } return 0; @@ -764,8 +763,8 @@ int32_t CXFA_FFField::CalculateWidgetAcc(CXFA_WidgetAcc* pAcc) { wsMessage += wsWarning; CFX_WideString wsTitle; pAppProvider->LoadString(XFA_IDS_CalcOverride, wsTitle); - if (pAppProvider->MsgBox(wsMessage.AsWideStringC(), - wsTitle.AsWideStringC(), XFA_MBICON_Warning, + if (pAppProvider->MsgBox(wsMessage.AsStringC(), wsTitle.AsStringC(), + XFA_MBICON_Warning, XFA_MB_YesNo) == XFA_IDYes) { pAcc->GetNode()->SetFlag(XFA_NODEFLAG_UserInteractive, TRUE, FALSE); return 1; diff --git a/xfa/fxfa/app/xfa_ffimageedit.cpp b/xfa/fxfa/app/xfa_ffimageedit.cpp index 343293d64c..344dfcddd9 100644 --- a/xfa/fxfa/app/xfa_ffimageedit.cpp +++ b/xfa/fxfa/app/xfa_ffimageedit.cpp @@ -108,8 +108,8 @@ FX_BOOL CXFA_FFImageEdit::OnLButtonDown(uint32_t dwFlags, CFX_WideString wsFilter; pAppProvider->LoadString(XFA_IDS_ImageFilter, wsFilter); CFX_WideStringArray wsPathArray; - pAppProvider->ShowFileDialog(wsTitle.AsWideStringC(), - wsFilter.AsWideStringC(), wsPathArray); + pAppProvider->ShowFileDialog(wsTitle.AsStringC(), wsFilter.AsStringC(), + wsPathArray); int32_t iSize = wsPathArray.GetSize(); if (iSize < 1) { return TRUE; @@ -148,8 +148,8 @@ FX_BOOL CXFA_FFImageEdit::OnLButtonDown(uint32_t dwFlags, m_pDataAcc->SetImageEditImage(NULL); pFileRead->Release(); } - m_pDataAcc->SetImageEdit(wsContentType.AsWideStringC(), CFX_WideStringC(), - wsImage.AsWideStringC()); + m_pDataAcc->SetImageEdit(wsContentType.AsStringC(), CFX_WideStringC(), + wsImage.AsStringC()); m_pDataAcc->LoadImageEditImage(); AddInvalidateRect(); m_pDocView->SetChangeMark(); diff --git a/xfa/fxfa/app/xfa_ffpageview.cpp b/xfa/fxfa/app/xfa_ffpageview.cpp index 54e315f466..62474b3e38 100644 --- a/xfa/fxfa/app/xfa_ffpageview.cpp +++ b/xfa/fxfa/app/xfa_ffpageview.cpp @@ -270,7 +270,7 @@ CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::GetTraverseWidget( if (pTraverse) { CFX_WideString wsTraverseWidgetName; if (pTraverse->GetAttribute(XFA_ATTRIBUTE_Ref, wsTraverseWidgetName)) { - return FindWidgetByName(wsTraverseWidgetName.AsWideStringC(), pWidget); + return FindWidgetByName(wsTraverseWidgetName.AsStringC(), pWidget); } } } diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp index 69d445e2ab..982ee00896 100644 --- a/xfa/fxfa/app/xfa_fftextedit.cpp +++ b/xfa/fxfa/app/xfa_fftextedit.cpp @@ -201,7 +201,7 @@ void CXFA_FFTextEdit::ValidateNumberField(const CFX_WideString& wsText) { pAcc->GetNode()->GetSOMExpression(wsSomField); wsMessage.Format(wsError, (const FX_WCHAR*)wsText, (const FX_WCHAR*)wsSomField); - pAppProvider->MsgBox(wsMessage.AsWideStringC(), wsTitle.AsWideStringC(), + pAppProvider->MsgBox(wsMessage.AsStringC(), wsTitle.AsStringC(), XFA_MBICON_Error, XFA_MB_OK); } } @@ -421,12 +421,12 @@ FWL_ERR CXFA_FFTextEdit::OnProcessEvent(CFWL_Event* pEvent) { case FWL_EVTHASH_EDT_CheckWord: { CFX_WideString wstr(L"FWL_EVENT_DTP_SelectChanged"); CFWL_EvtEdtCheckWord* event = (CFWL_EvtEdtCheckWord*)pEvent; - event->bCheckWord = CheckWord(event->bsWord.AsByteStringC()); + event->bCheckWord = CheckWord(event->bsWord.AsStringC()); break; } case FWL_EVTHASH_EDT_GetSuggestWords: { CFWL_EvtEdtGetSuggestWords* event = (CFWL_EvtEdtGetSuggestWords*)pEvent; - event->bSuggestWords = GetSuggestWords(event->bsWord.AsByteStringC(), + event->bSuggestWords = GetSuggestWords(event->bsWord.AsStringC(), event->bsArraySuggestWords); break; } @@ -594,7 +594,7 @@ FX_BOOL CXFA_FFDateTimeEdit::LoadWidget() { m_pNormalWidget->LockUpdate(); CFX_WideString wsText; m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Display); - pWidget->SetEditText(wsText.AsWideStringC()); + pWidget->SetEditText(wsText.AsStringC()); if (CXFA_Value value = m_pDataAcc->GetFormValue()) { switch (value.GetChildValueClassID()) { case XFA_ELEMENT_Date: { @@ -694,7 +694,7 @@ FX_BOOL CXFA_FFDateTimeEdit::UpdateFWLData() { } CFX_WideString wsText; m_pDataAcc->GetValue(wsText, eType); - ((CFWL_DateTimePicker*)m_pNormalWidget)->SetEditText(wsText.AsWideStringC()); + ((CFWL_DateTimePicker*)m_pNormalWidget)->SetEditText(wsText.AsStringC()); if (IsFocused() && !wsText.IsEmpty()) { CXFA_LocaleValue lcValue = XFA_GetLocaleValue(m_pDataAcc); CFX_Unitime date = lcValue.GetDate(); @@ -777,7 +777,7 @@ void CXFA_FFDateTimeEdit::OnSelectChanged(IFWL_Widget* pWidget, date.FormatPatterns(wsDate, wsPicture, m_pDataAcc->GetLocal(), XFA_VALUEPICTURE_Edit); CFWL_DateTimePicker* pDateTime = (CFWL_DateTimePicker*)m_pNormalWidget; - pDateTime->SetEditText(wsDate.AsWideStringC()); + pDateTime->SetEditText(wsDate.AsStringC()); pDateTime->Update(); GetDoc()->GetDocProvider()->SetFocusWidget(GetDoc(), NULL); CXFA_EventParam eParam; diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp index c484b9afa8..0192c8b46c 100644 --- a/xfa/fxfa/app/xfa_ffwidget.cpp +++ b/xfa/fxfa/app/xfa_ffwidget.cpp @@ -1004,7 +1004,7 @@ CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc* pDoc, if (wsURL.Left(7) != FX_WSTRC(L"http://") && wsURL.Left(6) != FX_WSTRC(L"ftp://")) { CFX_DIBitmap* pBitmap = - pDoc->GetPDFNamedImage(wsURL.AsWideStringC(), iImageXDpi, iImageYDpi); + pDoc->GetPDFNamedImage(wsURL.AsStringC(), iImageXDpi, iImageYDpi); if (pBitmap) { bNameImage = TRUE; return pBitmap; diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp index 073fbfe8aa..4e7da92370 100644 --- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp +++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp @@ -229,8 +229,8 @@ void CXFA_WidgetAcc::ResetData() { image.GetContentType(wsContentType); image.GetHref(wsHref); } - SetImageEdit(wsContentType.AsWideStringC(), wsHref.AsWideStringC(), - wsValue.AsWideStringC()); + SetImageEdit(wsContentType.AsStringC(), wsHref.AsStringC(), + wsValue.AsStringC()); } break; case XFA_ELEMENT_ExclGroup: { CXFA_Node* pNextChild = m_pNode->GetNodeItem( @@ -412,13 +412,12 @@ void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate, GetValidateMessage(pAppProvider, wsScriptMsg, FALSE, bVersionFlag); } if (bVersionFlag) { - pAppProvider->MsgBox(wsScriptMsg.AsWideStringC(), - wsTitle.AsWideStringC(), XFA_MBICON_Warning, - XFA_MB_OK); + pAppProvider->MsgBox(wsScriptMsg.AsStringC(), wsTitle.AsStringC(), + XFA_MBICON_Warning, XFA_MB_OK); return; } - if (pAppProvider->MsgBox(wsScriptMsg.AsWideStringC(), - wsTitle.AsWideStringC(), XFA_MBICON_Warning, + if (pAppProvider->MsgBox(wsScriptMsg.AsStringC(), wsTitle.AsStringC(), + XFA_MBICON_Warning, XFA_MB_YesNo) == XFA_IDYes) { GetNode()->SetFlag(XFA_NODEFLAG_UserInteractive, TRUE, FALSE); } @@ -426,9 +425,8 @@ void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate, if (wsScriptMsg.IsEmpty()) { GetValidateMessage(pAppProvider, wsScriptMsg, TRUE, bVersionFlag); } - pAppProvider->MsgBox(wsScriptMsg.AsWideStringC(), - wsTitle.AsWideStringC(), XFA_MBICON_Error, - XFA_MB_OK); + pAppProvider->MsgBox(wsScriptMsg.AsStringC(), wsTitle.AsStringC(), + XFA_MBICON_Error, XFA_MB_OK); } } } @@ -461,9 +459,8 @@ int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate, if (wsFormatMsg.IsEmpty()) { GetValidateMessage(pAppProvider, wsFormatMsg, TRUE, bVersionFlag); } - pAppProvider->MsgBox(wsFormatMsg.AsWideStringC(), - wsTitle.AsWideStringC(), XFA_MBICON_Error, - XFA_MB_OK); + pAppProvider->MsgBox(wsFormatMsg.AsStringC(), wsTitle.AsStringC(), + XFA_MBICON_Error, XFA_MB_OK); return XFA_EVENTERROR_Success; } if (GetNode()->HasFlag(XFA_NODEFLAG_UserInteractive)) { @@ -473,14 +470,12 @@ int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate, GetValidateMessage(pAppProvider, wsFormatMsg, FALSE, bVersionFlag); } if (bVersionFlag) { - pAppProvider->MsgBox(wsFormatMsg.AsWideStringC(), - wsTitle.AsWideStringC(), XFA_MBICON_Warning, - XFA_MB_OK); + pAppProvider->MsgBox(wsFormatMsg.AsStringC(), wsTitle.AsStringC(), + XFA_MBICON_Warning, XFA_MB_OK); return XFA_EVENTERROR_Success; } - if (pAppProvider->MsgBox(wsFormatMsg.AsWideStringC(), - wsTitle.AsWideStringC(), XFA_MBICON_Warning, - XFA_MB_YesNo) == XFA_IDYes) { + if (pAppProvider->MsgBox(wsFormatMsg.AsStringC(), wsTitle.AsStringC(), + XFA_MBICON_Warning, XFA_MB_YesNo) == XFA_IDYes) { GetNode()->SetFlag(XFA_NODEFLAG_UserInteractive, TRUE, FALSE); } return XFA_EVENTERROR_Success; @@ -535,7 +530,7 @@ int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate, pAppProvider->LoadString(XFA_IDS_ValidateNullError, wsError); wsNullMsg.Format(wsError, (const FX_WCHAR*)wsCaptionName); } - pAppProvider->MsgBox(wsNullMsg.AsWideStringC(), wsTitle.AsWideStringC(), + pAppProvider->MsgBox(wsNullMsg.AsStringC(), wsTitle.AsStringC(), XFA_MBICON_Status, XFA_MB_OK); return XFA_EVENTERROR_Error; } @@ -550,9 +545,8 @@ int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate, wsNullMsg.Format(wsWarning, (const FX_WCHAR*)wsCaptionName, (const FX_WCHAR*)wsCaptionName); } - if (pAppProvider->MsgBox(wsNullMsg.AsWideStringC(), - wsTitle.AsWideStringC(), XFA_MBICON_Warning, - XFA_MB_YesNo) == XFA_IDYes) { + if (pAppProvider->MsgBox(wsNullMsg.AsStringC(), wsTitle.AsStringC(), + XFA_MBICON_Warning, XFA_MB_YesNo) == XFA_IDYes) { GetNode()->SetFlag(XFA_NODEFLAG_UserInteractive, TRUE, FALSE); } return XFA_EVENTERROR_Error; @@ -684,7 +678,7 @@ int32_t CXFA_WidgetAcc::ExecuteScript(CXFA_Script script, ++m_nRecursionDepth; FX_BOOL bRet = pContext->RunScript((XFA_SCRIPTLANGTYPE)eScriptType, - wsExpression.AsWideStringC(), hRetValue, m_pNode); + wsExpression.AsStringC(), hRetValue, m_pNode); --m_nRecursionDepth; int32_t iRet = XFA_EVENTERROR_Error; if (bRet) { @@ -696,7 +690,7 @@ int32_t CXFA_WidgetAcc::ExecuteScript(CXFA_Script script, CFX_ByteString bsString; FXJSE_Value_ToUTF8String(hRetValue, bsString); pEventParam->m_wsResult = - CFX_WideString::FromUTF8(bsString.AsByteStringC()); + CFX_WideString::FromUTF8(bsString.AsStringC()); } iRet = XFA_EVENTERROR_Success; } else { @@ -1712,12 +1706,12 @@ FX_BOOL CXFA_TextProvider::GetEmbbedObj(FX_BOOL bURI, CXFA_Node* pIDNode = NULL; CXFA_WidgetAcc* pEmbAcc = NULL; if (pParent) { - pIDNode = pDocument->GetNodeByID(pParent, wsAttr.AsWideStringC()); + pIDNode = pDocument->GetNodeByID(pParent, wsAttr.AsStringC()); } if (!pIDNode) { pIDNode = pDocument->GetNodeByID( ToNode(pDocument->GetXFAObject(XFA_HASHCODE_Form)), - wsAttr.AsWideStringC()); + wsAttr.AsStringC()); } if (pIDNode) { pEmbAcc = (CXFA_WidgetAcc*)pIDNode->GetWidgetData(); diff --git a/xfa/fxfa/app/xfa_fontmgr.cpp b/xfa/fxfa/app/xfa_fontmgr.cpp index c2de4115cb..542fec57a3 100644 --- a/xfa/fxfa/app/xfa_fontmgr.cpp +++ b/xfa/fxfa/app/xfa_fontmgr.cpp @@ -1766,7 +1766,7 @@ IFX_Font* CXFA_DefFontMgr::GetFont(CXFA_FFDoc* hDoc, IFX_Font* pFont = pFDEFontMgr->LoadFont(wsFontName, dwFontStyles, wCodePage); if (!pFont) { const XFA_FONTINFO* pCurFont = - XFA_GetFontINFOByFontName(wsFontName.AsWideStringC()); + XFA_GetFontINFOByFontName(wsFontName.AsStringC()); if (pCurFont && pCurFont->pReplaceFont) { uint32_t dwStyle = 0; if (dwFontStyles & FX_FONTSTYLE_Bold) { @@ -1862,7 +1862,7 @@ IFX_Font* CXFA_PDFFontMgr::FindFont(CFX_ByteString strPsName, for (const auto& it : *pFontSetDict) { const CFX_ByteString& key = it.first; CPDF_Object* pObj = it.second; - if (!PsNameMatchDRFontName(strPsName.AsByteStringC(), bBold, bItalic, key, + if (!PsNameMatchDRFontName(strPsName.AsStringC(), bBold, bItalic, key, bStrictMatch)) { continue; } @@ -2030,8 +2030,7 @@ IFX_Font* CXFA_FontMgr::GetFont(CXFA_FFDoc* hDoc, CPDF_Font* pPDFFont = NULL; IFX_Font* pFont = NULL; if (pMgr) { - pFont = - pMgr->GetFont(wsEnglishName.AsWideStringC(), dwFontStyles, &pPDFFont); + pFont = pMgr->GetFont(wsEnglishName.AsStringC(), dwFontStyles, &pPDFFont); if (pFont) return pFont; } @@ -2040,8 +2039,8 @@ IFX_Font* CXFA_FontMgr::GetFont(CXFA_FFDoc* hDoc, } if (!pFont && pMgr) { pPDFFont = NULL; - pFont = pMgr->GetFont(wsEnglishName.AsWideStringC(), dwFontStyles, - &pPDFFont, FALSE); + pFont = pMgr->GetFont(wsEnglishName.AsStringC(), dwFontStyles, &pPDFFont, + FALSE); if (pFont) return pFont; } diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp index 7db66fdf88..55220e2f5a 100644 --- a/xfa/fxfa/app/xfa_textlayout.cpp +++ b/xfa/fxfa/app/xfa_textlayout.cpp @@ -326,7 +326,7 @@ int32_t CXFA_TextParser::GetVAlgin(CXFA_TextProvider* pTextProvider) const { FX_FLOAT CXFA_TextParser::GetTabInterval(IFDE_CSSComputedStyle* pStyle) const { CFX_WideString wsValue; if (pStyle && pStyle->GetCustomStyle(FX_WSTRC(L"tab-interval"), wsValue)) - return CXFA_Measurement(wsValue.AsWideStringC()).ToUnit(XFA_UNIT_Pt); + return CXFA_Measurement(wsValue.AsStringC()).ToUnit(XFA_UNIT_Pt); return 36; } diff --git a/xfa/fxfa/app/xfa_textlayout.h b/xfa/fxfa/app/xfa_textlayout.h index 65e0c038c0..5d3ce16a49 100644 --- a/xfa/fxfa/app/xfa_textlayout.h +++ b/xfa/fxfa/app/xfa_textlayout.h @@ -27,7 +27,7 @@ class CXFA_CSSTagProvider : public IFDE_CSSTagProvider { virtual ~CXFA_CSSTagProvider(); // Note: |this| must outlive the use of GetTagName()'s result. - virtual CFX_WideStringC GetTagName() { return m_wsTagName.AsWideStringC(); } + virtual CFX_WideStringC GetTagName() { return m_wsTagName.AsStringC(); } virtual FX_POSITION GetFirstAttribute() { return m_Attributes.GetStartPosition(); } diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp index 9646756f6e..e687ee53b8 100644 --- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp +++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp @@ -315,8 +315,8 @@ void CXFA_FM2JSContext::Avg(FXJSE_HOBJECT hThis, FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(hruntime); for (int32_t j = 2; j < iLength; j++) { FXJSE_Value_GetObjectPropByIdx(argValue, j, jsObjectValue); - FXJSE_Value_GetObjectProp( - jsObjectValue, propertyStr.AsByteStringC(), newPropertyValue); + FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(), + newPropertyValue); if (!FXJSE_Value_IsNull(newPropertyValue)) { dSum += HValueToDouble(hThis, newPropertyValue); uCount++; @@ -398,8 +398,8 @@ void CXFA_FM2JSContext::Count(FXJSE_HOBJECT hThis, FXJSE_Value_ToUTF8String(propertyValue, propertyStr); for (int32_t i = 2; i < iLength; i++) { FXJSE_Value_GetObjectPropByIdx(argValue, i, jsObjectValue); - FXJSE_Value_GetObjectProp( - jsObjectValue, propertyStr.AsByteStringC(), newPropertyValue); + FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(), + newPropertyValue); uCount += (FXJSE_Value_IsNull(newPropertyValue) ? 0 : 1); } } @@ -490,8 +490,8 @@ void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis, FXJSE_Value_ToUTF8String(propertyValue, propertyStr); for (int32_t i = 2; i < iLength; i++) { FXJSE_Value_GetObjectPropByIdx(argValue, i, jsObjectValue); - FXJSE_Value_GetObjectProp( - jsObjectValue, propertyStr.AsByteStringC(), newPropertyValue); + FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(), + newPropertyValue); if (!FXJSE_Value_IsNull(newPropertyValue)) { uCount++; if (uCount == 1) { @@ -593,8 +593,8 @@ void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis, FXJSE_Value_ToUTF8String(propertyValue, propertyStr); for (int32_t i = 2; i < iLength; i++) { FXJSE_Value_GetObjectPropByIdx(argValue, i, jsObjectValue); - FXJSE_Value_GetObjectProp( - jsObjectValue, propertyStr.AsByteStringC(), newPropertyValue); + FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(), + newPropertyValue); if (!FXJSE_Value_IsNull(newPropertyValue)) { uCount++; if (uCount == 1) { @@ -679,8 +679,8 @@ void CXFA_FM2JSContext::Mod(FXJSE_HOBJECT hThis, CFX_ByteString propertyStr; FXJSE_Value_ToUTF8String(propertyValue, propertyStr); FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp( - jsObjectValue, propertyStr.AsByteStringC(), newPropertyValue); + FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(), + newPropertyValue); dDividend = HValueToDouble(hThis, newPropertyValue); FXJSE_Value_Release(newPropertyValue); } @@ -708,8 +708,8 @@ void CXFA_FM2JSContext::Mod(FXJSE_HOBJECT hThis, CFX_ByteString propertyStr; FXJSE_Value_ToUTF8String(propertyValue, propertyStr); FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp( - jsObjectValue, propertyStr.AsByteStringC(), newPropertyValue); + FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(), + newPropertyValue); dDividor = HValueToDouble(hThis, newPropertyValue); FXJSE_Value_Release(newPropertyValue); } @@ -761,7 +761,7 @@ void CXFA_FM2JSContext::Round(FXJSE_HOBJECT hThis, CFX_ByteString propertyStr; FXJSE_Value_ToUTF8String(propertyValue, propertyStr); FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsByteStringC(), + FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(), newPropertyValue); dValue = HValueToDouble(hThis, newPropertyValue); FXJSE_Value_Release(newPropertyValue); @@ -774,7 +774,7 @@ void CXFA_FM2JSContext::Round(FXJSE_HOBJECT hThis, CFX_Decimal decimalValue((FX_FLOAT)dValue, uPrecision); CFX_WideString wsValue = decimalValue; FXJSE_Value_SetUTF8String(args.GetReturnValue(), - wsValue.UTF8Encode().AsByteStringC()); + wsValue.UTF8Encode().AsStringC()); } FXJSE_Value_Release(argOne); } else if (argc == 2) { @@ -795,7 +795,7 @@ void CXFA_FM2JSContext::Round(FXJSE_HOBJECT hThis, CFX_ByteString propertyStr; FXJSE_Value_ToUTF8String(propertyValue, propertyStr); FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsByteStringC(), + FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(), newPropertyValue); dValue = HValueToDouble(hThis, newPropertyValue); FXJSE_Value_Release(newPropertyValue); @@ -817,7 +817,7 @@ void CXFA_FM2JSContext::Round(FXJSE_HOBJECT hThis, CFX_ByteString propertyStr; FXJSE_Value_ToUTF8String(propertyValue, propertyStr); FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsByteStringC(), + FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(), newPropertyValue); dPrecision = HValueToDouble(hThis, newPropertyValue); FXJSE_Value_Release(newPropertyValue); @@ -837,7 +837,7 @@ void CXFA_FM2JSContext::Round(FXJSE_HOBJECT hThis, CFX_Decimal decimalValue((FX_FLOAT)dValue, uPrecision); CFX_WideString wsValue = decimalValue; FXJSE_Value_SetUTF8String(args.GetReturnValue(), - wsValue.UTF8Encode().AsByteStringC()); + wsValue.UTF8Encode().AsStringC()); } FXJSE_Value_Release(argOne); FXJSE_Value_Release(argTwo); @@ -886,8 +886,8 @@ void CXFA_FM2JSContext::Sum(FXJSE_HOBJECT hThis, FXJSE_Value_ToUTF8String(propertyValue, propertyStr); for (int32_t j = 2; j < iLength; j++) { FXJSE_Value_GetObjectPropByIdx(argValue, j, jsObjectValue); - FXJSE_Value_GetObjectProp( - jsObjectValue, propertyStr.AsByteStringC(), newPropertyValue); + FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(), + newPropertyValue); if (!FXJSE_Value_IsNull(newPropertyValue)) { dSum += HValueToDouble(hThis, newPropertyValue); uCount++; @@ -937,7 +937,7 @@ void CXFA_FM2JSContext::Date(FXJSE_HOBJECT hThis, bufferMon.Format("%02d", pTmStruct->tm_mon + 1); bufferDay.Format("%02d", pTmStruct->tm_mday); CFX_ByteString bufferCurrent = bufferYear + bufferMon + bufferDay; - int32_t dDays = DateString2Num(bufferCurrent.AsByteStringC()); + int32_t dDays = DateString2Num(bufferCurrent.AsStringC()); FXJSE_Value_SetInteger(args.GetReturnValue(), dDays); } else { CXFA_FM2JSContext* pContext = @@ -981,12 +981,12 @@ void CXFA_FM2JSContext::Date2Num(FXJSE_HOBJECT hThis, } if (!bFlags) { CFX_ByteString szIsoDateString; - FX_BOOL bRet = Local2IsoDate( - hThis, dateString.AsByteStringC(), formatString.AsByteStringC(), - localString.AsByteStringC(), szIsoDateString); + FX_BOOL bRet = + Local2IsoDate(hThis, dateString.AsStringC(), formatString.AsStringC(), + localString.AsStringC(), szIsoDateString); if (bRet) { FXJSE_Value_SetInteger(args.GetReturnValue(), - DateString2Num(szIsoDateString.AsByteStringC())); + DateString2Num(szIsoDateString.AsStringC())); } else { FXJSE_Value_SetInteger(args.GetReturnValue(), 0); } @@ -1037,12 +1037,11 @@ void CXFA_FM2JSContext::DateFmt(FXJSE_HOBJECT hThis, } if (!bFlags) { CFX_ByteString formatStr; - GetStandardDateFormat(hThis, iStyle, szLocal.AsByteStringC(), formatStr); + GetStandardDateFormat(hThis, iStyle, szLocal.AsStringC(), formatStr); if (formatStr.IsEmpty()) { formatStr = ""; } - FXJSE_Value_SetUTF8String(args.GetReturnValue(), - formatStr.AsByteStringC()); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), formatStr.AsStringC()); } else { FXJSE_Value_SetNull(args.GetReturnValue()); } @@ -1069,7 +1068,7 @@ void CXFA_FM2JSContext::IsoDate2Num(FXJSE_HOBJECT hThis, } else { CFX_ByteString szArgString; HValueToUTF8String(argOne, szArgString); - int32_t dDays = DateString2Num(szArgString.AsByteStringC()); + int32_t dDays = DateString2Num(szArgString.AsStringC()); FXJSE_Value_SetInteger(args.GetReturnValue(), (int32_t)dDays); } FXJSE_Value_Release(argOne); @@ -1102,7 +1101,7 @@ void CXFA_FM2JSContext::IsoTime2Num(FXJSE_HOBJECT hThis, return; } CXFA_LocaleValue timeValue( - XFA_VT_TIME, CFX_WideString::FromUTF8(szArgString.AsByteStringC()), + XFA_VT_TIME, CFX_WideString::FromUTF8(szArgString.AsStringC()), (CXFA_LocaleMgr*)pMgr); if (timeValue.IsValid()) { CFX_Unitime uniTime = timeValue.GetTime(); @@ -1167,13 +1166,11 @@ void CXFA_FM2JSContext::LocalDateFmt(FXJSE_HOBJECT hThis, } if (!bFlags) { CFX_ByteString formatStr; - GetLocalDateFormat(hThis, iStyle, szLocal.AsByteStringC(), formatStr, - FALSE); + GetLocalDateFormat(hThis, iStyle, szLocal.AsStringC(), formatStr, FALSE); if (formatStr.IsEmpty()) { formatStr = ""; } - FXJSE_Value_SetUTF8String(args.GetReturnValue(), - formatStr.AsByteStringC()); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), formatStr.AsStringC()); } else { FXJSE_Value_SetNull(args.GetReturnValue()); } @@ -1220,13 +1217,11 @@ void CXFA_FM2JSContext::LocalTimeFmt(FXJSE_HOBJECT hThis, } if (!bFlags) { CFX_ByteString formatStr; - GetLocalTimeFormat(hThis, iStyle, szLocal.AsByteStringC(), formatStr, - FALSE); + GetLocalTimeFormat(hThis, iStyle, szLocal.AsStringC(), formatStr, FALSE); if (formatStr.IsEmpty()) { formatStr = ""; } - FXJSE_Value_SetUTF8String(args.GetReturnValue(), - formatStr.AsByteStringC()); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), formatStr.AsStringC()); } else { FXJSE_Value_SetNull(args.GetReturnValue()); } @@ -1373,14 +1368,14 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, CFX_ByteString szIsoDateString; szIsoDateString.Format("%d%02d%02d", iYear + i, iMonth, iDay); CFX_ByteString szLocalDateString; - IsoDate2Local(hThis, szIsoDateString.AsByteStringC(), - formatString.AsByteStringC(), localString.AsByteStringC(), + IsoDate2Local(hThis, szIsoDateString.AsStringC(), + formatString.AsStringC(), localString.AsStringC(), szLocalDateString); if (szLocalDateString.IsEmpty()) { szLocalDateString = ""; } FXJSE_Value_SetUTF8String(args.GetReturnValue(), - szLocalDateString.AsByteStringC()); + szLocalDateString.AsStringC()); } else { FXJSE_Value_SetNull(args.GetReturnValue()); } @@ -1436,13 +1431,13 @@ void CXFA_FM2JSContext::Num2GMTime(FXJSE_HOBJECT hThis, } if (!bFlags) { CFX_ByteString szGMTTimeString; - Num2AllTime(hThis, iTime, formatString.AsByteStringC(), - localString.AsByteStringC(), TRUE, szGMTTimeString); + Num2AllTime(hThis, iTime, formatString.AsStringC(), + localString.AsStringC(), TRUE, szGMTTimeString); if (szGMTTimeString.IsEmpty()) { szGMTTimeString = ""; } FXJSE_Value_SetUTF8String(args.GetReturnValue(), - szGMTTimeString.AsByteStringC()); + szGMTTimeString.AsStringC()); } else { FXJSE_Value_SetNull(args.GetReturnValue()); } @@ -1498,13 +1493,13 @@ void CXFA_FM2JSContext::Num2Time(FXJSE_HOBJECT hThis, } if (!bFlags) { CFX_ByteString szLocalTimeString; - Num2AllTime(hThis, (int32_t)fTime, formatString.AsByteStringC(), - localString.AsByteStringC(), FALSE, szLocalTimeString); + Num2AllTime(hThis, (int32_t)fTime, formatString.AsStringC(), + localString.AsStringC(), FALSE, szLocalTimeString); if (szLocalTimeString.IsEmpty()) { szLocalTimeString = ""; } FXJSE_Value_SetUTF8String(args.GetReturnValue(), - szLocalTimeString.AsByteStringC()); + szLocalTimeString.AsStringC()); } else { FXJSE_Value_SetNull(args.GetReturnValue()); } @@ -1588,19 +1583,18 @@ void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis, pLocale = widgetData.GetLocal(); } else { pLocale = pMgr->GetLocaleByName( - CFX_WideString::FromUTF8(localString.AsByteStringC()) - .AsWideStringC()); + CFX_WideString::FromUTF8(localString.AsStringC()).AsStringC()); } CFX_WideString wsFormat; if (formatString.IsEmpty()) { pLocale->GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY_Default, wsFormat); } else { - wsFormat = CFX_WideString::FromUTF8(formatString.AsByteStringC()); + wsFormat = CFX_WideString::FromUTF8(formatString.AsStringC()); } wsFormat = FX_WSTRC(L"time{") + wsFormat; wsFormat += FX_WSTRC(L"}"); CXFA_LocaleValue timeValue( - XFA_VT_TIME, CFX_WideString::FromUTF8(timeString.AsByteStringC()), + XFA_VT_TIME, CFX_WideString::FromUTF8(timeString.AsStringC()), wsFormat, pLocale, (CXFA_LocaleMgr*)pMgr); if (timeValue.IsValid()) { CFX_Unitime uniTime = timeValue.GetTime(); @@ -1676,12 +1670,11 @@ void CXFA_FM2JSContext::TimeFmt(FXJSE_HOBJECT hThis, } if (!bFlags) { CFX_ByteString formatStr; - GetStandardTimeFormat(hThis, iStyle, szLocal.AsByteStringC(), formatStr); + GetStandardTimeFormat(hThis, iStyle, szLocal.AsStringC(), formatStr); if (formatStr.IsEmpty()) { formatStr = ""; } - FXJSE_Value_SetUTF8String(args.GetReturnValue(), - formatStr.AsByteStringC()); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), formatStr.AsStringC()); } else { FXJSE_Value_SetNull(args.GetReturnValue()); } @@ -2036,8 +2029,8 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoDate(FXJSE_HOBJECT hThis, CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { - pLocale = pMgr->GetLocaleByName( - CFX_WideString::FromUTF8(szLocale).AsWideStringC()); + pLocale = + pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale).AsStringC()); } if (!pLocale) { return FALSE; @@ -2073,8 +2066,8 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoTime(FXJSE_HOBJECT hThis, CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { - pLocale = pMgr->GetLocaleByName( - CFX_WideString::FromUTF8(szLocale).AsWideStringC()); + pLocale = + pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale).AsStringC()); } if (!pLocale) { return FALSE; @@ -2113,8 +2106,8 @@ FX_BOOL CXFA_FM2JSContext::IsoDate2Local(FXJSE_HOBJECT hThis, CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { - pLocale = pMgr->GetLocaleByName( - CFX_WideString::FromUTF8(szLocale).AsWideStringC()); + pLocale = + pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale).AsStringC()); } if (!pLocale) { return FALSE; @@ -2152,8 +2145,8 @@ FX_BOOL CXFA_FM2JSContext::IsoTime2Local(FXJSE_HOBJECT hThis, CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { - pLocale = pMgr->GetLocaleByName( - CFX_WideString::FromUTF8(szLocale).AsWideStringC()); + pLocale = + pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale).AsStringC()); } if (!pLocale) { return FALSE; @@ -2193,8 +2186,8 @@ FX_BOOL CXFA_FM2JSContext::GetGMTTime(FXJSE_HOBJECT hThis, CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { - pLocale = pMgr->GetLocaleByName( - CFX_WideString::FromUTF8(szLocale).AsWideStringC()); + pLocale = + pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale).AsStringC()); } if (!pLocale) { return FALSE; @@ -2375,8 +2368,8 @@ void CXFA_FM2JSContext::GetLocalDateFormat(FXJSE_HOBJECT hThis, CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { - pLocale = pMgr->GetLocaleByName( - CFX_WideString::FromUTF8(szLocalStr).AsWideStringC()); + pLocale = + pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocalStr).AsStringC()); } if (!pLocale) { return; @@ -2430,8 +2423,8 @@ void CXFA_FM2JSContext::GetLocalTimeFormat(FXJSE_HOBJECT hThis, CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { - pLocale = pMgr->GetLocaleByName( - CFX_WideString::FromUTF8(szLocalStr).AsWideStringC()); + pLocale = + pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocalStr).AsStringC()); } if (!pLocale) { return; @@ -2482,10 +2475,10 @@ void CXFA_FM2JSContext::Num2AllTime(FXJSE_HOBJECT hThis, CFX_ByteString strIsoTime; strIsoTime.Format("%02d:%02d:%02d", iHour, iMin, iSec); if (bGM) { - iRet = GetGMTTime(hThis, strIsoTime.AsByteStringC(), szFormat, szLocale, - strTime); + iRet = + GetGMTTime(hThis, strIsoTime.AsStringC(), szFormat, szLocale, strTime); } else { - iRet = IsoTime2Local(hThis, strIsoTime.AsByteStringC(), szFormat, szLocale, + iRet = IsoTime2Local(hThis, strIsoTime.AsStringC(), szFormat, szLocale, strTime); } if (!iRet) { @@ -3070,13 +3063,13 @@ void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis, } else { CFX_ByteString propStr; FXJSE_Value_ToUTF8String(propertyValue, propStr); - FXJSE_Value_GetObjectProp(jsobjectValue, propStr.AsByteStringC(), + FXJSE_Value_GetObjectProp(jsobjectValue, propStr.AsStringC(), newProperty); } CFX_ByteString bsChoosed; HValueToUTF8String(newProperty, bsChoosed); FXJSE_Value_SetUTF8String(args.GetReturnValue(), - bsChoosed.AsByteStringC()); + bsChoosed.AsStringC()); FXJSE_Value_Release(newProperty); FXJSE_Value_Release(jsobjectValue); FXJSE_Value_Release(propertyValue); @@ -3088,7 +3081,7 @@ void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis, CFX_ByteString bsChoosed; HValueToUTF8String(argIndexValue, bsChoosed); FXJSE_Value_SetUTF8String(args.GetReturnValue(), - bsChoosed.AsByteStringC()); + bsChoosed.AsStringC()); bFound = TRUE; } } @@ -3200,8 +3193,8 @@ void CXFA_FM2JSContext::Within(FXJSE_HOBJECT hThis, HValueToUTF8String(argHeight, heightString); FXJSE_Value_SetInteger( args.GetReturnValue(), - ((oneString.Compare(lowString.AsByteStringC()) >= 0) && - (oneString.Compare(heightString.AsByteStringC()) <= 0))); + ((oneString.Compare(lowString.AsStringC()) >= 0) && + (oneString.Compare(heightString.AsStringC()) <= 0))); } FXJSE_Value_Release(argLow); FXJSE_Value_Release(argHeight); @@ -3251,8 +3244,7 @@ void CXFA_FM2JSContext::Eval(FXJSE_HOBJECT hThis, CFX_WideString javaScript; CFX_WideString wsError; XFA_FM2JS_Translate( - CFX_WideString::FromUTF8(utf8ScriptString.AsByteStringC()) - .AsWideStringC(), + CFX_WideString::FromUTF8(utf8ScriptString.AsStringC()).AsStringC(), wsJavaScriptBuf, wsError); FXJSE_HCONTEXT hContext = FXJSE_Context_Create(hruntime); FXJSE_HVALUE returnValue = FXJSE_Value_Create(hruntime); @@ -3374,7 +3366,7 @@ void CXFA_FM2JSContext::UnitType(FXJSE_HOBJECT hThis, }; unitspanString.MakeLower(); CFX_WideString wsTypeString = - CFX_WideString::FromUTF8(unitspanString.AsByteStringC()); + CFX_WideString::FromUTF8(unitspanString.AsStringC()); const FX_WCHAR* pData = wsTypeString; int32_t u = 0; int32_t uLen = wsTypeString.GetLength(); @@ -3640,7 +3632,7 @@ void CXFA_FM2JSContext::At(FXJSE_HOBJECT hThis, } else { CFX_ByteString stringOne; HValueToUTF8String(argOne, stringOne); - FX_STRSIZE iPosition = stringOne.Find(stringTwo.AsByteStringC()); + FX_STRSIZE iPosition = stringOne.Find(stringTwo.AsStringC()); FXJSE_Value_SetInteger(args.GetReturnValue(), iPosition + 1); } } @@ -3678,7 +3670,7 @@ void CXFA_FM2JSContext::Concat(FXJSE_HOBJECT hThis, FXJSE_Value_SetNull(args.GetReturnValue()); } else { FXJSE_Value_SetUTF8String(args.GetReturnValue(), - resultString.AsByteStringC()); + resultString.AsStringC()); } } else { pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, @@ -3699,7 +3691,7 @@ void CXFA_FM2JSContext::Decode(FXJSE_HOBJECT hThis, CFX_ByteString toDecodeString; HValueToUTF8String(argOne, toDecodeString); CFX_ByteTextBuf resultBuf; - DecodeURL(toDecodeString.AsByteStringC(), resultBuf); + DecodeURL(toDecodeString.AsStringC(), resultBuf); FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultBuf.GetByteString()); } @@ -3716,11 +3708,11 @@ void CXFA_FM2JSContext::Decode(FXJSE_HOBJECT hThis, HValueToUTF8String(argTwo, identifyString); CFX_ByteTextBuf resultBuf; if (identifyString.EqualNoCase("html")) { - DecodeHTML(toDecodeString.AsByteStringC(), resultBuf); + DecodeHTML(toDecodeString.AsStringC(), resultBuf); } else if (identifyString.EqualNoCase("xml")) { - DecodeXML(toDecodeString.AsByteStringC(), resultBuf); + DecodeXML(toDecodeString.AsStringC(), resultBuf); } else { - DecodeURL(toDecodeString.AsByteStringC(), resultBuf); + DecodeURL(toDecodeString.AsStringC(), resultBuf); } FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultBuf.GetByteString()); @@ -3785,7 +3777,7 @@ void CXFA_FM2JSContext::DecodeURL(const CFX_ByteStringC& szURLString, szResultString.Clear(); szResultString << FX_UTF8Encode(wsResultBuf.GetBuffer(), wsResultBuf.GetLength()) - .AsByteStringC(); + .AsStringC(); } void CXFA_FM2JSContext::DecodeHTML(const CFX_ByteStringC& szHTMLString, CFX_ByteTextBuf& szResultString) { @@ -3859,7 +3851,7 @@ void CXFA_FM2JSContext::DecodeHTML(const CFX_ByteStringC& szHTMLString, szResultString.Clear(); szResultString << FX_UTF8Encode(wsResultBuf.GetBuffer(), wsResultBuf.GetLength()) - .AsByteStringC(); + .AsStringC(); } void CXFA_FM2JSContext::DecodeXML(const CFX_ByteStringC& szXMLString, CFX_ByteTextBuf& szResultString) { @@ -3956,7 +3948,7 @@ void CXFA_FM2JSContext::DecodeXML(const CFX_ByteStringC& szXMLString, wsXMLBuf.AppendChar(0); szResultString.Clear(); szResultString << FX_UTF8Encode(wsXMLBuf.GetBuffer(), wsXMLBuf.GetLength()) - .AsByteStringC(); + .AsStringC(); } void CXFA_FM2JSContext::Encode(FXJSE_HOBJECT hThis, const CFX_ByteStringC& szFuncName, @@ -3972,7 +3964,7 @@ void CXFA_FM2JSContext::Encode(FXJSE_HOBJECT hThis, CFX_ByteString toEncodeString; HValueToUTF8String(argOne, toEncodeString); CFX_ByteTextBuf resultBuf; - EncodeURL(toEncodeString.AsByteStringC(), resultBuf); + EncodeURL(toEncodeString.AsStringC(), resultBuf); FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultBuf.GetByteString()); } @@ -3989,11 +3981,11 @@ void CXFA_FM2JSContext::Encode(FXJSE_HOBJECT hThis, HValueToUTF8String(argTwo, identifyString); CFX_ByteTextBuf resultBuf; if (identifyString.EqualNoCase("html")) { - EncodeHTML(toEncodeString.AsByteStringC(), resultBuf); + EncodeHTML(toEncodeString.AsStringC(), resultBuf); } else if (identifyString.EqualNoCase("xml")) { - EncodeXML(toEncodeString.AsByteStringC(), resultBuf); + EncodeXML(toEncodeString.AsStringC(), resultBuf); } else { - EncodeURL(toEncodeString.AsByteStringC(), resultBuf); + EncodeURL(toEncodeString.AsStringC(), resultBuf); } FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultBuf.GetByteString()); @@ -4110,12 +4102,12 @@ void CXFA_FM2JSContext::EncodeURL(const CFX_ByteStringC& szURLString, wsResultBuf.AppendChar(0); szResultBuf.Clear(); szResultBuf << FX_UTF8Encode(wsResultBuf.GetBuffer(), wsResultBuf.GetLength()) - .AsByteStringC(); + .AsStringC(); } void CXFA_FM2JSContext::EncodeHTML(const CFX_ByteStringC& szHTMLString, CFX_ByteTextBuf& szResultBuf) { CFX_ByteString str = szHTMLString.c_str(); - CFX_WideString wsHTMLString = CFX_WideString::FromUTF8(str.AsByteStringC()); + CFX_WideString wsHTMLString = CFX_WideString::FromUTF8(str.AsStringC()); const FX_WCHAR* strCode = L"0123456789abcdef"; FX_WCHAR strEncode[9]; strEncode[0] = '&'; @@ -4164,7 +4156,7 @@ void CXFA_FM2JSContext::EncodeHTML(const CFX_ByteStringC& szHTMLString, wsResultBuf.AppendChar(0); szResultBuf.Clear(); szResultBuf << FX_UTF8Encode(wsResultBuf.GetBuffer(), wsResultBuf.GetLength()) - .AsByteStringC(); + .AsStringC(); } void CXFA_FM2JSContext::EncodeXML(const CFX_ByteStringC& szXMLString, CFX_ByteTextBuf& szResultBuf) { @@ -4245,7 +4237,7 @@ void CXFA_FM2JSContext::EncodeXML(const CFX_ByteStringC& szXMLString, wsResultBuf.AppendChar(0); szResultBuf.Clear(); szResultBuf << FX_UTF8Encode(wsResultBuf.GetBuffer(), wsResultBuf.GetLength()) - .AsByteStringC(); + .AsStringC(); } FX_BOOL CXFA_FM2JSContext::HTMLSTR2Code(const CFX_WideStringC& pData, uint32_t& iCode) { @@ -4394,10 +4386,9 @@ void CXFA_FM2JSContext::Format(FXJSE_HOBJECT hThis, IFX_Locale* pLocale = widgetData.GetLocal(); uint32_t patternType; FX_BOOL bCompelte = - XFA_PATTERN_STRING_Type(szPattern.AsByteStringC(), patternType); - CFX_WideString wsPattern = - CFX_WideString::FromUTF8(szPattern.AsByteStringC()); - CFX_WideString wsValue = CFX_WideString::FromUTF8(szValue.AsByteStringC()); + XFA_PATTERN_STRING_Type(szPattern.AsStringC(), patternType); + CFX_WideString wsPattern = CFX_WideString::FromUTF8(szPattern.AsStringC()); + CFX_WideString wsValue = CFX_WideString::FromUTF8(szValue.AsStringC()); if (!bCompelte) { switch (patternType) { case XFA_VT_DATETIME: { @@ -4451,7 +4442,7 @@ void CXFA_FM2JSContext::Format(FXJSE_HOBJECT hThis, XFA_VALUEPICTURE_Display)) { FXJSE_Value_SetUTF8String( args.GetReturnValue(), - FX_UTF8Encode(wsRet, wsRet.GetLength()).AsByteStringC()); + FX_UTF8Encode(wsRet, wsRet.GetLength()).AsStringC()); } else { FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } @@ -4484,7 +4475,7 @@ void CXFA_FM2JSContext::Left(FXJSE_HOBJECT hThis, count = 0; } FXJSE_Value_SetUTF8String(args.GetReturnValue(), - sourceString.Left(count).AsByteStringC()); + sourceString.Left(count).AsStringC()); } FXJSE_Value_Release(argOne); FXJSE_Value_Release(argTwo); @@ -4530,7 +4521,7 @@ void CXFA_FM2JSContext::Lower(FXJSE_HOBJECT hThis, HValueToUTF8String(argOne, argString); CFX_WideTextBuf lowStringBuf; CFX_WideString wsArgString = - CFX_WideString::FromUTF8(argString.AsByteStringC()); + CFX_WideString::FromUTF8(argString.AsStringC()); const FX_WCHAR* pData = wsArgString; int32_t iLen = argString.GetLength(); int32_t i = 0; @@ -4551,7 +4542,7 @@ void CXFA_FM2JSContext::Lower(FXJSE_HOBJECT hThis, FXJSE_Value_SetUTF8String( args.GetReturnValue(), FX_UTF8Encode(lowStringBuf.GetBuffer(), lowStringBuf.GetLength()) - .AsByteStringC()); + .AsStringC()); if (argc == 2) { FXJSE_Value_Release(localeValue); } @@ -4578,7 +4569,7 @@ void CXFA_FM2JSContext::Ltrim(FXJSE_HOBJECT hThis, HValueToUTF8String(argOne, sourceString); sourceString.TrimLeft(); FXJSE_Value_SetUTF8String(args.GetReturnValue(), - sourceString.AsByteStringC()); + sourceString.AsStringC()); } FXJSE_Value_Release(argOne); } else { @@ -4609,11 +4600,10 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, IFX_Locale* pLocale = widgetData.GetLocal(); uint32_t patternType; FX_BOOL bCompletePattern = - XFA_PATTERN_STRING_Type(szPattern.AsByteStringC(), patternType); + XFA_PATTERN_STRING_Type(szPattern.AsStringC(), patternType); CFX_WideString wsPattern = - CFX_WideString::FromUTF8(szPattern.AsByteStringC()); - CFX_WideString wsValue = - CFX_WideString::FromUTF8(szValue.AsByteStringC()); + CFX_WideString::FromUTF8(szPattern.AsStringC()); + CFX_WideString wsValue = CFX_WideString::FromUTF8(szValue.AsStringC()); CFX_ByteString szParsedValue; if (bCompletePattern) { CXFA_LocaleValue localeValue(patternType, wsValue, wsPattern, pLocale, @@ -4621,7 +4611,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, if (localeValue.IsValid()) { szParsedValue = FX_UTF8Encode(localeValue.GetValue()); FXJSE_Value_SetUTF8String(args.GetReturnValue(), - szParsedValue.AsByteStringC()); + szParsedValue.AsStringC()); } else { FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } @@ -4641,7 +4631,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, if (localeValue.IsValid()) { szParsedValue = FX_UTF8Encode(localeValue.GetValue()); FXJSE_Value_SetUTF8String(args.GetReturnValue(), - szParsedValue.AsByteStringC()); + szParsedValue.AsStringC()); } else { FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } @@ -4654,7 +4644,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, if (localeValue.IsValid()) { szParsedValue = FX_UTF8Encode(localeValue.GetValue()); FXJSE_Value_SetUTF8String(args.GetReturnValue(), - szParsedValue.AsByteStringC()); + szParsedValue.AsStringC()); } else { FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } @@ -4667,7 +4657,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, if (localeValue.IsValid()) { szParsedValue = FX_UTF8Encode(localeValue.GetValue()); FXJSE_Value_SetUTF8String(args.GetReturnValue(), - szParsedValue.AsByteStringC()); + szParsedValue.AsStringC()); } else { FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } @@ -4680,7 +4670,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, if (localeValue.IsValid()) { szParsedValue = FX_UTF8Encode(localeValue.GetValue()); FXJSE_Value_SetUTF8String(args.GetReturnValue(), - szParsedValue.AsByteStringC()); + szParsedValue.AsStringC()); } else { FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } @@ -4714,7 +4704,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, if (localeValue.IsValid()) { szParsedValue = FX_UTF8Encode(localeValue.GetValue()); FXJSE_Value_SetUTF8String(args.GetReturnValue(), - szParsedValue.AsByteStringC()); + szParsedValue.AsStringC()); } else { FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } @@ -4771,7 +4761,7 @@ void CXFA_FM2JSContext::Replace(FXJSE_HOBJECT hThis, } } if (iFindIndex == iFindLen) { - resultString << threeString.AsByteStringC(); + resultString << threeString.AsStringC(); u += iFindLen - 1; iFindIndex = 0; } else { @@ -4818,7 +4808,7 @@ void CXFA_FM2JSContext::Right(FXJSE_HOBJECT hThis, count = 0; } FXJSE_Value_SetUTF8String(args.GetReturnValue(), - sourceString.Right(count).AsByteStringC()); + sourceString.Right(count).AsStringC()); } FXJSE_Value_Release(argOne); FXJSE_Value_Release(argTwo); @@ -4841,7 +4831,7 @@ void CXFA_FM2JSContext::Rtrim(FXJSE_HOBJECT hThis, HValueToUTF8String(argOne, sourceString); sourceString.TrimRight(); FXJSE_Value_SetUTF8String(args.GetReturnValue(), - sourceString.AsByteStringC()); + sourceString.AsStringC()); } FXJSE_Value_Release(argOne); } else { @@ -5046,7 +5036,7 @@ void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis, resultString.AppendChar(sourceString.GetAt(i)); ++i; } - resultString << insertString.AsByteStringC(); + resultString << insertString.AsStringC(); i = iStart + iDelete; while (i < iLength) { resultString.AppendChar(sourceString.GetAt(i)); @@ -5100,9 +5090,8 @@ void CXFA_FM2JSContext::Substr(FXJSE_HOBJECT hThis, iCount = 0; } iStart -= 1; - FXJSE_Value_SetUTF8String( - args.GetReturnValue(), - szSourceStr.Mid(iStart, iCount).AsByteStringC()); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), + szSourceStr.Mid(iStart, iCount).AsStringC()); } } FXJSE_Value_Release(stringValue); @@ -5130,7 +5119,7 @@ void CXFA_FM2JSContext::Uuid(FXJSE_HOBJECT hThis, FX_GUID_CreateV4(&guid); CFX_ByteString bsUId; FX_GUID_ToString(&guid, bsUId, iNum); - FXJSE_Value_SetUTF8String(args.GetReturnValue(), bsUId.AsByteStringC()); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), bsUId.AsStringC()); if (argc == 1) { FXJSE_Value_Release(argOne); } @@ -5158,7 +5147,7 @@ void CXFA_FM2JSContext::Upper(FXJSE_HOBJECT hThis, HValueToUTF8String(argOne, argString); CFX_WideTextBuf upperStringBuf; CFX_WideString wsArgString = - CFX_WideString::FromUTF8(argString.AsByteStringC()); + CFX_WideString::FromUTF8(argString.AsStringC()); const FX_WCHAR* pData = wsArgString; int32_t iLen = wsArgString.GetLength(); int32_t i = 0; @@ -5179,7 +5168,7 @@ void CXFA_FM2JSContext::Upper(FXJSE_HOBJECT hThis, FXJSE_Value_SetUTF8String( args.GetReturnValue(), FX_UTF8Encode(upperStringBuf.GetBuffer(), upperStringBuf.GetLength()) - .AsByteStringC()); + .AsStringC()); if (argc == 2) { FXJSE_Value_Release(localeValue); } @@ -5232,7 +5221,7 @@ void CXFA_FM2JSContext::WordNum(FXJSE_HOBJECT hThis, CFX_ByteTextBuf resultBuf; CFX_ByteString numberString; numberString.Format("%.2f", fNumber); - WordUS(numberString.AsByteStringC(), iIdentifier, resultBuf); + WordUS(numberString.AsStringC(), iIdentifier, resultBuf); FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultBuf.GetByteString()); } @@ -5468,7 +5457,7 @@ void CXFA_FM2JSContext::Get(FXJSE_HOBJECT hThis, CFX_ByteString urlString; HValueToUTF8String(argOne, urlString); IFX_FileRead* pFile = pAppProvider->DownloadURL( - CFX_WideString::FromUTF8(urlString.AsByteStringC()).AsWideStringC()); + CFX_WideString::FromUTF8(urlString.AsStringC()).AsStringC()); if (pFile) { int32_t size = pFile->GetSize(); uint8_t* pData = FX_Alloc(uint8_t, size); @@ -5528,11 +5517,11 @@ void CXFA_FM2JSContext::Post(FXJSE_HOBJECT hThis, } CFX_WideString decodedResponse; FX_BOOL bFlags = pAppProvider->PostRequestURL( - CFX_WideString::FromUTF8(bsURL.AsByteStringC()).AsWideStringC(), - CFX_WideString::FromUTF8(bsData.AsByteStringC()).AsWideStringC(), - CFX_WideString::FromUTF8(bsContentType.AsByteStringC()).AsWideStringC(), - CFX_WideString::FromUTF8(bsEncode.AsByteStringC()).AsWideStringC(), - CFX_WideString::FromUTF8(bsHeader.AsByteStringC()).AsWideStringC(), + CFX_WideString::FromUTF8(bsURL.AsStringC()).AsStringC(), + CFX_WideString::FromUTF8(bsData.AsStringC()).AsStringC(), + CFX_WideString::FromUTF8(bsContentType.AsStringC()).AsStringC(), + CFX_WideString::FromUTF8(bsEncode.AsStringC()).AsStringC(), + CFX_WideString::FromUTF8(bsHeader.AsStringC()).AsStringC(), decodedResponse); FXJSE_Value_Release(argOne); FXJSE_Value_Release(argTwo); @@ -5549,7 +5538,7 @@ void CXFA_FM2JSContext::Post(FXJSE_HOBJECT hThis, FXJSE_Value_SetUTF8String( args.GetReturnValue(), FX_UTF8Encode(decodedResponse, decodedResponse.GetLength()) - .AsByteStringC()); + .AsStringC()); } else { pContext->ThrowScriptErrorMessage(XFA_IDS_SERVER_DENY); } @@ -5589,9 +5578,9 @@ void CXFA_FM2JSContext::Put(FXJSE_HOBJECT hThis, HValueToUTF8String(argThree, bsEncode); } FX_BOOL bFlags = pAppProvider->PutRequestURL( - CFX_WideString::FromUTF8(bsURL.AsByteStringC()).AsWideStringC(), - CFX_WideString::FromUTF8(bsData.AsByteStringC()).AsWideStringC(), - CFX_WideString::FromUTF8(bsEncode.AsByteStringC()).AsWideStringC()); + CFX_WideString::FromUTF8(bsURL.AsStringC()).AsStringC(), + CFX_WideString::FromUTF8(bsData.AsStringC()).AsStringC(), + CFX_WideString::FromUTF8(bsEncode.AsStringC()).AsStringC()); FXJSE_Value_Release(argOne); FXJSE_Value_Release(argTwo); if (argc > 2) { @@ -5639,7 +5628,7 @@ void CXFA_FM2JSContext::assign_value_operator(FXJSE_HOBJECT hThis, FXJSE_Value_ToUTF8String(propertyValue, propertyStr); for (int32_t i = 2; i < iLeftLength; i++) { FXJSE_Value_GetObjectPropByIdx(lValue, i, jsObjectValue); - FXJSE_Value_SetObjectProp(jsObjectValue, propertyStr.AsByteStringC(), + FXJSE_Value_SetObjectProp(jsObjectValue, propertyStr.AsStringC(), rValue); } } @@ -5825,7 +5814,7 @@ void CXFA_FM2JSContext::less_operator(FXJSE_HOBJECT hThis, FXJSE_Value_ToUTF8String(argSecond, secondOutput); FXJSE_Value_SetInteger( args.GetReturnValue(), - firstOutput.Compare(secondOutput.AsByteStringC()) == -1); + firstOutput.Compare(secondOutput.AsStringC()) == -1); } else { FX_DOUBLE first = HValueToDouble(hThis, argFirst); FX_DOUBLE second = HValueToDouble(hThis, argSecond); @@ -5858,7 +5847,7 @@ void CXFA_FM2JSContext::lessequal_operator(FXJSE_HOBJECT hThis, FXJSE_Value_ToUTF8String(argSecond, secondOutput); FXJSE_Value_SetInteger( args.GetReturnValue(), - firstOutput.Compare(secondOutput.AsByteStringC()) != 1); + firstOutput.Compare(secondOutput.AsStringC()) != 1); } else { FX_DOUBLE first = HValueToDouble(hThis, argFirst); FX_DOUBLE second = HValueToDouble(hThis, argSecond); @@ -5888,7 +5877,7 @@ void CXFA_FM2JSContext::greater_operator(FXJSE_HOBJECT hThis, FXJSE_Value_ToUTF8String(argSecond, secondOutput); FXJSE_Value_SetInteger( args.GetReturnValue(), - firstOutput.Compare(secondOutput.AsByteStringC()) == 1); + firstOutput.Compare(secondOutput.AsStringC()) == 1); } else { FX_DOUBLE first = HValueToDouble(hThis, argFirst); FX_DOUBLE second = HValueToDouble(hThis, argSecond); @@ -5921,7 +5910,7 @@ void CXFA_FM2JSContext::greaterequal_operator(FXJSE_HOBJECT hThis, FXJSE_Value_ToUTF8String(argSecond, secondOutput); FXJSE_Value_SetInteger( args.GetReturnValue(), - firstOutput.Compare(secondOutput.AsByteStringC()) != -1); + firstOutput.Compare(secondOutput.AsStringC()) != -1); } else { FX_DOUBLE first = HValueToDouble(hThis, argFirst); FX_DOUBLE second = HValueToDouble(hThis, argSecond); @@ -6101,8 +6090,8 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, iIndexValue = HValueToInteger(hThis, argIndex); } CFX_ByteString szSomExp; - GenerateSomExpression(szName.AsByteStringC(), iIndexFlags, iIndexValue, - bIsStar, szSomExp); + GenerateSomExpression(szName.AsStringC(), iIndexFlags, iIndexValue, bIsStar, + szSomExp); if (FXJSE_Value_IsArray(argAccessor)) { FXJSE_HVALUE hLengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argAccessor, "length", hLengthValue); @@ -6119,9 +6108,8 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, for (int32_t i = 2; i < iLength; i++) { FXJSE_Value_GetObjectPropByIdx(argAccessor, i, hJSObjValue); XFA_RESOLVENODE_RS resoveNodeRS; - int32_t iRet = - ResolveObjects(hThis, hJSObjValue, szSomExp.AsByteStringC(), - resoveNodeRS, TRUE, szName.IsEmpty()); + int32_t iRet = ResolveObjects(hThis, hJSObjValue, szSomExp.AsStringC(), + resoveNodeRS, TRUE, szName.IsEmpty()); if (iRet > 0) { ParseResolveResult(hThis, resoveNodeRS, hJSObjValue, hResolveValues[i - 2], iSizes[i - 2], bAttribute); @@ -6136,7 +6124,7 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, } FXJSE_Value_SetInteger(rgValues[0], 1); if (bAttribute) { - FXJSE_Value_SetUTF8String(rgValues[1], szName.AsByteStringC()); + FXJSE_Value_SetUTF8String(rgValues[1], szName.AsStringC()); } else { FXJSE_Value_SetNull(rgValues[1]); } @@ -6154,9 +6142,9 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_Free(rgValues); } else { CFX_WideString wsPropertyName = - CFX_WideString::FromUTF8(szName.AsByteStringC()); + CFX_WideString::FromUTF8(szName.AsStringC()); CFX_WideString wsSomExpression = - CFX_WideString::FromUTF8(szSomExp.AsByteStringC()); + CFX_WideString::FromUTF8(szSomExp.AsStringC()); pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT, (const FX_WCHAR*)wsPropertyName, (const FX_WCHAR*)wsSomExpression); @@ -6176,14 +6164,14 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, int32_t iRet = 0; if (FXJSE_Value_IsObject(argAccessor) || (FXJSE_Value_IsNull(argAccessor) && bsAccessorName.IsEmpty())) { - iRet = ResolveObjects(hThis, argAccessor, szSomExp.AsByteStringC(), + iRet = ResolveObjects(hThis, argAccessor, szSomExp.AsStringC(), resoveNodeRS, TRUE, szName.IsEmpty()); } else if (!FXJSE_Value_IsObject(argAccessor) && !bsAccessorName.IsEmpty()) { FX_BOOL bGetObject = - GetObjectByName(hThis, argAccessor, bsAccessorName.AsByteStringC()); + GetObjectByName(hThis, argAccessor, bsAccessorName.AsStringC()); if (bGetObject) { - iRet = ResolveObjects(hThis, argAccessor, szSomExp.AsByteStringC(), + iRet = ResolveObjects(hThis, argAccessor, szSomExp.AsStringC(), resoveNodeRS, TRUE, szName.IsEmpty()); } } @@ -6199,7 +6187,7 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, } FXJSE_Value_SetInteger(rgValues[0], 1); if (bAttribute) { - FXJSE_Value_SetUTF8String(rgValues[1], szName.AsByteStringC()); + FXJSE_Value_SetUTF8String(rgValues[1], szName.AsStringC()); } else { FXJSE_Value_SetNull(rgValues[1]); } @@ -6217,9 +6205,9 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_Free(hResolveValues); } else { CFX_WideString wsPropertyName = - CFX_WideString::FromUTF8(szName.AsByteStringC()); + CFX_WideString::FromUTF8(szName.AsStringC()); CFX_WideString wsSomExpression = - CFX_WideString::FromUTF8(szSomExp.AsByteStringC()); + CFX_WideString::FromUTF8(szSomExp.AsStringC()); pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT, (const FX_WCHAR*)wsPropertyName, (const FX_WCHAR*)wsSomExpression); @@ -6254,8 +6242,8 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, iIndexValue = HValueToInteger(hThis, argIndex); } CFX_ByteString szSomExp; - GenerateSomExpression(szName.AsByteStringC(), iIndexFlags, iIndexValue, - bIsStar, szSomExp); + GenerateSomExpression(szName.AsStringC(), iIndexFlags, iIndexValue, bIsStar, + szSomExp); if (FXJSE_Value_IsArray(argAccessor)) { FXJSE_HVALUE hLengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argAccessor, "length", hLengthValue); @@ -6268,8 +6256,8 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, for (int32_t i = 2; i < iLength; i++) { FXJSE_Value_GetObjectPropByIdx(argAccessor, i, hJSObjValue); XFA_RESOLVENODE_RS resoveNodeRS; - int32_t iRet = ResolveObjects( - hThis, hJSObjValue, szSomExp.AsByteStringC(), resoveNodeRS, FALSE); + int32_t iRet = ResolveObjects(hThis, hJSObjValue, szSomExp.AsStringC(), + resoveNodeRS, FALSE); if (iRet > 0) { ParseResolveResult(hThis, resoveNodeRS, hJSObjValue, hResolveValues[i - 2], iSizes[i - 2], bAttribute); @@ -6284,7 +6272,7 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, } FXJSE_Value_SetInteger(rgValues[0], 1); if (bAttribute) { - FXJSE_Value_SetUTF8String(rgValues[1], szName.AsByteStringC()); + FXJSE_Value_SetUTF8String(rgValues[1], szName.AsStringC()); } else { FXJSE_Value_SetNull(rgValues[1]); } @@ -6302,9 +6290,9 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_Free(rgValues); } else { CFX_WideString wsPropertyName = - CFX_WideString::FromUTF8(szName.AsByteStringC()); + CFX_WideString::FromUTF8(szName.AsStringC()); CFX_WideString wsSomExpression = - CFX_WideString::FromUTF8(szSomExp.AsByteStringC()); + CFX_WideString::FromUTF8(szSomExp.AsStringC()); pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT, (const FX_WCHAR*)wsPropertyName, (const FX_WCHAR*)wsSomExpression); @@ -6323,14 +6311,14 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, int32_t iRet = 0; if (FXJSE_Value_IsObject(argAccessor) || (FXJSE_Value_IsNull(argAccessor) && bsAccessorName.IsEmpty())) { - iRet = ResolveObjects(hThis, argAccessor, szSomExp.AsByteStringC(), + iRet = ResolveObjects(hThis, argAccessor, szSomExp.AsStringC(), resoveNodeRS, FALSE); } else if (!FXJSE_Value_IsObject(argAccessor) && !bsAccessorName.IsEmpty()) { FX_BOOL bGetObject = - GetObjectByName(hThis, argAccessor, bsAccessorName.AsByteStringC()); + GetObjectByName(hThis, argAccessor, bsAccessorName.AsStringC()); if (bGetObject) { - iRet = ResolveObjects(hThis, argAccessor, szSomExp.AsByteStringC(), + iRet = ResolveObjects(hThis, argAccessor, szSomExp.AsStringC(), resoveNodeRS, FALSE); } } @@ -6346,7 +6334,7 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, } FXJSE_Value_SetInteger(rgValues[0], 1); if (bAttribute) { - FXJSE_Value_SetUTF8String(rgValues[1], szName.AsByteStringC()); + FXJSE_Value_SetUTF8String(rgValues[1], szName.AsStringC()); } else { FXJSE_Value_SetNull(rgValues[1]); } @@ -6364,9 +6352,9 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_Free(hResolveValues); } else { CFX_WideString wsPropertyName = - CFX_WideString::FromUTF8(szName.AsByteStringC()); + CFX_WideString::FromUTF8(szName.AsStringC()); CFX_WideString wsSomExpression = - CFX_WideString::FromUTF8(szSomExp.AsByteStringC()); + CFX_WideString::FromUTF8(szSomExp.AsStringC()); pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT, (const FX_WCHAR*)wsPropertyName, (const FX_WCHAR*)wsSomExpression); @@ -6394,16 +6382,15 @@ void CXFA_FM2JSContext::eval_translation(FXJSE_HOBJECT hThis, pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH); } else { CFX_WideString scriptString = - CFX_WideString::FromUTF8(argString.AsByteStringC()); + CFX_WideString::FromUTF8(argString.AsStringC()); CFX_WideTextBuf wsJavaScriptBuf; CFX_WideString wsError; - XFA_FM2JS_Translate(scriptString.AsWideStringC(), wsJavaScriptBuf, - wsError); + XFA_FM2JS_Translate(scriptString.AsStringC(), wsJavaScriptBuf, wsError); if (wsError.IsEmpty()) { CFX_WideString javaScript = wsJavaScriptBuf.GetWideString(); FXJSE_Value_SetUTF8String( args.GetReturnValue(), - FX_UTF8Encode(javaScript, javaScript.GetLength()).AsByteStringC()); + FX_UTF8Encode(javaScript, javaScript.GetLength()).AsStringC()); } else { pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); } @@ -6458,7 +6445,7 @@ void CXFA_FM2JSContext::get_fm_value(FXJSE_HOBJECT hThis, } else { CFX_ByteString propertyStr; FXJSE_Value_ToUTF8String(propertyValue, propertyStr); - FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsByteStringC(), + FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsStringC(), args.GetReturnValue()); } FXJSE_Value_Release(propertyValue); @@ -6627,7 +6614,7 @@ FXJSE_HVALUE CXFA_FM2JSContext::GetSimpleHValue(FXJSE_HOBJECT hThis, } else { CFX_ByteString propertyStr; FXJSE_Value_ToUTF8String(propertyValue, propertyStr); - FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsByteStringC(), + FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsStringC(), simpleValue); } FXJSE_Value_Release(propertyValue); @@ -6671,7 +6658,7 @@ FX_BOOL CXFA_FM2JSContext::HValueIsNull(FXJSE_HOBJECT hThis, FXJSE_HVALUE arg) { CFX_ByteString propertyStr; FXJSE_Value_ToUTF8String(propertyValue, propertyStr); FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsByteStringC(), + FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(), newPropertyValue); if (FXJSE_Value_IsNull(newPropertyValue)) { isNull = TRUE; @@ -6778,8 +6765,7 @@ void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis, FXJSE_Value_ToUTF8String(propertyValue, propertyString); for (int32_t j = 2; j < iLength; j++) { FXJSE_Value_GetObjectPropByIdx(argsValue[i], j, jsObjectValue); - FXJSE_Value_GetObjectProp(jsObjectValue, - propertyString.AsByteStringC(), + FXJSE_Value_GetObjectProp(jsObjectValue, propertyString.AsStringC(), resultValues[index]); index++; } @@ -6866,7 +6852,7 @@ FX_BOOL CXFA_FM2JSContext::GetObjectByName( XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent; int32_t iRet = pScriptContext->ResolveObjects( pScriptContext->GetThisObject(), - CFX_WideString::FromUTF8(szAccessorName).AsWideStringC(), resoveNodeRS, + CFX_WideString::FromUTF8(szAccessorName).AsStringC(), resoveNodeRS, dwFlags); if (iRet >= 1 && resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) { FXJSE_Value_Set(accessorValue, pScriptContext->GetJSValueFromMap( @@ -6922,7 +6908,7 @@ int32_t CXFA_FM2JSContext::ResolveObjects(FXJSE_HOBJECT hThis, pNode = (CXFA_Object*)FXJSE_Value_ToObject(hRefValue, NULL); dFlags = XFA_RESOLVENODE_AnyChild; } - iRet = pScriptContext->ResolveObjects(pNode, wsSomExpression.AsWideStringC(), + iRet = pScriptContext->ResolveObjects(pNode, wsSomExpression.AsStringC(), resoveNodeRS, dFlags); return iRet; } @@ -6987,7 +6973,7 @@ int32_t CXFA_FM2JSContext::HValueToInteger(FXJSE_HOBJECT hThis, } else { CFX_ByteString propertyStr; FXJSE_Value_ToUTF8String(propertyValue, propertyStr); - FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsByteStringC(), + FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsStringC(), newProperty); } iValue = HValueToInteger(hThis, newProperty); @@ -7031,7 +7017,7 @@ FX_FLOAT CXFA_FM2JSContext::HValueToFloat(FXJSE_HOBJECT hThis, } else { CFX_ByteString propertyStr; FXJSE_Value_ToUTF8String(propertyValue, propertyStr); - FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsByteStringC(), + FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsStringC(), newProperty); } fRet = HValueToFloat(hThis, newProperty); @@ -7046,7 +7032,7 @@ FX_FLOAT CXFA_FM2JSContext::HValueToFloat(FXJSE_HOBJECT hThis, } else if (FXJSE_Value_IsUTF8String(arg)) { CFX_ByteString bsOutput; FXJSE_Value_ToUTF8String(arg, bsOutput); - fRet = (FX_FLOAT)StringToDouble(bsOutput.AsByteStringC()); + fRet = (FX_FLOAT)StringToDouble(bsOutput.AsStringC()); } else if (FXJSE_Value_IsUndefined(arg)) { fRet = 0; } else { @@ -7071,7 +7057,7 @@ FX_DOUBLE CXFA_FM2JSContext::HValueToDouble(FXJSE_HOBJECT hThis, } else { CFX_ByteString propertyStr; FXJSE_Value_ToUTF8String(propertyValue, propertyStr); - FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsByteStringC(), + FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsStringC(), newProperty); } dRet = HValueToDouble(hThis, newProperty); @@ -7086,7 +7072,7 @@ FX_DOUBLE CXFA_FM2JSContext::HValueToDouble(FXJSE_HOBJECT hThis, } else if (FXJSE_Value_IsUTF8String(arg)) { CFX_ByteString bsOutput; FXJSE_Value_ToUTF8String(arg, bsOutput); - dRet = StringToDouble(bsOutput.AsByteStringC()); + dRet = StringToDouble(bsOutput.AsStringC()); } else if (FXJSE_Value_IsUndefined(arg)) { dRet = 0; } else { @@ -7247,5 +7233,5 @@ void CXFA_FM2JSContext::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()); } 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); |