summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-04 16:41:35 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-04 16:41:35 -0700
commit28f97ff783c16f3391384ce97b765ce4eb310ac7 (patch)
tree69c4c8bc9dd39d5336c96f28b633d197dd207c81 /xfa
parented9c4386713084f37548b46ab36f618021f716f5 (diff)
downloadpdfium-28f97ff783c16f3391384ce97b765ce4eb310ac7.tar.xz
Make down-conversion explicit from CFX_ByteString to CFX_ByteStringC.
Having this happen implicitly can be dangerous because the lifetime has to be considered; we should have caught the "red bots" in https://codereview.chromium.org/1847333004/#ps60001 at compile time. Review URL: https://codereview.chromium.org/1853233002
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fee/fde_txtedtengine.cpp6
-rw-r--r--xfa/fgas/localization/fgas_locale.cpp29
-rw-r--r--xfa/fwl/basewidget/fwl_editimp.cpp4
-rw-r--r--xfa/fxbarcode/oned/BC_OnedCodaBarReader.cpp3
-rw-r--r--xfa/fxfa/app/xfa_checksum.cpp2
-rw-r--r--xfa/fxfa/app/xfa_fftextedit.cpp6
-rw-r--r--xfa/fxfa/app/xfa_fontmgr.cpp3
-rw-r--r--xfa/fxfa/fm2js/xfa_fm2jscontext.cpp316
-rw-r--r--xfa/fxfa/parser/xfa_locale.cpp11
-rw-r--r--xfa/fxfa/parser/xfa_object_imp.cpp92
-rw-r--r--xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp2
-rw-r--r--xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp28
12 files changed, 290 insertions, 212 deletions
diff --git a/xfa/fee/fde_txtedtengine.cpp b/xfa/fee/fde_txtedtengine.cpp
index d397afd7e3..19b5b24311 100644
--- a/xfa/fee/fde_txtedtengine.cpp
+++ b/xfa/fee/fde_txtedtengine.cpp
@@ -391,7 +391,7 @@ int32_t CFDE_TxtEdtEngine::Insert(int32_t nStart,
new CFDE_TxtEdtDoRecord_Insert(this, m_nCaret, lpBuffer, nLength);
CFX_ByteString bsDoRecord;
pRecord->Serialize(bsDoRecord);
- m_Param.pEventSink->On_AddDoRecord(this, bsDoRecord);
+ m_Param.pEventSink->On_AddDoRecord(this, bsDoRecord.AsByteStringC());
pRecord->Release();
}
GetText(m_ChangeInfo.wsPrevText, 0);
@@ -454,7 +454,7 @@ int32_t CFDE_TxtEdtEngine::Delete(int32_t nStart, FX_BOOL bBackspace) {
new CFDE_TxtEdtDoRecord_DeleteRange(this, nStart, m_nCaret, wsRange);
CFX_ByteString bsDoRecord;
pRecord->Serialize(bsDoRecord);
- m_Param.pEventSink->On_AddDoRecord(this, bsDoRecord);
+ m_Param.pEventSink->On_AddDoRecord(this, bsDoRecord.AsByteStringC());
pRecord->Release();
}
m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Delete;
@@ -944,7 +944,7 @@ void CFDE_TxtEdtEngine::DeleteRange_DoRecord(int32_t nStart,
this, nStart, m_nCaret, wsRange, bSel);
CFX_ByteString bsDoRecord;
pRecord->Serialize(bsDoRecord);
- m_Param.pEventSink->On_AddDoRecord(this, bsDoRecord);
+ m_Param.pEventSink->On_AddDoRecord(this, bsDoRecord.AsByteStringC());
pRecord->Release();
}
m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Delete;
diff --git a/xfa/fgas/localization/fgas_locale.cpp b/xfa/fgas/localization/fgas_locale.cpp
index 2d72454038..8cf80ce4f1 100644
--- a/xfa/fgas/localization/fgas_locale.cpp
+++ b/xfa/fgas/localization/fgas_locale.cpp
@@ -111,12 +111,12 @@ void CFX_Locale::GetNumbericSymbol(FX_LOCALENUMSYMBOL eType,
CFX_ByteString bsSpace;
CFX_WideString wsName = gs_LocalNumberSymbols[eType];
CXML_Element* pNumberSymbols =
- m_pElement->GetElement(bsSpace, "numberSymbols");
+ m_pElement->GetElement(bsSpace.AsByteStringC(), "numberSymbols");
if (!pNumberSymbols) {
return;
}
- wsNumSymbol =
- FX_GetXMLContent(bsSpace, pNumberSymbols, "numberSymbol", wsName);
+ wsNumSymbol = FX_GetXMLContent(bsSpace.AsByteStringC(), pNumberSymbols,
+ "numberSymbol", wsName);
}
void CFX_Locale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const {
if (!m_pElement) {
@@ -124,7 +124,7 @@ void CFX_Locale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const {
}
CFX_ByteString bsSpace;
CXML_Element* pNumberSymbols =
- m_pElement->GetElement(bsSpace, "dateTimeSymbols");
+ m_pElement->GetElement(bsSpace.AsByteStringC(), "dateTimeSymbols");
if (!pNumberSymbols) {
return;
}
@@ -137,20 +137,23 @@ static void FX_GetCalendarSymbol(CXML_Element* pXmlElement,
CFX_WideString& wsName) {
CFX_ByteString bsSpace;
CFX_ByteString pstrSymbolNames = symbol_type + "Names";
- CXML_Element* pChild = pXmlElement->GetElement(bsSpace, "calendarSymbols");
+ CXML_Element* pChild =
+ pXmlElement->GetElement(bsSpace.AsByteStringC(), "calendarSymbols");
if (!pChild) {
return;
}
- CXML_Element* pSymbolNames = pChild->GetElement(bsSpace, pstrSymbolNames);
+ CXML_Element* pSymbolNames = pChild->GetElement(
+ bsSpace.AsByteStringC(), pstrSymbolNames.AsByteStringC());
if (!pSymbolNames) {
return;
}
if (pSymbolNames->GetAttrInteger("abbr") != bAbbr) {
- pSymbolNames = pChild->GetElement(bsSpace, pstrSymbolNames, 1);
+ pSymbolNames = pChild->GetElement(bsSpace.AsByteStringC(),
+ pstrSymbolNames.AsByteStringC(), 1);
}
if (pSymbolNames && pSymbolNames->GetAttrInteger("abbr") == bAbbr) {
- CXML_Element* pSymbolName =
- pSymbolNames->GetElement(bsSpace, symbol_type, index);
+ CXML_Element* pSymbolName = pSymbolNames->GetElement(
+ bsSpace.AsByteStringC(), symbol_type.AsByteStringC(), index);
if (pSymbolName) {
wsName = pSymbolName->GetContent(0);
}
@@ -228,13 +231,13 @@ static void FX_GetPattern(CXML_Element* pXmlElement,
const CFX_WideString& wsSubCategory,
CFX_WideString& wsPattern) {
CFX_ByteString bsSpace;
- CXML_Element* pDatePatterns =
- pXmlElement->GetElement(bsSpace, bsCategory + "s");
+ CXML_Element* pDatePatterns = pXmlElement->GetElement(
+ bsSpace.AsByteStringC(), (bsCategory + "s").AsByteStringC());
if (!pDatePatterns) {
return;
}
- wsPattern =
- FX_GetXMLContent(bsSpace, pDatePatterns, bsCategory, wsSubCategory);
+ wsPattern = FX_GetXMLContent(bsSpace.AsByteStringC(), pDatePatterns,
+ bsCategory.AsByteStringC(), wsSubCategory);
}
static void FX_GetDateTimePattern(CXML_Element* pXmlElement,
const CFX_ByteString& bsCategory,
diff --git a/xfa/fwl/basewidget/fwl_editimp.cpp b/xfa/fwl/basewidget/fwl_editimp.cpp
index d5aa2c0507..008936c90e 100644
--- a/xfa/fwl/basewidget/fwl_editimp.cpp
+++ b/xfa/fwl/basewidget/fwl_editimp.cpp
@@ -734,14 +734,14 @@ FX_BOOL CFWL_EditImp::Undo() {
return FALSE;
}
CFX_ByteString bsRecord = m_RecordArr[m_iCurRecord--];
- return Undo(bsRecord);
+ return Undo(bsRecord.AsByteStringC());
}
FX_BOOL CFWL_EditImp::Redo() {
if (!CanRedo()) {
return FALSE;
}
CFX_ByteString bsRecord = m_RecordArr[++m_iCurRecord];
- return Redo(bsRecord);
+ return Redo(bsRecord.AsByteStringC());
}
FX_BOOL CFWL_EditImp::CanUndo() {
return m_iCurRecord >= 0;
diff --git a/xfa/fxbarcode/oned/BC_OnedCodaBarReader.cpp b/xfa/fxbarcode/oned/BC_OnedCodaBarReader.cpp
index 5f8a0c25aa..f767ffa169 100644
--- a/xfa/fxbarcode/oned/BC_OnedCodaBarReader.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedCodaBarReader.cpp
@@ -106,7 +106,8 @@ CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(int32_t rowNumber,
}
}
if (result.GetLength() < 5) {
- int32_t index = temp.Find(result.Mid(1, result.GetLength() - 1));
+ int32_t index =
+ temp.Find(result.Mid(1, result.GetLength() - 1).AsByteStringC());
if (index == len - (result.GetLength() - 1)) {
e = BCExceptionNotFound;
return "";
diff --git a/xfa/fxfa/app/xfa_checksum.cpp b/xfa/fxfa/app/xfa_checksum.cpp
index aac5456b63..c76ec505e9 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 << ">";
+ textBuf << "></" << pSAXContext->m_bsTagName.AsByteStringC() << ">";
}
UpdateChecksum(FALSE);
}
diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp
index 085ec07d9f..fa530169e0 100644
--- a/xfa/fxfa/app/xfa_fftextedit.cpp
+++ b/xfa/fxfa/app/xfa_fftextedit.cpp
@@ -420,13 +420,13 @@ 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);
+ event->bCheckWord = CheckWord(event->bsWord.AsByteStringC());
break;
}
case FWL_EVTHASH_EDT_GetSuggestWords: {
CFWL_EvtEdtGetSuggestWords* event = (CFWL_EvtEdtGetSuggestWords*)pEvent;
- event->bSuggestWords =
- GetSuggestWords(event->bsWord, event->bsArraySuggestWords);
+ event->bSuggestWords = GetSuggestWords(event->bsWord.AsByteStringC(),
+ event->bsArraySuggestWords);
break;
}
default: {}
diff --git a/xfa/fxfa/app/xfa_fontmgr.cpp b/xfa/fxfa/app/xfa_fontmgr.cpp
index e915dcbaf7..b9cfd6fb28 100644
--- a/xfa/fxfa/app/xfa_fontmgr.cpp
+++ b/xfa/fxfa/app/xfa_fontmgr.cpp
@@ -1861,7 +1861,8 @@ 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, bBold, bItalic, key, bStrictMatch)) {
+ if (!PsNameMatchDRFontName(strPsName.AsByteStringC(), bBold, bItalic, key,
+ bStrictMatch)) {
continue;
}
CPDF_Object* pDirect = pObj->GetDirect();
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
index 73eaed6f5b..97eadbd3d5 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,
- newPropertyValue);
+ FXJSE_Value_GetObjectProp(
+ jsObjectValue, propertyStr.AsByteStringC(), 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,
- newPropertyValue);
+ FXJSE_Value_GetObjectProp(
+ jsObjectValue, propertyStr.AsByteStringC(), 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,
- newPropertyValue);
+ FXJSE_Value_GetObjectProp(
+ jsObjectValue, propertyStr.AsByteStringC(), 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,
- newPropertyValue);
+ FXJSE_Value_GetObjectProp(
+ jsObjectValue, propertyStr.AsByteStringC(), 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,
- newPropertyValue);
+ FXJSE_Value_GetObjectProp(
+ jsObjectValue, propertyStr.AsByteStringC(), 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,
- newPropertyValue);
+ FXJSE_Value_GetObjectProp(
+ jsObjectValue, propertyStr.AsByteStringC(), 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,
+ FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsByteStringC(),
newPropertyValue);
dValue = HValueToDouble(hThis, newPropertyValue);
FXJSE_Value_Release(newPropertyValue);
@@ -773,7 +773,8 @@ 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());
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ wsValue.UTF8Encode().AsByteStringC());
}
FXJSE_Value_Release(argOne);
} else if (argc == 2) {
@@ -794,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,
+ FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsByteStringC(),
newPropertyValue);
dValue = HValueToDouble(hThis, newPropertyValue);
FXJSE_Value_Release(newPropertyValue);
@@ -816,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,
+ FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsByteStringC(),
newPropertyValue);
dPrecision = HValueToDouble(hThis, newPropertyValue);
FXJSE_Value_Release(newPropertyValue);
@@ -835,7 +836,8 @@ 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());
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ wsValue.UTF8Encode().AsByteStringC());
}
FXJSE_Value_Release(argOne);
FXJSE_Value_Release(argTwo);
@@ -884,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,
- newPropertyValue);
+ FXJSE_Value_GetObjectProp(
+ jsObjectValue, propertyStr.AsByteStringC(), newPropertyValue);
if (!FXJSE_Value_IsNull(newPropertyValue)) {
dSum += HValueToDouble(hThis, newPropertyValue);
uCount++;
@@ -935,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);
+ int32_t dDays = DateString2Num(bufferCurrent.AsByteStringC());
FXJSE_Value_SetInteger(args.GetReturnValue(), dDays);
} else {
CXFA_FM2JSContext* pContext =
@@ -979,11 +981,12 @@ void CXFA_FM2JSContext::Date2Num(FXJSE_HOBJECT hThis,
}
if (!bFlags) {
CFX_ByteString szIsoDateString;
- FX_BOOL bRet = Local2IsoDate(hThis, dateString, formatString, localString,
- szIsoDateString);
+ FX_BOOL bRet = Local2IsoDate(
+ hThis, dateString.AsByteStringC(), formatString.AsByteStringC(),
+ localString.AsByteStringC(), szIsoDateString);
if (bRet) {
FXJSE_Value_SetInteger(args.GetReturnValue(),
- DateString2Num(szIsoDateString));
+ DateString2Num(szIsoDateString.AsByteStringC()));
} else {
FXJSE_Value_SetInteger(args.GetReturnValue(), 0);
}
@@ -1034,11 +1037,12 @@ void CXFA_FM2JSContext::DateFmt(FXJSE_HOBJECT hThis,
}
if (!bFlags) {
CFX_ByteString formatStr;
- GetStandardDateFormat(hThis, iStyle, szLocal, formatStr);
+ GetStandardDateFormat(hThis, iStyle, szLocal.AsByteStringC(), formatStr);
if (formatStr.IsEmpty()) {
formatStr = "";
}
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), formatStr);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ formatStr.AsByteStringC());
} else {
FXJSE_Value_SetNull(args.GetReturnValue());
}
@@ -1065,7 +1069,7 @@ void CXFA_FM2JSContext::IsoDate2Num(FXJSE_HOBJECT hThis,
} else {
CFX_ByteString szArgString;
HValueToUTF8String(argOne, szArgString);
- int32_t dDays = DateString2Num(szArgString);
+ int32_t dDays = DateString2Num(szArgString.AsByteStringC());
FXJSE_Value_SetInteger(args.GetReturnValue(), (int32_t)dDays);
}
FXJSE_Value_Release(argOne);
@@ -1164,11 +1168,13 @@ void CXFA_FM2JSContext::LocalDateFmt(FXJSE_HOBJECT hThis,
}
if (!bFlags) {
CFX_ByteString formatStr;
- GetLocalDateFormat(hThis, iStyle, szLocal, formatStr, FALSE);
+ GetLocalDateFormat(hThis, iStyle, szLocal.AsByteStringC(), formatStr,
+ FALSE);
if (formatStr.IsEmpty()) {
formatStr = "";
}
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), formatStr);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ formatStr.AsByteStringC());
} else {
FXJSE_Value_SetNull(args.GetReturnValue());
}
@@ -1215,11 +1221,13 @@ void CXFA_FM2JSContext::LocalTimeFmt(FXJSE_HOBJECT hThis,
}
if (!bFlags) {
CFX_ByteString formatStr;
- GetLocalTimeFormat(hThis, iStyle, szLocal, formatStr, FALSE);
+ GetLocalTimeFormat(hThis, iStyle, szLocal.AsByteStringC(), formatStr,
+ FALSE);
if (formatStr.IsEmpty()) {
formatStr = "";
}
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), formatStr);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ formatStr.AsByteStringC());
} else {
FXJSE_Value_SetNull(args.GetReturnValue());
}
@@ -1366,12 +1374,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, formatString, localString,
+ IsoDate2Local(hThis, szIsoDateString.AsByteStringC(),
+ formatString.AsByteStringC(), localString.AsByteStringC(),
szLocalDateString);
if (szLocalDateString.IsEmpty()) {
szLocalDateString = "";
}
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), szLocalDateString);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ szLocalDateString.AsByteStringC());
} else {
FXJSE_Value_SetNull(args.GetReturnValue());
}
@@ -1427,12 +1437,13 @@ void CXFA_FM2JSContext::Num2GMTime(FXJSE_HOBJECT hThis,
}
if (!bFlags) {
CFX_ByteString szGMTTimeString;
- Num2AllTime(hThis, iTime, formatString, localString, TRUE,
- szGMTTimeString);
+ Num2AllTime(hThis, iTime, formatString.AsByteStringC(),
+ localString.AsByteStringC(), TRUE, szGMTTimeString);
if (szGMTTimeString.IsEmpty()) {
szGMTTimeString = "";
}
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), szGMTTimeString);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ szGMTTimeString.AsByteStringC());
} else {
FXJSE_Value_SetNull(args.GetReturnValue());
}
@@ -1488,12 +1499,13 @@ void CXFA_FM2JSContext::Num2Time(FXJSE_HOBJECT hThis,
}
if (!bFlags) {
CFX_ByteString szLocalTimeString;
- Num2AllTime(hThis, (int32_t)fTime, formatString, localString, FALSE,
- szLocalTimeString);
+ Num2AllTime(hThis, (int32_t)fTime, formatString.AsByteStringC(),
+ localString.AsByteStringC(), FALSE, szLocalTimeString);
if (szLocalTimeString.IsEmpty()) {
szLocalTimeString = "";
}
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), szLocalTimeString);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ szLocalTimeString.AsByteStringC());
} else {
FXJSE_Value_SetNull(args.GetReturnValue());
}
@@ -1666,11 +1678,12 @@ void CXFA_FM2JSContext::TimeFmt(FXJSE_HOBJECT hThis,
}
if (!bFlags) {
CFX_ByteString formatStr;
- GetStandardTimeFormat(hThis, iStyle, szLocal, formatStr);
+ GetStandardTimeFormat(hThis, iStyle, szLocal.AsByteStringC(), formatStr);
if (formatStr.IsEmpty()) {
formatStr = "";
}
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), formatStr);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ formatStr.AsByteStringC());
} else {
FXJSE_Value_SetNull(args.GetReturnValue());
}
@@ -2486,9 +2499,11 @@ void CXFA_FM2JSContext::Num2AllTime(FXJSE_HOBJECT hThis,
CFX_ByteString strIsoTime;
strIsoTime.Format("%02d:%02d:%02d", iHour, iMin, iSec);
if (bGM) {
- iRet = GetGMTTime(hThis, strIsoTime, szFormat, szLocale, strTime);
+ iRet = GetGMTTime(hThis, strIsoTime.AsByteStringC(), szFormat, szLocale,
+ strTime);
} else {
- iRet = IsoTime2Local(hThis, strIsoTime, szFormat, szLocale, strTime);
+ iRet = IsoTime2Local(hThis, strIsoTime.AsByteStringC(), szFormat, szLocale,
+ strTime);
}
if (!iRet) {
strTime = "";
@@ -3072,11 +3087,13 @@ void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis,
} else {
CFX_ByteString propStr;
FXJSE_Value_ToUTF8String(propertyValue, propStr);
- FXJSE_Value_GetObjectProp(jsobjectValue, propStr, newProperty);
+ FXJSE_Value_GetObjectProp(jsobjectValue, propStr.AsByteStringC(),
+ newProperty);
}
CFX_ByteString bsChoosed;
HValueToUTF8String(newProperty, bsChoosed);
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), bsChoosed);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ bsChoosed.AsByteStringC());
FXJSE_Value_Release(newProperty);
FXJSE_Value_Release(jsobjectValue);
FXJSE_Value_Release(propertyValue);
@@ -3087,7 +3104,8 @@ void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis,
if (iValueIndex == iIndex) {
CFX_ByteString bsChoosed;
HValueToUTF8String(argIndexValue, bsChoosed);
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), bsChoosed);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ bsChoosed.AsByteStringC());
bFound = TRUE;
}
}
@@ -3197,9 +3215,10 @@ void CXFA_FM2JSContext::Within(FXJSE_HOBJECT hThis,
HValueToUTF8String(argOne, oneString);
HValueToUTF8String(argLow, lowString);
HValueToUTF8String(argHeight, heightString);
- FXJSE_Value_SetInteger(args.GetReturnValue(),
- ((oneString.Compare(lowString) >= 0) &&
- (oneString.Compare(heightString) <= 0)));
+ FXJSE_Value_SetInteger(
+ args.GetReturnValue(),
+ ((oneString.Compare(lowString.AsByteStringC()) >= 0) &&
+ (oneString.Compare(heightString.AsByteStringC()) <= 0)));
}
FXJSE_Value_Release(argLow);
FXJSE_Value_Release(argHeight);
@@ -3637,7 +3656,7 @@ void CXFA_FM2JSContext::At(FXJSE_HOBJECT hThis,
} else {
CFX_ByteString stringOne;
HValueToUTF8String(argOne, stringOne);
- FX_STRSIZE iPosition = stringOne.Find(stringTwo);
+ FX_STRSIZE iPosition = stringOne.Find(stringTwo.AsByteStringC());
FXJSE_Value_SetInteger(args.GetReturnValue(), iPosition + 1);
}
}
@@ -3674,7 +3693,8 @@ void CXFA_FM2JSContext::Concat(FXJSE_HOBJECT hThis,
if (bAllNull) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultString);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ resultString.AsByteStringC());
}
} else {
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
@@ -3695,7 +3715,7 @@ void CXFA_FM2JSContext::Decode(FXJSE_HOBJECT hThis,
CFX_ByteString toDecodeString;
HValueToUTF8String(argOne, toDecodeString);
CFX_ByteTextBuf resultBuf;
- DecodeURL(toDecodeString, resultBuf);
+ DecodeURL(toDecodeString.AsByteStringC(), resultBuf);
FXJSE_Value_SetUTF8String(args.GetReturnValue(),
resultBuf.GetByteString());
}
@@ -3712,11 +3732,11 @@ void CXFA_FM2JSContext::Decode(FXJSE_HOBJECT hThis,
HValueToUTF8String(argTwo, identifyString);
CFX_ByteTextBuf resultBuf;
if (identifyString.EqualNoCase("html")) {
- DecodeHTML(toDecodeString, resultBuf);
+ DecodeHTML(toDecodeString.AsByteStringC(), resultBuf);
} else if (identifyString.EqualNoCase("xml")) {
- DecodeXML(toDecodeString, resultBuf);
+ DecodeXML(toDecodeString.AsByteStringC(), resultBuf);
} else {
- DecodeURL(toDecodeString, resultBuf);
+ DecodeURL(toDecodeString.AsByteStringC(), resultBuf);
}
FXJSE_Value_SetUTF8String(args.GetReturnValue(),
resultBuf.GetByteString());
@@ -3781,7 +3801,8 @@ void CXFA_FM2JSContext::DecodeURL(const CFX_ByteStringC& szURLString,
wsResultBuf.AppendChar(0);
szResultString.Clear();
szResultString << FX_UTF8Encode(wsResultBuf.GetBuffer(),
- wsResultBuf.GetLength());
+ wsResultBuf.GetLength())
+ .AsByteStringC();
}
void CXFA_FM2JSContext::DecodeHTML(const CFX_ByteStringC& szHTMLString,
CFX_ByteTextBuf& szResultString) {
@@ -3855,7 +3876,8 @@ void CXFA_FM2JSContext::DecodeHTML(const CFX_ByteStringC& szHTMLString,
wsResultBuf.AppendChar(0);
szResultString.Clear();
szResultString << FX_UTF8Encode(wsResultBuf.GetBuffer(),
- wsResultBuf.GetLength());
+ wsResultBuf.GetLength())
+ .AsByteStringC();
}
void CXFA_FM2JSContext::DecodeXML(const CFX_ByteStringC& szXMLString,
CFX_ByteTextBuf& szResultString) {
@@ -3952,7 +3974,8 @@ void CXFA_FM2JSContext::DecodeXML(const CFX_ByteStringC& szXMLString,
}
wsXMLBuf.AppendChar(0);
szResultString.Clear();
- szResultString << FX_UTF8Encode(wsXMLBuf.GetBuffer(), wsXMLBuf.GetLength());
+ szResultString << FX_UTF8Encode(wsXMLBuf.GetBuffer(), wsXMLBuf.GetLength())
+ .AsByteStringC();
}
void CXFA_FM2JSContext::Encode(FXJSE_HOBJECT hThis,
const CFX_ByteStringC& szFuncName,
@@ -3968,7 +3991,7 @@ void CXFA_FM2JSContext::Encode(FXJSE_HOBJECT hThis,
CFX_ByteString toEncodeString;
HValueToUTF8String(argOne, toEncodeString);
CFX_ByteTextBuf resultBuf;
- EncodeURL(toEncodeString, resultBuf);
+ EncodeURL(toEncodeString.AsByteStringC(), resultBuf);
FXJSE_Value_SetUTF8String(args.GetReturnValue(),
resultBuf.GetByteString());
}
@@ -3985,11 +4008,11 @@ void CXFA_FM2JSContext::Encode(FXJSE_HOBJECT hThis,
HValueToUTF8String(argTwo, identifyString);
CFX_ByteTextBuf resultBuf;
if (identifyString.EqualNoCase("html")) {
- EncodeHTML(toEncodeString, resultBuf);
+ EncodeHTML(toEncodeString.AsByteStringC(), resultBuf);
} else if (identifyString.EqualNoCase("xml")) {
- EncodeXML(toEncodeString, resultBuf);
+ EncodeXML(toEncodeString.AsByteStringC(), resultBuf);
} else {
- EncodeURL(toEncodeString, resultBuf);
+ EncodeURL(toEncodeString.AsByteStringC(), resultBuf);
}
FXJSE_Value_SetUTF8String(args.GetReturnValue(),
resultBuf.GetByteString());
@@ -4106,8 +4129,8 @@ void CXFA_FM2JSContext::EncodeURL(const CFX_ByteStringC& szURLString,
}
wsResultBuf.AppendChar(0);
szResultBuf.Clear();
- szResultBuf << FX_UTF8Encode(wsResultBuf.GetBuffer(),
- wsResultBuf.GetLength());
+ szResultBuf << FX_UTF8Encode(wsResultBuf.GetBuffer(), wsResultBuf.GetLength())
+ .AsByteStringC();
}
void CXFA_FM2JSContext::EncodeHTML(const CFX_ByteStringC& szHTMLString,
CFX_ByteTextBuf& szResultBuf) {
@@ -4160,8 +4183,8 @@ void CXFA_FM2JSContext::EncodeHTML(const CFX_ByteStringC& szHTMLString,
}
wsResultBuf.AppendChar(0);
szResultBuf.Clear();
- szResultBuf << FX_UTF8Encode(wsResultBuf.GetBuffer(),
- wsResultBuf.GetLength());
+ szResultBuf << FX_UTF8Encode(wsResultBuf.GetBuffer(), wsResultBuf.GetLength())
+ .AsByteStringC();
}
void CXFA_FM2JSContext::EncodeXML(const CFX_ByteStringC& szXMLString,
CFX_ByteTextBuf& szResultBuf) {
@@ -4242,8 +4265,8 @@ void CXFA_FM2JSContext::EncodeXML(const CFX_ByteStringC& szXMLString,
}
wsResultBuf.AppendChar(0);
szResultBuf.Clear();
- szResultBuf << FX_UTF8Encode(wsResultBuf.GetBuffer(),
- wsResultBuf.GetLength());
+ szResultBuf << FX_UTF8Encode(wsResultBuf.GetBuffer(), wsResultBuf.GetLength())
+ .AsByteStringC();
}
FX_BOOL CXFA_FM2JSContext::HTMLSTR2Code(const CFX_WideStringC& pData,
uint32_t& iCode) {
@@ -4392,7 +4415,8 @@ void CXFA_FM2JSContext::Format(FXJSE_HOBJECT hThis,
CXFA_WidgetData widgetData(pThisNode);
IFX_Locale* pLocale = widgetData.GetLocal();
uint32_t patternType;
- FX_BOOL bCompelte = XFA_PATTERN_STRING_Type(szPattern, patternType);
+ FX_BOOL bCompelte =
+ XFA_PATTERN_STRING_Type(szPattern.AsByteStringC(), patternType);
CFX_WideString wsPattern =
CFX_WideString::FromUTF8(szPattern, szPattern.GetLength());
CFX_WideString wsValue =
@@ -4448,8 +4472,9 @@ void CXFA_FM2JSContext::Format(FXJSE_HOBJECT hThis,
CFX_WideString wsRet;
if (localeValue.FormatPatterns(wsRet, wsPattern, pLocale,
XFA_VALUEPICTURE_Display)) {
- FXJSE_Value_SetUTF8String(args.GetReturnValue(),
- FX_UTF8Encode(wsRet, wsRet.GetLength()));
+ FXJSE_Value_SetUTF8String(
+ args.GetReturnValue(),
+ FX_UTF8Encode(wsRet, wsRet.GetLength()).AsByteStringC());
} else {
FXJSE_Value_SetUTF8String(args.GetReturnValue(), "");
}
@@ -4482,7 +4507,7 @@ void CXFA_FM2JSContext::Left(FXJSE_HOBJECT hThis,
count = 0;
}
FXJSE_Value_SetUTF8String(args.GetReturnValue(),
- sourceString.Left(count));
+ sourceString.Left(count).AsByteStringC());
}
FXJSE_Value_Release(argOne);
FXJSE_Value_Release(argTwo);
@@ -4548,7 +4573,8 @@ void CXFA_FM2JSContext::Lower(FXJSE_HOBJECT hThis,
lowStringBuf.AppendChar(0);
FXJSE_Value_SetUTF8String(
args.GetReturnValue(),
- FX_UTF8Encode(lowStringBuf.GetBuffer(), lowStringBuf.GetLength()));
+ FX_UTF8Encode(lowStringBuf.GetBuffer(), lowStringBuf.GetLength())
+ .AsByteStringC());
if (argc == 2) {
FXJSE_Value_Release(localeValue);
}
@@ -4574,7 +4600,8 @@ void CXFA_FM2JSContext::Ltrim(FXJSE_HOBJECT hThis,
CFX_ByteString sourceString;
HValueToUTF8String(argOne, sourceString);
sourceString.TrimLeft();
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), sourceString);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ sourceString.AsByteStringC());
}
FXJSE_Value_Release(argOne);
} else {
@@ -4605,7 +4632,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis,
IFX_Locale* pLocale = widgetData.GetLocal();
uint32_t patternType;
FX_BOOL bCompletePattern =
- XFA_PATTERN_STRING_Type(szPattern, patternType);
+ XFA_PATTERN_STRING_Type(szPattern.AsByteStringC(), patternType);
CFX_WideString wsPattern =
CFX_WideString::FromUTF8(szPattern, szPattern.GetLength());
CFX_WideString wsValue =
@@ -4616,7 +4643,8 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis,
(CXFA_LocaleMgr*)pMgr);
if (localeValue.IsValid()) {
szParsedValue = FX_UTF8Encode(localeValue.GetValue());
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), szParsedValue);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ szParsedValue.AsByteStringC());
} else {
FXJSE_Value_SetUTF8String(args.GetReturnValue(), "");
}
@@ -4635,7 +4663,8 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis,
pLocale, (CXFA_LocaleMgr*)pMgr);
if (localeValue.IsValid()) {
szParsedValue = FX_UTF8Encode(localeValue.GetValue());
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), szParsedValue);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ szParsedValue.AsByteStringC());
} else {
FXJSE_Value_SetUTF8String(args.GetReturnValue(), "");
}
@@ -4647,7 +4676,8 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis,
pLocale, (CXFA_LocaleMgr*)pMgr);
if (localeValue.IsValid()) {
szParsedValue = FX_UTF8Encode(localeValue.GetValue());
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), szParsedValue);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ szParsedValue.AsByteStringC());
} else {
FXJSE_Value_SetUTF8String(args.GetReturnValue(), "");
}
@@ -4659,7 +4689,8 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis,
pLocale, (CXFA_LocaleMgr*)pMgr);
if (localeValue.IsValid()) {
szParsedValue = FX_UTF8Encode(localeValue.GetValue());
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), szParsedValue);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ szParsedValue.AsByteStringC());
} else {
FXJSE_Value_SetUTF8String(args.GetReturnValue(), "");
}
@@ -4671,7 +4702,8 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis,
pLocale, (CXFA_LocaleMgr*)pMgr);
if (localeValue.IsValid()) {
szParsedValue = FX_UTF8Encode(localeValue.GetValue());
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), szParsedValue);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ szParsedValue.AsByteStringC());
} else {
FXJSE_Value_SetUTF8String(args.GetReturnValue(), "");
}
@@ -4704,7 +4736,8 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis,
pLocale, (CXFA_LocaleMgr*)pMgr);
if (localeValue.IsValid()) {
szParsedValue = FX_UTF8Encode(localeValue.GetValue());
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), szParsedValue);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ szParsedValue.AsByteStringC());
} else {
FXJSE_Value_SetUTF8String(args.GetReturnValue(), "");
}
@@ -4761,7 +4794,7 @@ void CXFA_FM2JSContext::Replace(FXJSE_HOBJECT hThis,
}
}
if (iFindIndex == iFindLen) {
- resultString << threeString;
+ resultString << threeString.AsByteStringC();
u += iFindLen - 1;
iFindIndex = 0;
} else {
@@ -4808,7 +4841,7 @@ void CXFA_FM2JSContext::Right(FXJSE_HOBJECT hThis,
count = 0;
}
FXJSE_Value_SetUTF8String(args.GetReturnValue(),
- sourceString.Right(count));
+ sourceString.Right(count).AsByteStringC());
}
FXJSE_Value_Release(argOne);
FXJSE_Value_Release(argTwo);
@@ -4830,7 +4863,8 @@ void CXFA_FM2JSContext::Rtrim(FXJSE_HOBJECT hThis,
CFX_ByteString sourceString;
HValueToUTF8String(argOne, sourceString);
sourceString.TrimRight();
- FXJSE_Value_SetUTF8String(args.GetReturnValue(), sourceString);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(),
+ sourceString.AsByteStringC());
}
FXJSE_Value_Release(argOne);
} else {
@@ -5035,7 +5069,7 @@ void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis,
resultString.AppendChar(sourceString.GetAt(i));
++i;
}
- resultString << insertString;
+ resultString << insertString.AsByteStringC();
i = iStart + iDelete;
while (i < iLength) {
resultString.AppendChar(sourceString.GetAt(i));
@@ -5089,8 +5123,9 @@ void CXFA_FM2JSContext::Substr(FXJSE_HOBJECT hThis,
iCount = 0;
}
iStart -= 1;
- FXJSE_Value_SetUTF8String(args.GetReturnValue(),
- szSourceStr.Mid(iStart, iCount));
+ FXJSE_Value_SetUTF8String(
+ args.GetReturnValue(),
+ szSourceStr.Mid(iStart, iCount).AsByteStringC());
}
}
FXJSE_Value_Release(stringValue);
@@ -5118,7 +5153,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);
+ FXJSE_Value_SetUTF8String(args.GetReturnValue(), bsUId.AsByteStringC());
if (argc == 1) {
FXJSE_Value_Release(argOne);
}
@@ -5164,9 +5199,10 @@ void CXFA_FM2JSContext::Upper(FXJSE_HOBJECT hThis,
++i;
}
upperStringBuf.AppendChar(0);
- FXJSE_Value_SetUTF8String(args.GetReturnValue(),
- FX_UTF8Encode(upperStringBuf.GetBuffer(),
- upperStringBuf.GetLength()));
+ FXJSE_Value_SetUTF8String(
+ args.GetReturnValue(),
+ FX_UTF8Encode(upperStringBuf.GetBuffer(), upperStringBuf.GetLength())
+ .AsByteStringC());
if (argc == 2) {
FXJSE_Value_Release(localeValue);
}
@@ -5219,7 +5255,7 @@ void CXFA_FM2JSContext::WordNum(FXJSE_HOBJECT hThis,
CFX_ByteTextBuf resultBuf;
CFX_ByteString numberString;
numberString.Format("%.2f", fNumber);
- WordUS(numberString, iIdentifier, resultBuf);
+ WordUS(numberString.AsByteStringC(), iIdentifier, resultBuf);
FXJSE_Value_SetUTF8String(args.GetReturnValue(),
resultBuf.GetByteString());
}
@@ -5535,7 +5571,8 @@ void CXFA_FM2JSContext::Post(FXJSE_HOBJECT hThis,
if (bFlags) {
FXJSE_Value_SetUTF8String(
args.GetReturnValue(),
- FX_UTF8Encode(decodedResponse, decodedResponse.GetLength()));
+ FX_UTF8Encode(decodedResponse, decodedResponse.GetLength())
+ .AsByteStringC());
} else {
pContext->ThrowScriptErrorMessage(XFA_IDS_SERVER_DENY);
}
@@ -5625,7 +5662,8 @@ 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, rValue);
+ FXJSE_Value_SetObjectProp(jsObjectValue, propertyStr.AsByteStringC(),
+ rValue);
}
}
FXJSE_Value_Release(jsObjectValue);
@@ -5808,8 +5846,9 @@ void CXFA_FM2JSContext::less_operator(FXJSE_HOBJECT hThis,
CFX_ByteString secondOutput;
FXJSE_Value_ToUTF8String(argFirst, firstOutput);
FXJSE_Value_ToUTF8String(argSecond, secondOutput);
- FXJSE_Value_SetInteger(args.GetReturnValue(),
- (firstOutput.Compare(secondOutput) == -1) ? 1 : 0);
+ FXJSE_Value_SetInteger(
+ args.GetReturnValue(),
+ firstOutput.Compare(secondOutput.AsByteStringC()) == -1);
} else {
FX_DOUBLE first = HValueToDouble(hThis, argFirst);
FX_DOUBLE second = HValueToDouble(hThis, argSecond);
@@ -5840,8 +5879,9 @@ void CXFA_FM2JSContext::lessequal_operator(FXJSE_HOBJECT hThis,
CFX_ByteString secondOutput;
FXJSE_Value_ToUTF8String(argFirst, firstOutput);
FXJSE_Value_ToUTF8String(argSecond, secondOutput);
- FXJSE_Value_SetInteger(args.GetReturnValue(),
- (firstOutput.Compare(secondOutput) != 1) ? 1 : 0);
+ FXJSE_Value_SetInteger(
+ args.GetReturnValue(),
+ firstOutput.Compare(secondOutput.AsByteStringC()) != 1);
} else {
FX_DOUBLE first = HValueToDouble(hThis, argFirst);
FX_DOUBLE second = HValueToDouble(hThis, argSecond);
@@ -5869,8 +5909,9 @@ void CXFA_FM2JSContext::greater_operator(FXJSE_HOBJECT hThis,
CFX_ByteString secondOutput;
FXJSE_Value_ToUTF8String(argFirst, firstOutput);
FXJSE_Value_ToUTF8String(argSecond, secondOutput);
- FXJSE_Value_SetInteger(args.GetReturnValue(),
- (firstOutput.Compare(secondOutput) == 1) ? 1 : 0);
+ FXJSE_Value_SetInteger(
+ args.GetReturnValue(),
+ firstOutput.Compare(secondOutput.AsByteStringC()) == 1);
} else {
FX_DOUBLE first = HValueToDouble(hThis, argFirst);
FX_DOUBLE second = HValueToDouble(hThis, argSecond);
@@ -5901,8 +5942,9 @@ void CXFA_FM2JSContext::greaterequal_operator(FXJSE_HOBJECT hThis,
CFX_ByteString secondOutput;
FXJSE_Value_ToUTF8String(argFirst, firstOutput);
FXJSE_Value_ToUTF8String(argSecond, secondOutput);
- FXJSE_Value_SetInteger(args.GetReturnValue(),
- (firstOutput.Compare(secondOutput) != -1) ? 1 : 0);
+ FXJSE_Value_SetInteger(
+ args.GetReturnValue(),
+ firstOutput.Compare(secondOutput.AsByteStringC()) != -1);
} else {
FX_DOUBLE first = HValueToDouble(hThis, argFirst);
FX_DOUBLE second = HValueToDouble(hThis, argSecond);
@@ -6082,7 +6124,8 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis,
iIndexValue = HValueToInteger(hThis, argIndex);
}
CFX_ByteString szSomExp;
- GenerateSomExpression(szName, iIndexFlags, iIndexValue, bIsStar, szSomExp);
+ GenerateSomExpression(szName.AsByteStringC(), iIndexFlags, iIndexValue,
+ bIsStar, szSomExp);
if (FXJSE_Value_IsArray(argAccessor)) {
FXJSE_HVALUE hLengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argAccessor, "length", hLengthValue);
@@ -6099,8 +6142,9 @@ 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,
- resoveNodeRS, TRUE, szName.IsEmpty());
+ int32_t iRet =
+ ResolveObjects(hThis, hJSObjValue, szSomExp.AsByteStringC(),
+ resoveNodeRS, TRUE, szName.IsEmpty());
if (iRet > 0) {
ParseResolveResult(hThis, resoveNodeRS, hJSObjValue,
hResolveValues[i - 2], iSizes[i - 2], bAttribute);
@@ -6115,7 +6159,7 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis,
}
FXJSE_Value_SetInteger(rgValues[0], 1);
if (bAttribute) {
- FXJSE_Value_SetUTF8String(rgValues[1], szName);
+ FXJSE_Value_SetUTF8String(rgValues[1], szName.AsByteStringC());
} else {
FXJSE_Value_SetNull(rgValues[1]);
}
@@ -6155,15 +6199,15 @@ 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, resoveNodeRS, TRUE,
- szName.IsEmpty());
+ iRet = ResolveObjects(hThis, argAccessor, szSomExp.AsByteStringC(),
+ resoveNodeRS, TRUE, szName.IsEmpty());
} else if (!FXJSE_Value_IsObject(argAccessor) &&
!bsAccessorName.IsEmpty()) {
FX_BOOL bGetObject =
- GetObjectByName(hThis, argAccessor, bsAccessorName);
+ GetObjectByName(hThis, argAccessor, bsAccessorName.AsByteStringC());
if (bGetObject) {
- iRet = ResolveObjects(hThis, argAccessor, szSomExp, resoveNodeRS,
- TRUE, szName.IsEmpty());
+ iRet = ResolveObjects(hThis, argAccessor, szSomExp.AsByteStringC(),
+ resoveNodeRS, TRUE, szName.IsEmpty());
}
}
if (iRet > 0) {
@@ -6178,7 +6222,7 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis,
}
FXJSE_Value_SetInteger(rgValues[0], 1);
if (bAttribute) {
- FXJSE_Value_SetUTF8String(rgValues[1], szName);
+ FXJSE_Value_SetUTF8String(rgValues[1], szName.AsByteStringC());
} else {
FXJSE_Value_SetNull(rgValues[1]);
}
@@ -6233,7 +6277,8 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis,
iIndexValue = HValueToInteger(hThis, argIndex);
}
CFX_ByteString szSomExp;
- GenerateSomExpression(szName, iIndexFlags, iIndexValue, bIsStar, szSomExp);
+ GenerateSomExpression(szName.AsByteStringC(), iIndexFlags, iIndexValue,
+ bIsStar, szSomExp);
if (FXJSE_Value_IsArray(argAccessor)) {
FXJSE_HVALUE hLengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argAccessor, "length", hLengthValue);
@@ -6246,8 +6291,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, resoveNodeRS, FALSE);
+ int32_t iRet = ResolveObjects(
+ hThis, hJSObjValue, szSomExp.AsByteStringC(), resoveNodeRS, FALSE);
if (iRet > 0) {
ParseResolveResult(hThis, resoveNodeRS, hJSObjValue,
hResolveValues[i - 2], iSizes[i - 2], bAttribute);
@@ -6262,7 +6307,7 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis,
}
FXJSE_Value_SetInteger(rgValues[0], 1);
if (bAttribute) {
- FXJSE_Value_SetUTF8String(rgValues[1], szName);
+ FXJSE_Value_SetUTF8String(rgValues[1], szName.AsByteStringC());
} else {
FXJSE_Value_SetNull(rgValues[1]);
}
@@ -6301,15 +6346,15 @@ 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, resoveNodeRS, FALSE);
+ iRet = ResolveObjects(hThis, argAccessor, szSomExp.AsByteStringC(),
+ resoveNodeRS, FALSE);
} else if (!FXJSE_Value_IsObject(argAccessor) &&
!bsAccessorName.IsEmpty()) {
FX_BOOL bGetObject =
- GetObjectByName(hThis, argAccessor, bsAccessorName);
+ GetObjectByName(hThis, argAccessor, bsAccessorName.AsByteStringC());
if (bGetObject) {
- iRet =
- ResolveObjects(hThis, argAccessor, szSomExp, resoveNodeRS, FALSE);
+ iRet = ResolveObjects(hThis, argAccessor, szSomExp.AsByteStringC(),
+ resoveNodeRS, FALSE);
}
}
if (iRet > 0) {
@@ -6324,7 +6369,7 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis,
}
FXJSE_Value_SetInteger(rgValues[0], 1);
if (bAttribute) {
- FXJSE_Value_SetUTF8String(rgValues[1], szName);
+ FXJSE_Value_SetUTF8String(rgValues[1], szName.AsByteStringC());
} else {
FXJSE_Value_SetNull(rgValues[1]);
}
@@ -6380,7 +6425,7 @@ void CXFA_FM2JSContext::eval_translation(FXJSE_HOBJECT hThis,
CFX_WideString javaScript = wsJavaScriptBuf.GetWideString();
FXJSE_Value_SetUTF8String(
args.GetReturnValue(),
- FX_UTF8Encode(javaScript, javaScript.GetLength()));
+ FX_UTF8Encode(javaScript, javaScript.GetLength()).AsByteStringC());
} else {
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
@@ -6435,7 +6480,7 @@ void CXFA_FM2JSContext::get_fm_value(FXJSE_HOBJECT hThis,
} else {
CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
- FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr,
+ FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsByteStringC(),
args.GetReturnValue());
}
FXJSE_Value_Release(propertyValue);
@@ -6604,7 +6649,8 @@ FXJSE_HVALUE CXFA_FM2JSContext::GetSimpleHValue(FXJSE_HOBJECT hThis,
} else {
CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
- FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr, simpleValue);
+ FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsByteStringC(),
+ simpleValue);
}
FXJSE_Value_Release(propertyValue);
FXJSE_Value_Release(jsobjectValue);
@@ -6647,7 +6693,8 @@ 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, newPropertyValue);
+ FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsByteStringC(),
+ newPropertyValue);
if (FXJSE_Value_IsNull(newPropertyValue)) {
isNull = TRUE;
}
@@ -6753,7 +6800,8 @@ 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,
+ FXJSE_Value_GetObjectProp(jsObjectValue,
+ propertyString.AsByteStringC(),
resultValues[index]);
index++;
}
@@ -6963,7 +7011,8 @@ int32_t CXFA_FM2JSContext::HValueToInteger(FXJSE_HOBJECT hThis,
} else {
CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
- FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr, newProperty);
+ FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsByteStringC(),
+ newProperty);
}
iValue = HValueToInteger(hThis, newProperty);
FXJSE_Value_Release(newProperty);
@@ -7006,7 +7055,8 @@ FX_FLOAT CXFA_FM2JSContext::HValueToFloat(FXJSE_HOBJECT hThis,
} else {
CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
- FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr, newProperty);
+ FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsByteStringC(),
+ newProperty);
}
fRet = HValueToFloat(hThis, newProperty);
FXJSE_Value_Release(newProperty);
@@ -7020,7 +7070,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);
+ fRet = (FX_FLOAT)StringToDouble(bsOutput.AsByteStringC());
} else if (FXJSE_Value_IsUndefined(arg)) {
fRet = 0;
} else {
@@ -7045,7 +7095,8 @@ FX_DOUBLE CXFA_FM2JSContext::HValueToDouble(FXJSE_HOBJECT hThis,
} else {
CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
- FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr, newProperty);
+ FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsByteStringC(),
+ newProperty);
}
dRet = HValueToDouble(hThis, newProperty);
FXJSE_Value_Release(newProperty);
@@ -7059,7 +7110,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);
+ dRet = StringToDouble(bsOutput.AsByteStringC());
} else if (FXJSE_Value_IsUndefined(arg)) {
dRet = 0;
} else {
@@ -7219,5 +7270,6 @@ void CXFA_FM2JSContext::ThrowScriptErrorMessage(int32_t iStringID, ...) {
va_start(arg_ptr, iStringID);
wsMessage.FormatV((const FX_WCHAR*)wsFormat, arg_ptr);
va_end(arg_ptr);
- FXJSE_ThrowMessage("", FX_UTF8Encode(wsMessage, wsMessage.GetLength()));
+ FXJSE_ThrowMessage(
+ "", FX_UTF8Encode(wsMessage, wsMessage.GetLength()).AsByteStringC());
}
diff --git a/xfa/fxfa/parser/xfa_locale.cpp b/xfa/fxfa/parser/xfa_locale.cpp
index 35d8c36fa2..141e295be9 100644
--- a/xfa/fxfa/parser/xfa_locale.cpp
+++ b/xfa/fxfa/parser/xfa_locale.cpp
@@ -72,7 +72,8 @@ void CXFA_XMLLocale::GetNumbericSymbol(FX_LOCALENUMSYMBOL eType,
default:
return;
}
- CXML_Element* pElement = m_pLocaleData->GetElement("", bsSymbols);
+ CXML_Element* pElement =
+ m_pLocaleData->GetElement("", bsSymbols.AsByteStringC());
if (!pElement) {
return;
}
@@ -86,7 +87,7 @@ void CXFA_XMLLocale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const {
}
CFX_ByteString bsSpace;
CXML_Element* pNumberSymbols =
- m_pLocaleData->GetElement(bsSpace, "dateTimeSymbols");
+ m_pLocaleData->GetElement(bsSpace.AsByteStringC(), "dateTimeSymbols");
if (!pNumberSymbols) {
return;
}
@@ -120,10 +121,12 @@ CFX_WideString CXFA_XMLLocale::GetCalendarSymbol(const CFX_ByteStringC& symbol,
if (m_pLocaleData) {
CXML_Element* pChild = m_pLocaleData->GetElement("", "calendarSymbols");
if (pChild) {
- CXML_Element* pSymbolNames = pChild->GetElement("", pstrSymbolNames);
+ CXML_Element* pSymbolNames =
+ pChild->GetElement("", pstrSymbolNames.AsByteStringC());
if (pSymbolNames) {
if (pSymbolNames->GetAttrInteger("abbr") != bAbbr) {
- pSymbolNames = pChild->GetElement("", pstrSymbolNames, 1);
+ pSymbolNames =
+ pChild->GetElement("", pstrSymbolNames.AsByteStringC(), 1);
}
if (pSymbolNames && pSymbolNames->GetAttrInteger("abbr") == bAbbr) {
CXML_Element* pSymbolName =
diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp
index 15f21c8a23..d245e33e29 100644
--- a/xfa/fxfa/parser/xfa_object_imp.cpp
+++ b/xfa/fxfa/parser/xfa_object_imp.cpp
@@ -56,7 +56,8 @@ void CXFA_Object::Script_ObjectClass_ClassName(FXJSE_HVALUE hValue,
CFX_WideStringC className;
GetClassName(className);
FXJSE_Value_SetUTF8String(
- hValue, FX_UTF8Encode(className.GetPtr(), className.GetLength()));
+ hValue, FX_UTF8Encode(className.GetPtr(), className.GetLength())
+ .AsByteStringC());
} else {
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
}
@@ -71,7 +72,8 @@ void CXFA_Object::ThrowScriptErrorMessage(int32_t iStringID, ...) {
va_start(arg_ptr, iStringID);
wsMessage.FormatV((const FX_WCHAR*)wsFormat, arg_ptr);
va_end(arg_ptr);
- FXJSE_ThrowMessage("", FX_UTF8Encode(wsMessage, wsMessage.GetLength()));
+ FXJSE_ThrowMessage(
+ "", FX_UTF8Encode(wsMessage, wsMessage.GetLength()).AsByteStringC());
}
static void XFA_DeleteWideString(void* pData) {
@@ -752,7 +754,8 @@ void CXFA_Node::Script_TreeClass_Nodes(FXJSE_HVALUE hValue,
FXSYS_assert(pAppProvider);
CFX_WideString wsMessage;
pAppProvider->LoadString(XFA_IDS_Unable_TO_SET, wsMessage);
- FXJSE_ThrowMessage("", FX_UTF8Encode(wsMessage, wsMessage.GetLength()));
+ FXJSE_ThrowMessage(
+ "", FX_UTF8Encode(wsMessage, wsMessage.GetLength()).AsByteStringC());
} else {
CXFA_AttachNodeList* pNodeList = new CXFA_AttachNodeList(m_pDocument, this);
FXJSE_Value_SetObject(hValue, (CXFA_Object*)pNodeList,
@@ -813,7 +816,8 @@ void CXFA_Node::Script_TreeClass_SomExpression(FXJSE_HVALUE hValue,
} else {
CFX_WideString wsSOMExpression;
GetSOMExpression(wsSOMExpression);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsSOMExpression));
+ FXJSE_Value_SetUTF8String(hValue,
+ FX_UTF8Encode(wsSOMExpression).AsByteStringC());
}
}
void CXFA_Node::Script_NodeClass_ApplyXSL(CFXJSE_Arguments* pArguments) {
@@ -877,7 +881,7 @@ void CXFA_Node::Script_NodeClass_GetAttribute(CFXJSE_Arguments* pArguments) {
GetAttribute(wsExpression, wsValue);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsByteStringC());
}
}
void CXFA_Node::Script_NodeClass_GetElement(CFXJSE_Arguments* pArguments) {
@@ -1180,7 +1184,8 @@ void CXFA_Node::Script_NodeClass_Ns(FXJSE_HVALUE hValue,
} else {
CFX_WideString wsNameSpace;
TryNamespace(wsNameSpace);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsNameSpace));
+ FXJSE_Value_SetUTF8String(hValue,
+ FX_UTF8Encode(wsNameSpace).AsByteStringC());
}
}
void CXFA_Node::Script_NodeClass_Model(FXJSE_HVALUE hValue,
@@ -1534,8 +1539,8 @@ void CXFA_Node::Script_Attribute_String(FXJSE_HVALUE hValue,
} else {
CFX_WideString wsValue;
GetAttribute(eAttribute, wsValue);
- FXJSE_Value_SetUTF8String(hValue,
- FX_UTF8Encode(wsValue, wsValue.GetLength()));
+ FXJSE_Value_SetUTF8String(
+ hValue, FX_UTF8Encode(wsValue, wsValue.GetLength()).AsByteStringC());
}
}
void CXFA_Node::Script_Attribute_StringRead(FXJSE_HVALUE hValue,
@@ -1544,8 +1549,8 @@ void CXFA_Node::Script_Attribute_StringRead(FXJSE_HVALUE hValue,
if (!bSetting) {
CFX_WideString wsValue;
GetAttribute(eAttribute, wsValue);
- FXJSE_Value_SetUTF8String(hValue,
- FX_UTF8Encode(wsValue, wsValue.GetLength()));
+ FXJSE_Value_SetUTF8String(
+ hValue, FX_UTF8Encode(wsValue, wsValue.GetLength()).AsByteStringC());
} else {
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
}
@@ -1628,7 +1633,7 @@ void CXFA_Node::Script_Som_Message(FXJSE_HVALUE hValue,
default:
break;
}
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsMessage));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsMessage).AsByteStringC());
}
}
void CXFA_Node::Script_Som_ValidationMessage(FXJSE_HVALUE hValue,
@@ -1710,8 +1715,8 @@ void CXFA_Node::Script_Som_DefaultValue(FXJSE_HVALUE hValue,
CFX_Decimal decimal(content);
FXJSE_Value_SetFloat(hValue, (FX_FLOAT)(double)decimal);
} else {
- FXJSE_Value_SetUTF8String(hValue,
- FX_UTF8Encode(content, content.GetLength()));
+ FXJSE_Value_SetUTF8String(
+ hValue, FX_UTF8Encode(content, content.GetLength()).AsByteStringC());
}
}
}
@@ -1726,8 +1731,8 @@ void CXFA_Node::Script_Som_DefaultValue_Read(FXJSE_HVALUE hValue,
if (content.IsEmpty()) {
FXJSE_Value_SetNull(hValue);
} else {
- FXJSE_Value_SetUTF8String(hValue,
- FX_UTF8Encode(content, content.GetLength()));
+ FXJSE_Value_SetUTF8String(
+ hValue, FX_UTF8Encode(content, content.GetLength()).AsByteStringC());
}
}
void CXFA_Node::Script_Boolean_Value(FXJSE_HVALUE hValue,
@@ -1867,7 +1872,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));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(strColor).AsByteStringC());
}
}
void CXFA_Node::Script_Som_BorderWidth(FXJSE_HVALUE hValue,
@@ -1893,7 +1898,8 @@ void CXFA_Node::Script_Som_BorderWidth(FXJSE_HVALUE hValue,
CXFA_Edge edge = border.GetEdge(0);
CXFA_Measurement thickness = edge.GetMSThickness();
thickness.ToString(wsThickness);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsThickness));
+ FXJSE_Value_SetUTF8String(hValue,
+ FX_UTF8Encode(wsThickness).AsByteStringC());
}
}
void CXFA_Node::Script_Som_FillColor(FXJSE_HVALUE hValue,
@@ -1923,7 +1929,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));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsColor).AsByteStringC());
}
}
void CXFA_Node::Script_Som_DataNode(FXJSE_HVALUE hValue,
@@ -1965,8 +1971,8 @@ void CXFA_Node::Script_Draw_DefaultValue(FXJSE_HVALUE hValue,
if (content.IsEmpty()) {
FXJSE_Value_SetNull(hValue);
} else {
- FXJSE_Value_SetUTF8String(hValue,
- FX_UTF8Encode(content, content.GetLength()));
+ FXJSE_Value_SetUTF8String(
+ hValue, FX_UTF8Encode(content, content.GetLength()).AsByteStringC());
}
}
}
@@ -2018,7 +2024,8 @@ 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()));
+ hValue,
+ FX_UTF8Encode(content, content.GetLength()).AsByteStringC());
} else {
CFX_Decimal decimal(content);
FXJSE_Value_SetFloat(hValue, (FX_FLOAT)(double)decimal);
@@ -2031,8 +2038,9 @@ void CXFA_Node::Script_Field_DefaultValue(FXJSE_HVALUE hValue,
CFX_Decimal decimal(content);
FXJSE_Value_SetFloat(hValue, (FX_FLOAT)(double)decimal);
} else {
- FXJSE_Value_SetUTF8String(hValue,
- FX_UTF8Encode(content, content.GetLength()));
+ FXJSE_Value_SetUTF8String(
+ hValue,
+ FX_UTF8Encode(content, content.GetLength()).AsByteStringC());
}
}
}
@@ -2052,7 +2060,7 @@ void CXFA_Node::Script_Field_EditValue(FXJSE_HVALUE hValue,
pWidgetData->SetValue(wsValue, XFA_VALUEPICTURE_Edit);
} else {
pWidgetData->GetValue(wsValue, XFA_VALUEPICTURE_Edit);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsByteStringC());
}
}
void CXFA_Node::Script_Som_FontColor(FXJSE_HVALUE hValue,
@@ -2081,7 +2089,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));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsColor).AsByteStringC());
}
}
void CXFA_Node::Script_Field_FormatMessage(FXJSE_HVALUE hValue,
@@ -2104,7 +2112,7 @@ void CXFA_Node::Script_Field_FormattedValue(FXJSE_HVALUE hValue,
pWidgetData->SetValue(wsValue, XFA_VALUEPICTURE_Display);
} else {
pWidgetData->GetValue(wsValue, XFA_VALUEPICTURE_Display);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsByteStringC());
}
}
void CXFA_Node::Script_Som_Mandatory(FXJSE_HVALUE hValue,
@@ -2128,7 +2136,7 @@ void CXFA_Node::Script_Som_Mandatory(FXJSE_HVALUE hValue,
if (pInfo) {
wsValue = pInfo->pName;
}
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsByteStringC());
}
}
void CXFA_Node::Script_Som_MandatoryMessage(FXJSE_HVALUE hValue,
@@ -2234,8 +2242,9 @@ void CXFA_Node::Script_Field_GetSaveItem(CFXJSE_Arguments* pArguments) {
CFX_WideString wsValue;
FX_BOOL bHasItem = pWidgetData->GetChoiceListItem(wsValue, iIndex, TRUE);
if (bHasItem) {
- FXJSE_Value_SetUTF8String(pArguments->GetReturnValue(),
- FX_UTF8Encode(wsValue, wsValue.GetLength()));
+ FXJSE_Value_SetUTF8String(
+ pArguments->GetReturnValue(),
+ FX_UTF8Encode(wsValue, wsValue.GetLength()).AsByteStringC());
} else {
FXJSE_Value_SetNull(pArguments->GetReturnValue());
}
@@ -2257,7 +2266,8 @@ void CXFA_Node::Script_Field_BoundItem(CFXJSE_Arguments* pArguments) {
pWidgetData->GetItemValue(wsValue, wsBoundValue);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsBoundValue));
+ FXJSE_Value_SetUTF8String(hValue,
+ FX_UTF8Encode(wsBoundValue).AsByteStringC());
}
}
void CXFA_Node::Script_Field_GetItemState(CFXJSE_Arguments* pArguments) {
@@ -2312,8 +2322,9 @@ void CXFA_Node::Script_Field_GetDisplayItem(CFXJSE_Arguments* pArguments) {
CFX_WideString wsValue;
FX_BOOL bHasItem = pWidgetData->GetChoiceListItem(wsValue, iIndex, FALSE);
if (bHasItem) {
- FXJSE_Value_SetUTF8String(pArguments->GetReturnValue(),
- FX_UTF8Encode(wsValue, wsValue.GetLength()));
+ FXJSE_Value_SetUTF8String(
+ pArguments->GetReturnValue(),
+ FX_UTF8Encode(wsValue, wsValue.GetLength()).AsByteStringC());
} else {
FXJSE_Value_SetNull(pArguments->GetReturnValue());
}
@@ -2403,7 +2414,7 @@ void CXFA_Node::Script_ExclGroup_DefaultAndRawValue(FXJSE_HVALUE hValue,
if (wsValue.IsEmpty() && curVersion >= XFA_VERSION_300) {
FXJSE_Value_SetNull(hValue);
} else {
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsByteStringC());
}
}
}
@@ -2602,7 +2613,8 @@ void CXFA_Node::Script_Subform_Locale(FXJSE_HVALUE hValue,
CFX_WideString wsLocaleName;
GetLocaleName(wsLocaleName);
FXJSE_Value_SetUTF8String(
- hValue, FX_UTF8Encode(wsLocaleName, wsLocaleName.GetLength()));
+ hValue,
+ FX_UTF8Encode(wsLocaleName, wsLocaleName.GetLength()).AsByteStringC());
}
}
void CXFA_Node::Script_Subform_ExecEvent(CFXJSE_Arguments* pArguments) {
@@ -3497,7 +3509,8 @@ void CXFA_Node::Script_Form_Checksum(FXJSE_HVALUE hValue,
CFX_WideString wsChecksum;
GetAttribute(XFA_ATTRIBUTE_Checksum, wsChecksum, FALSE);
FXJSE_Value_SetUTF8String(
- hValue, FX_UTF8Encode(wsChecksum, wsChecksum.GetLength()));
+ hValue,
+ FX_UTF8Encode(wsChecksum, wsChecksum.GetLength()).AsByteStringC());
}
}
void CXFA_Node::Script_Packet_GetAttribute(CFXJSE_Arguments* pArguments) {
@@ -3514,7 +3527,8 @@ void CXFA_Node::Script_Packet_GetAttribute(CFXJSE_Arguments* pArguments) {
}
FXJSE_Value_SetUTF8String(
pArguments->GetReturnValue(),
- FX_UTF8Encode(wsAttributeValue, wsAttributeValue.GetLength()));
+ FX_UTF8Encode(wsAttributeValue, wsAttributeValue.GetLength())
+ .AsByteStringC());
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"getAttribute");
@@ -3576,7 +3590,8 @@ void CXFA_Node::Script_Packet_Content(FXJSE_HVALUE hValue,
pXMLElement->GetTextData(wsTextData);
}
FXJSE_Value_SetUTF8String(
- hValue, FX_UTF8Encode(wsTextData, wsTextData.GetLength()));
+ hValue,
+ FX_UTF8Encode(wsTextData, wsTextData.GetLength()).AsByteStringC());
}
}
void CXFA_Node::Script_Source_Next(CFXJSE_Arguments* pArguments) {
@@ -3728,7 +3743,8 @@ 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")));
+ FXJSE_Value_SetUTF8String(hValue,
+ FX_UTF8Encode(FX_WSTRC(L"0")).AsByteStringC());
}
void CXFA_Node::Script_Encrypt_Format(FXJSE_HVALUE hValue,
FX_BOOL bSetting,
diff --git a/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp
index f616596a7f..4cfcf1cbc7 100644
--- a/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp
@@ -34,7 +34,7 @@ void Script_EventPseudoModel_StringProperty(FXJSE_HVALUE hValue,
FXJSE_Value_ToUTF8String(hValue, bsValue);
wsValue = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength());
} else {
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsByteStringC());
}
}
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 ad20b76380..74c6300e02 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));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsByteStringC());
}
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));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppType).AsByteStringC());
}
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));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppType).AsByteStringC());
}
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));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsLanguage).AsByteStringC());
}
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));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsPlatform).AsByteStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_Title(
FXJSE_HVALUE hValue,
@@ -169,7 +169,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Title(
}
CFX_WideString wsTitle;
pNotify->GetDocProvider()->GetTitle(hDoc, wsTitle);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsTitle));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsTitle).AsByteStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_ValidationsEnabled(
FXJSE_HVALUE hValue,
@@ -205,7 +205,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Variation(
}
CFX_WideString wsVariation;
pNotify->GetAppProvider()->GetVariation(wsVariation);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVariation));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVariation).AsByteStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_Version(
FXJSE_HVALUE hValue,
@@ -221,7 +221,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Version(
}
CFX_WideString wsVersion;
pNotify->GetAppProvider()->GetVersion(wsVersion);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVersion));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVersion).AsByteStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitVersion(
FXJSE_HVALUE hValue,
@@ -237,7 +237,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitVersion(
}
CFX_WideString wsVersion;
pNotify->GetAppProvider()->GetFoxitVersion(wsVersion);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVersion));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVersion).AsByteStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_Name(
FXJSE_HVALUE hValue,
@@ -253,7 +253,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Name(
}
CFX_WideString wsAppName;
pNotify->GetAppProvider()->GetAppName(wsAppName);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppName));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppName).AsByteStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitName(
FXJSE_HVALUE hValue,
@@ -269,7 +269,8 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitName(
}
CFX_WideString wsFoxitAppName;
pNotify->GetAppProvider()->GetFoxitAppName(wsFoxitAppName);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsFoxitAppName));
+ FXJSE_Value_SetUTF8String(hValue,
+ FX_UTF8Encode(wsFoxitAppName).AsByteStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_GotoURL(
CFXJSE_Arguments* pArguments) {
@@ -388,7 +389,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Response(
wsDefaultAnswer, bMark);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAnswer));
+ FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAnswer).AsByteStringC());
}
}
void CScript_HostPseudoModel::Script_HostPseudoModel_DocumentInBatch(
@@ -801,6 +802,7 @@ 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));
+ FXJSE_Value_SetUTF8String(hValue,
+ FX_UTF8Encode(wsDataTime).AsByteStringC());
}
}