summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-06 10:51:14 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-06 10:51:14 -0700
commit6fe7d2174a47107578da912299c93b4dfb9f2add (patch)
tree4f2d343c477c9a4ec18d25801800eb08d8938dad /xfa
parent89bdd0876e6b92c959839908204eb82337a27ba2 (diff)
downloadpdfium-6fe7d2174a47107578da912299c93b4dfb9f2add.tar.xz
Make CFX_WideString::FromUTF8() take a CFX_ByteStringC argument.
Methods that take string arguments and do not persist them should take *StringC types as argument rather than discrete ptr/len args. Avoids a number of implicit casts from CFX_ByteString to char*. BUG= Review URL: https://codereview.chromium.org/1861183002
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fxbarcode/BC_UtilCodingConvert.cpp5
-rw-r--r--xfa/fxbarcode/cbc_codabar.cpp2
-rw-r--r--xfa/fxbarcode/cbc_code128.cpp2
-rw-r--r--xfa/fxbarcode/cbc_code39.cpp2
-rw-r--r--xfa/fxbarcode/cbc_datamatrix.cpp2
-rw-r--r--xfa/fxbarcode/cbc_ean13.cpp2
-rw-r--r--xfa/fxbarcode/cbc_ean8.cpp2
-rw-r--r--xfa/fxbarcode/cbc_pdf417i.cpp2
-rw-r--r--xfa/fxbarcode/cbc_qrcode.cpp2
-rw-r--r--xfa/fxbarcode/cbc_upca.cpp2
-rw-r--r--xfa/fxfa/app/xfa_ffwidgetacc.cpp2
-rw-r--r--xfa/fxfa/fm2js/xfa_fm2jscontext.cpp160
-rw-r--r--xfa/fxfa/parser/xfa_document_serialize.cpp5
-rw-r--r--xfa/fxfa/parser/xfa_object_imp.cpp140
-rw-r--r--xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp2
-rw-r--r--xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp24
-rw-r--r--xfa/fxfa/parser/xfa_script_imp.cpp21
-rw-r--r--xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp4
-rw-r--r--xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp5
-rw-r--r--xfa/fxfa/parser/xfa_utils_imp.cpp3
20 files changed, 162 insertions, 227 deletions
diff --git a/xfa/fxbarcode/BC_UtilCodingConvert.cpp b/xfa/fxbarcode/BC_UtilCodingConvert.cpp
index 8421e280f3..79311691e2 100644
--- a/xfa/fxbarcode/BC_UtilCodingConvert.cpp
+++ b/xfa/fxbarcode/BC_UtilCodingConvert.cpp
@@ -36,14 +36,15 @@ void CBC_UtilCodingConvert::Utf8ToLocale(const CFX_ByteArray& src,
for (int32_t i = 0; i < src.GetSize(); i++) {
utf8 += src[i];
}
- CFX_WideString unicode = CFX_WideString::FromUTF8(utf8, utf8.GetLength());
+ CFX_WideString unicode = CFX_WideString::FromUTF8(utf8.AsByteStringC());
dst = CFX_ByteString::FromUnicode(unicode);
}
void CBC_UtilCodingConvert::Utf8ToLocale(const uint8_t* src,
int32_t count,
CFX_ByteString& dst) {
- CFX_WideString unicode = CFX_WideString::FromUTF8((const char*)src, count);
+ CFX_WideString unicode =
+ CFX_WideString::FromUTF8(CFX_ByteStringC(src, count));
dst = CFX_ByteString::FromUnicode(unicode);
}
diff --git a/xfa/fxbarcode/cbc_codabar.cpp b/xfa/fxbarcode/cbc_codabar.cpp
index d038904095..ae2b1f2ba2 100644
--- a/xfa/fxbarcode/cbc_codabar.cpp
+++ b/xfa/fxbarcode/cbc_codabar.cpp
@@ -120,5 +120,5 @@ CFX_WideString CBC_Codabar::Decode(CFX_DIBitmap* pBitmap, int32_t& e) {
CBC_BinaryBitmap bitmap(&binarizer);
CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
- return CFX_WideString::FromUTF8(str, str.GetLength());
+ return CFX_WideString::FromUTF8(str.AsByteStringC());
}
diff --git a/xfa/fxbarcode/cbc_code128.cpp b/xfa/fxbarcode/cbc_code128.cpp
index 2f7be93140..93417b4e16 100644
--- a/xfa/fxbarcode/cbc_code128.cpp
+++ b/xfa/fxbarcode/cbc_code128.cpp
@@ -103,5 +103,5 @@ CFX_WideString CBC_Code128::Decode(CFX_DIBitmap* pBitmap, int32_t& e) {
CBC_BinaryBitmap bitmap(&binarizer);
CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
- return CFX_WideString::FromUTF8(str, str.GetLength());
+ return CFX_WideString::FromUTF8(str.AsByteStringC());
}
diff --git a/xfa/fxbarcode/cbc_code39.cpp b/xfa/fxbarcode/cbc_code39.cpp
index a590f7e39a..69549406e3 100644
--- a/xfa/fxbarcode/cbc_code39.cpp
+++ b/xfa/fxbarcode/cbc_code39.cpp
@@ -111,7 +111,7 @@ CFX_WideString CBC_Code39::Decode(CFX_DIBitmap* pBitmap, int32_t& e) {
CBC_BinaryBitmap bitmap(&binarizer);
CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
- return CFX_WideString::FromUTF8(str, str.GetLength());
+ return CFX_WideString::FromUTF8(str.AsByteStringC());
}
FX_BOOL CBC_Code39::SetTextLocation(BC_TEXT_LOC location) {
diff --git a/xfa/fxbarcode/cbc_datamatrix.cpp b/xfa/fxbarcode/cbc_datamatrix.cpp
index d3e1a073a5..6eb2e34af4 100644
--- a/xfa/fxbarcode/cbc_datamatrix.cpp
+++ b/xfa/fxbarcode/cbc_datamatrix.cpp
@@ -79,5 +79,5 @@ CFX_WideString CBC_DataMatrix::Decode(CFX_DIBitmap* pBitmap, int32_t& e) {
CBC_BinaryBitmap bitmap(&binarizer);
CFX_ByteString retStr = m_pBCReader->Decode(&bitmap, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
- return CFX_WideString::FromUTF8(retStr, retStr.GetLength());
+ return CFX_WideString::FromUTF8(retStr.AsByteStringC());
}
diff --git a/xfa/fxbarcode/cbc_ean13.cpp b/xfa/fxbarcode/cbc_ean13.cpp
index 149c5a6a63..bb578b286e 100644
--- a/xfa/fxbarcode/cbc_ean13.cpp
+++ b/xfa/fxbarcode/cbc_ean13.cpp
@@ -111,5 +111,5 @@ CFX_WideString CBC_EAN13::Decode(CFX_DIBitmap* pBitmap, int32_t& e) {
CBC_BinaryBitmap bitmap(&binarizer);
CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
- return CFX_WideString::FromUTF8(str, str.GetLength());
+ return CFX_WideString::FromUTF8(str.AsByteStringC());
}
diff --git a/xfa/fxbarcode/cbc_ean8.cpp b/xfa/fxbarcode/cbc_ean8.cpp
index 12a821385b..3316963ea0 100644
--- a/xfa/fxbarcode/cbc_ean8.cpp
+++ b/xfa/fxbarcode/cbc_ean8.cpp
@@ -110,5 +110,5 @@ CFX_WideString CBC_EAN8::Decode(CFX_DIBitmap* pBitmap, int32_t& e) {
CBC_BinaryBitmap bitmap(&binarizer);
CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
- return CFX_WideString::FromUTF8(str, str.GetLength());
+ return CFX_WideString::FromUTF8(str.AsByteStringC());
}
diff --git a/xfa/fxbarcode/cbc_pdf417i.cpp b/xfa/fxbarcode/cbc_pdf417i.cpp
index b27af1cefc..1f9f1ff257 100644
--- a/xfa/fxbarcode/cbc_pdf417i.cpp
+++ b/xfa/fxbarcode/cbc_pdf417i.cpp
@@ -87,5 +87,5 @@ CFX_WideString CBC_PDF417I::Decode(CFX_DIBitmap* pBitmap, int32_t& e) {
CBC_BinaryBitmap bitmap(&binarizer);
CFX_ByteString bytestring = m_pBCReader->Decode(&bitmap, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
- return CFX_WideString::FromUTF8(bytestring, bytestring.GetLength());
+ return CFX_WideString::FromUTF8(bytestring.AsByteStringC());
}
diff --git a/xfa/fxbarcode/cbc_qrcode.cpp b/xfa/fxbarcode/cbc_qrcode.cpp
index 4518594944..f0261d79b6 100644
--- a/xfa/fxbarcode/cbc_qrcode.cpp
+++ b/xfa/fxbarcode/cbc_qrcode.cpp
@@ -97,5 +97,5 @@ CFX_WideString CBC_QRCode::Decode(CFX_DIBitmap* pBitmap, int32_t& e) {
CBC_BinaryBitmap bitmap(&binarizer);
CFX_ByteString retStr = m_pBCReader->Decode(&bitmap, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
- return CFX_WideString::FromUTF8(retStr, retStr.GetLength());
+ return CFX_WideString::FromUTF8(retStr.AsByteStringC());
}
diff --git a/xfa/fxbarcode/cbc_upca.cpp b/xfa/fxbarcode/cbc_upca.cpp
index 79aa922e46..a770bb4e20 100644
--- a/xfa/fxbarcode/cbc_upca.cpp
+++ b/xfa/fxbarcode/cbc_upca.cpp
@@ -113,5 +113,5 @@ CFX_WideString CBC_UPCA::Decode(CFX_DIBitmap* pBitmap, int32_t& e) {
CBC_BinaryBitmap bitmap(&binarizer);
CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
- return CFX_WideString::FromUTF8(str, str.GetLength());
+ return CFX_WideString::FromUTF8(str.AsByteStringC());
}
diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
index fb2b0c3ffd..e5b70d6a81 100644
--- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp
+++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
@@ -696,7 +696,7 @@ int32_t CXFA_WidgetAcc::ExecuteScript(CXFA_Script script,
CFX_ByteString bsString;
FXJSE_Value_ToUTF8String(hRetValue, bsString);
pEventParam->m_wsResult =
- CFX_WideString::FromUTF8(bsString, bsString.GetLength());
+ CFX_WideString::FromUTF8(bsString.AsByteStringC());
}
iRet = XFA_EVENTERROR_Success;
} else {
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
index dfd7313d12..9646756f6e 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
+++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
@@ -1102,8 +1102,7 @@ void CXFA_FM2JSContext::IsoTime2Num(FXJSE_HOBJECT hThis,
return;
}
CXFA_LocaleValue timeValue(
- XFA_VT_TIME,
- CFX_WideString::FromUTF8(szArgString, szArgString.GetLength()),
+ XFA_VT_TIME, CFX_WideString::FromUTF8(szArgString.AsByteStringC()),
(CXFA_LocaleMgr*)pMgr);
if (timeValue.IsValid()) {
CFX_Unitime uniTime = timeValue.GetTime();
@@ -1589,21 +1588,19 @@ void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis,
pLocale = widgetData.GetLocal();
} else {
pLocale = pMgr->GetLocaleByName(
- CFX_WideString::FromUTF8(localString, localString.GetLength())
+ CFX_WideString::FromUTF8(localString.AsByteStringC())
.AsWideStringC());
}
CFX_WideString wsFormat;
if (formatString.IsEmpty()) {
pLocale->GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY_Default, wsFormat);
} else {
- wsFormat =
- CFX_WideString::FromUTF8(formatString, formatString.GetLength());
+ wsFormat = CFX_WideString::FromUTF8(formatString.AsByteStringC());
}
wsFormat = FX_WSTRC(L"time{") + wsFormat;
wsFormat += FX_WSTRC(L"}");
CXFA_LocaleValue timeValue(
- XFA_VT_TIME,
- CFX_WideString::FromUTF8(timeString, timeString.GetLength()),
+ XFA_VT_TIME, CFX_WideString::FromUTF8(timeString.AsByteStringC()),
wsFormat, pLocale, (CXFA_LocaleMgr*)pMgr);
if (timeValue.IsValid()) {
CFX_Unitime uniTime = timeValue.GetTime();
@@ -2040,8 +2037,7 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoDate(FXJSE_HOBJECT hThis,
pLocale = widgetData.GetLocal();
} else {
pLocale = pMgr->GetLocaleByName(
- CFX_WideString::FromUTF8(szLocale.c_str(), szLocale.GetLength())
- .AsWideStringC());
+ CFX_WideString::FromUTF8(szLocale).AsWideStringC());
}
if (!pLocale) {
return FALSE;
@@ -2050,11 +2046,10 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoDate(FXJSE_HOBJECT hThis,
if (szFormat.IsEmpty()) {
pLocale->GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY_Default, wsFormat);
} else {
- wsFormat = CFX_WideString::FromUTF8(szFormat.c_str(), szFormat.GetLength());
+ wsFormat = CFX_WideString::FromUTF8(szFormat);
}
- CXFA_LocaleValue widgetValue(
- XFA_VT_DATE, CFX_WideString::FromUTF8(szDate.c_str(), szDate.GetLength()),
- wsFormat, pLocale, (CXFA_LocaleMgr*)pMgr);
+ CXFA_LocaleValue widgetValue(XFA_VT_DATE, CFX_WideString::FromUTF8(szDate),
+ wsFormat, pLocale, (CXFA_LocaleMgr*)pMgr);
CFX_Unitime dt = widgetValue.GetDate();
strIsoDate.Format("%4d-%02d-%02d", dt.GetYear(), dt.GetMonth(), dt.GetDay());
return TRUE;
@@ -2079,8 +2074,7 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoTime(FXJSE_HOBJECT hThis,
pLocale = widgetData.GetLocal();
} else {
pLocale = pMgr->GetLocaleByName(
- CFX_WideString::FromUTF8(szLocale.c_str(), szLocale.GetLength())
- .AsWideStringC());
+ CFX_WideString::FromUTF8(szLocale).AsWideStringC());
}
if (!pLocale) {
return FALSE;
@@ -2089,13 +2083,12 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoTime(FXJSE_HOBJECT hThis,
if (szFormat.IsEmpty()) {
pLocale->GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY_Default, wsFormat);
} else {
- wsFormat = CFX_WideString::FromUTF8(szFormat.c_str(), szFormat.GetLength());
+ wsFormat = CFX_WideString::FromUTF8(szFormat);
}
wsFormat = FX_WSTRC(L"time{") + wsFormat;
wsFormat += FX_WSTRC(L"}");
- CXFA_LocaleValue widgetValue(
- XFA_VT_TIME, CFX_WideString::FromUTF8(szTime.c_str(), szTime.GetLength()),
- wsFormat, pLocale, (CXFA_LocaleMgr*)pMgr);
+ CXFA_LocaleValue widgetValue(XFA_VT_TIME, CFX_WideString::FromUTF8(szTime),
+ wsFormat, pLocale, (CXFA_LocaleMgr*)pMgr);
CFX_Unitime utime = widgetValue.GetTime();
strIsoTime.Format("%02d:%02d:%02d.%03d", utime.GetHour(), utime.GetMinute(),
utime.GetSecond(), utime.GetMillisecond());
@@ -2121,8 +2114,7 @@ FX_BOOL CXFA_FM2JSContext::IsoDate2Local(FXJSE_HOBJECT hThis,
pLocale = widgetData.GetLocal();
} else {
pLocale = pMgr->GetLocaleByName(
- CFX_WideString::FromUTF8(szLocale.c_str(), szLocale.GetLength())
- .AsWideStringC());
+ CFX_WideString::FromUTF8(szLocale).AsWideStringC());
}
if (!pLocale) {
return FALSE;
@@ -2131,11 +2123,10 @@ FX_BOOL CXFA_FM2JSContext::IsoDate2Local(FXJSE_HOBJECT hThis,
if (szFormat.IsEmpty()) {
pLocale->GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY_Default, wsFormat);
} else {
- wsFormat = CFX_WideString::FromUTF8(szFormat.c_str(), szFormat.GetLength());
+ wsFormat = CFX_WideString::FromUTF8(szFormat);
}
- CXFA_LocaleValue widgetValue(
- XFA_VT_DATE, CFX_WideString::FromUTF8(szDate.c_str(), szDate.GetLength()),
- (CXFA_LocaleMgr*)pMgr);
+ CXFA_LocaleValue widgetValue(XFA_VT_DATE, CFX_WideString::FromUTF8(szDate),
+ (CXFA_LocaleMgr*)pMgr);
CFX_WideString wsRet;
widgetValue.FormatPatterns(wsRet, wsFormat, pLocale,
XFA_VALUEPICTURE_Display);
@@ -2162,8 +2153,7 @@ FX_BOOL CXFA_FM2JSContext::IsoTime2Local(FXJSE_HOBJECT hThis,
pLocale = widgetData.GetLocal();
} else {
pLocale = pMgr->GetLocaleByName(
- CFX_WideString::FromUTF8(szLocale.c_str(), szLocale.GetLength())
- .AsWideStringC());
+ CFX_WideString::FromUTF8(szLocale).AsWideStringC());
}
if (!pLocale) {
return FALSE;
@@ -2172,13 +2162,12 @@ FX_BOOL CXFA_FM2JSContext::IsoTime2Local(FXJSE_HOBJECT hThis,
if (szFormat.IsEmpty()) {
pLocale->GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY_Default, wsFormat);
} else {
- wsFormat = CFX_WideString::FromUTF8(szFormat.c_str(), szFormat.GetLength());
+ wsFormat = CFX_WideString::FromUTF8(szFormat);
}
wsFormat = FX_WSTRC(L"time{") + wsFormat;
wsFormat += FX_WSTRC(L"}");
- CXFA_LocaleValue widgetValue(
- XFA_VT_TIME, CFX_WideString::FromUTF8(szTime.c_str(), szTime.GetLength()),
- (CXFA_LocaleMgr*)pMgr);
+ CXFA_LocaleValue widgetValue(XFA_VT_TIME, CFX_WideString::FromUTF8(szTime),
+ (CXFA_LocaleMgr*)pMgr);
CFX_WideString wsRet;
widgetValue.FormatPatterns(wsRet, wsFormat, pLocale,
XFA_VALUEPICTURE_Display);
@@ -2205,8 +2194,7 @@ FX_BOOL CXFA_FM2JSContext::GetGMTTime(FXJSE_HOBJECT hThis,
pLocale = widgetData.GetLocal();
} else {
pLocale = pMgr->GetLocaleByName(
- CFX_WideString::FromUTF8(szLocale.c_str(), szLocale.GetLength())
- .AsWideStringC());
+ CFX_WideString::FromUTF8(szLocale).AsWideStringC());
}
if (!pLocale) {
return FALSE;
@@ -2215,13 +2203,12 @@ FX_BOOL CXFA_FM2JSContext::GetGMTTime(FXJSE_HOBJECT hThis,
if (szFormat.IsEmpty()) {
pLocale->GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY_Default, wsFormat);
} else {
- wsFormat = CFX_WideString::FromUTF8(szFormat.c_str(), szFormat.GetLength());
+ wsFormat = CFX_WideString::FromUTF8(szFormat);
}
wsFormat = FX_WSTRC(L"time{") + wsFormat;
wsFormat += FX_WSTRC(L"}");
- CXFA_LocaleValue widgetValue(
- XFA_VT_TIME, CFX_WideString::FromUTF8(szTime.c_str(), szTime.GetLength()),
- (CXFA_LocaleMgr*)pMgr);
+ CXFA_LocaleValue widgetValue(XFA_VT_TIME, CFX_WideString::FromUTF8(szTime),
+ (CXFA_LocaleMgr*)pMgr);
CFX_WideString wsRet;
widgetValue.FormatPatterns(wsRet, wsFormat, pLocale,
XFA_VALUEPICTURE_Display);
@@ -2389,8 +2376,7 @@ void CXFA_FM2JSContext::GetLocalDateFormat(FXJSE_HOBJECT hThis,
pLocale = widgetData.GetLocal();
} else {
pLocale = pMgr->GetLocaleByName(
- CFX_WideString::FromUTF8(szLocalStr.c_str(), szLocalStr.GetLength())
- .AsWideStringC());
+ CFX_WideString::FromUTF8(szLocalStr).AsWideStringC());
}
if (!pLocale) {
return;
@@ -2445,8 +2431,7 @@ void CXFA_FM2JSContext::GetLocalTimeFormat(FXJSE_HOBJECT hThis,
pLocale = widgetData.GetLocal();
} else {
pLocale = pMgr->GetLocaleByName(
- CFX_WideString::FromUTF8(szLocalStr.c_str(), szLocalStr.GetLength())
- .AsWideStringC());
+ CFX_WideString::FromUTF8(szLocalStr).AsWideStringC());
}
if (!pLocale) {
return;
@@ -3265,10 +3250,10 @@ void CXFA_FM2JSContext::Eval(FXJSE_HOBJECT hThis,
CFX_WideTextBuf wsJavaScriptBuf;
CFX_WideString javaScript;
CFX_WideString wsError;
- XFA_FM2JS_Translate(CFX_WideString::FromUTF8(utf8ScriptString,
- utf8ScriptString.GetLength())
- .AsWideStringC(),
- wsJavaScriptBuf, wsError);
+ XFA_FM2JS_Translate(
+ CFX_WideString::FromUTF8(utf8ScriptString.AsByteStringC())
+ .AsWideStringC(),
+ wsJavaScriptBuf, wsError);
FXJSE_HCONTEXT hContext = FXJSE_Context_Create(hruntime);
FXJSE_HVALUE returnValue = FXJSE_Value_Create(hruntime);
javaScript = wsJavaScriptBuf.GetWideString();
@@ -3389,7 +3374,7 @@ void CXFA_FM2JSContext::UnitType(FXJSE_HOBJECT hThis,
};
unitspanString.MakeLower();
CFX_WideString wsTypeString =
- CFX_WideString::FromUTF8(unitspanString, unitspanString.GetLength());
+ CFX_WideString::FromUTF8(unitspanString.AsByteStringC());
const FX_WCHAR* pData = wsTypeString;
int32_t u = 0;
int32_t uLen = wsTypeString.GetLength();
@@ -3749,8 +3734,7 @@ void CXFA_FM2JSContext::Decode(FXJSE_HOBJECT hThis,
}
void CXFA_FM2JSContext::DecodeURL(const CFX_ByteStringC& szURLString,
CFX_ByteTextBuf& szResultString) {
- CFX_WideString wsURLString =
- CFX_WideString::FromUTF8(szURLString.c_str(), szURLString.GetLength());
+ CFX_WideString wsURLString = CFX_WideString::FromUTF8(szURLString);
const FX_WCHAR* pData = wsURLString;
int32_t iLen = wsURLString.GetLength();
int32_t i = 0;
@@ -3805,8 +3789,7 @@ void CXFA_FM2JSContext::DecodeURL(const CFX_ByteStringC& szURLString,
}
void CXFA_FM2JSContext::DecodeHTML(const CFX_ByteStringC& szHTMLString,
CFX_ByteTextBuf& szResultString) {
- CFX_WideString wsHTMLString =
- CFX_WideString::FromUTF8(szHTMLString.c_str(), szHTMLString.GetLength());
+ CFX_WideString wsHTMLString = CFX_WideString::FromUTF8(szHTMLString);
FX_WCHAR strString[9];
int32_t iStrIndex = 0;
int32_t iLen = wsHTMLString.GetLength();
@@ -3880,8 +3863,7 @@ void CXFA_FM2JSContext::DecodeHTML(const CFX_ByteStringC& szHTMLString,
}
void CXFA_FM2JSContext::DecodeXML(const CFX_ByteStringC& szXMLString,
CFX_ByteTextBuf& szResultString) {
- CFX_WideString wsXMLString =
- CFX_WideString::FromUTF8(szXMLString.c_str(), szXMLString.GetLength());
+ CFX_WideString wsXMLString = CFX_WideString::FromUTF8(szXMLString);
FX_WCHAR strString[9];
int32_t iStrIndex = 0;
int32_t iLen = wsXMLString.GetLength();
@@ -4025,8 +4007,7 @@ void CXFA_FM2JSContext::Encode(FXJSE_HOBJECT hThis,
}
void CXFA_FM2JSContext::EncodeURL(const CFX_ByteStringC& szURLString,
CFX_ByteTextBuf& szResultBuf) {
- CFX_WideString wsURLString =
- CFX_WideString::FromUTF8(szURLString.c_str(), szURLString.GetLength());
+ CFX_WideString wsURLString = CFX_WideString::FromUTF8(szURLString);
CFX_WideTextBuf wsResultBuf;
FX_WCHAR ch = 0;
int32_t iLength = wsURLString.GetLength();
@@ -4134,7 +4115,7 @@ void CXFA_FM2JSContext::EncodeURL(const CFX_ByteStringC& szURLString,
void CXFA_FM2JSContext::EncodeHTML(const CFX_ByteStringC& szHTMLString,
CFX_ByteTextBuf& szResultBuf) {
CFX_ByteString str = szHTMLString.c_str();
- CFX_WideString wsHTMLString = CFX_WideString::FromUTF8(str, str.GetLength());
+ CFX_WideString wsHTMLString = CFX_WideString::FromUTF8(str.AsByteStringC());
const FX_WCHAR* strCode = L"0123456789abcdef";
FX_WCHAR strEncode[9];
strEncode[0] = '&';
@@ -4187,8 +4168,7 @@ void CXFA_FM2JSContext::EncodeHTML(const CFX_ByteStringC& szHTMLString,
}
void CXFA_FM2JSContext::EncodeXML(const CFX_ByteStringC& szXMLString,
CFX_ByteTextBuf& szResultBuf) {
- CFX_WideString wsXMLString =
- CFX_WideString::FromUTF8(szXMLString.c_str(), szXMLString.GetLength());
+ CFX_WideString wsXMLString = CFX_WideString::FromUTF8(szXMLString);
CFX_WideTextBuf wsResultBuf;
enum {
QUOT,
@@ -4311,8 +4291,7 @@ FX_BOOL CXFA_FM2JSContext::HTMLCode2STR(uint32_t iCode,
}
static FX_BOOL XFA_PATTERN_STRING_Type(const CFX_ByteStringC& szPattern,
uint32_t& patternType) {
- CFX_WideString wsPattern =
- CFX_WideString::FromUTF8(szPattern.c_str(), szPattern.GetLength());
+ CFX_WideString wsPattern = CFX_WideString::FromUTF8(szPattern);
if (FX_WSTRC(L"datetime") == wsPattern.Left(8)) {
patternType = XFA_VT_DATETIME;
return TRUE;
@@ -4417,9 +4396,8 @@ void CXFA_FM2JSContext::Format(FXJSE_HOBJECT hThis,
FX_BOOL bCompelte =
XFA_PATTERN_STRING_Type(szPattern.AsByteStringC(), patternType);
CFX_WideString wsPattern =
- CFX_WideString::FromUTF8(szPattern, szPattern.GetLength());
- CFX_WideString wsValue =
- CFX_WideString::FromUTF8(szValue, szValue.GetLength());
+ CFX_WideString::FromUTF8(szPattern.AsByteStringC());
+ CFX_WideString wsValue = CFX_WideString::FromUTF8(szValue.AsByteStringC());
if (!bCompelte) {
switch (patternType) {
case XFA_VT_DATETIME: {
@@ -4552,7 +4530,7 @@ void CXFA_FM2JSContext::Lower(FXJSE_HOBJECT hThis,
HValueToUTF8String(argOne, argString);
CFX_WideTextBuf lowStringBuf;
CFX_WideString wsArgString =
- CFX_WideString::FromUTF8(argString, argString.GetLength());
+ CFX_WideString::FromUTF8(argString.AsByteStringC());
const FX_WCHAR* pData = wsArgString;
int32_t iLen = argString.GetLength();
int32_t i = 0;
@@ -4633,9 +4611,9 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis,
FX_BOOL bCompletePattern =
XFA_PATTERN_STRING_Type(szPattern.AsByteStringC(), patternType);
CFX_WideString wsPattern =
- CFX_WideString::FromUTF8(szPattern, szPattern.GetLength());
+ CFX_WideString::FromUTF8(szPattern.AsByteStringC());
CFX_WideString wsValue =
- CFX_WideString::FromUTF8(szValue, szValue.GetLength());
+ CFX_WideString::FromUTF8(szValue.AsByteStringC());
CFX_ByteString szParsedValue;
if (bCompletePattern) {
CXFA_LocaleValue localeValue(patternType, wsValue, wsPattern, pLocale,
@@ -5180,7 +5158,7 @@ void CXFA_FM2JSContext::Upper(FXJSE_HOBJECT hThis,
HValueToUTF8String(argOne, argString);
CFX_WideTextBuf upperStringBuf;
CFX_WideString wsArgString =
- CFX_WideString::FromUTF8(argString, argString.GetLength());
+ CFX_WideString::FromUTF8(argString.AsByteStringC());
const FX_WCHAR* pData = wsArgString;
int32_t iLen = wsArgString.GetLength();
int32_t i = 0;
@@ -5490,8 +5468,7 @@ void CXFA_FM2JSContext::Get(FXJSE_HOBJECT hThis,
CFX_ByteString urlString;
HValueToUTF8String(argOne, urlString);
IFX_FileRead* pFile = pAppProvider->DownloadURL(
- CFX_WideString::FromUTF8(urlString, urlString.GetLength())
- .AsWideStringC());
+ CFX_WideString::FromUTF8(urlString.AsByteStringC()).AsWideStringC());
if (pFile) {
int32_t size = pFile->GetSize();
uint8_t* pData = FX_Alloc(uint8_t, size);
@@ -5551,14 +5528,11 @@ void CXFA_FM2JSContext::Post(FXJSE_HOBJECT hThis,
}
CFX_WideString decodedResponse;
FX_BOOL bFlags = pAppProvider->PostRequestURL(
- CFX_WideString::FromUTF8(bsURL, bsURL.GetLength()).AsWideStringC(),
- CFX_WideString::FromUTF8(bsData, bsData.GetLength()).AsWideStringC(),
- CFX_WideString::FromUTF8(bsContentType, bsContentType.GetLength())
- .AsWideStringC(),
- CFX_WideString::FromUTF8(bsEncode, bsEncode.GetLength())
- .AsWideStringC(),
- CFX_WideString::FromUTF8(bsHeader, bsHeader.GetLength())
- .AsWideStringC(),
+ 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(),
decodedResponse);
FXJSE_Value_Release(argOne);
FXJSE_Value_Release(argTwo);
@@ -5615,10 +5589,9 @@ void CXFA_FM2JSContext::Put(FXJSE_HOBJECT hThis,
HValueToUTF8String(argThree, bsEncode);
}
FX_BOOL bFlags = pAppProvider->PutRequestURL(
- CFX_WideString::FromUTF8(bsURL, bsURL.GetLength()).AsWideStringC(),
- CFX_WideString::FromUTF8(bsData, bsData.GetLength()).AsWideStringC(),
- CFX_WideString::FromUTF8(bsEncode, bsEncode.GetLength())
- .AsWideStringC());
+ CFX_WideString::FromUTF8(bsURL.AsByteStringC()).AsWideStringC(),
+ CFX_WideString::FromUTF8(bsData.AsByteStringC()).AsWideStringC(),
+ CFX_WideString::FromUTF8(bsEncode.AsByteStringC()).AsWideStringC());
FXJSE_Value_Release(argOne);
FXJSE_Value_Release(argTwo);
if (argc > 2) {
@@ -6181,9 +6154,9 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis,
FX_Free(rgValues);
} else {
CFX_WideString wsPropertyName =
- CFX_WideString::FromUTF8(szName, szName.GetLength());
+ CFX_WideString::FromUTF8(szName.AsByteStringC());
CFX_WideString wsSomExpression =
- CFX_WideString::FromUTF8(szSomExp, szSomExp.GetLength());
+ CFX_WideString::FromUTF8(szSomExp.AsByteStringC());
pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT,
(const FX_WCHAR*)wsPropertyName,
(const FX_WCHAR*)wsSomExpression);
@@ -6244,9 +6217,9 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis,
FX_Free(hResolveValues);
} else {
CFX_WideString wsPropertyName =
- CFX_WideString::FromUTF8(szName, szName.GetLength());
+ CFX_WideString::FromUTF8(szName.AsByteStringC());
CFX_WideString wsSomExpression =
- CFX_WideString::FromUTF8(szSomExp, szSomExp.GetLength());
+ CFX_WideString::FromUTF8(szSomExp.AsByteStringC());
pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT,
(const FX_WCHAR*)wsPropertyName,
(const FX_WCHAR*)wsSomExpression);
@@ -6329,9 +6302,9 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis,
FX_Free(rgValues);
} else {
CFX_WideString wsPropertyName =
- CFX_WideString::FromUTF8(szName, szName.GetLength());
+ CFX_WideString::FromUTF8(szName.AsByteStringC());
CFX_WideString wsSomExpression =
- CFX_WideString::FromUTF8(szSomExp, szSomExp.GetLength());
+ CFX_WideString::FromUTF8(szSomExp.AsByteStringC());
pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT,
(const FX_WCHAR*)wsPropertyName,
(const FX_WCHAR*)wsSomExpression);
@@ -6391,9 +6364,9 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis,
FX_Free(hResolveValues);
} else {
CFX_WideString wsPropertyName =
- CFX_WideString::FromUTF8(szName, szName.GetLength());
+ CFX_WideString::FromUTF8(szName.AsByteStringC());
CFX_WideString wsSomExpression =
- CFX_WideString::FromUTF8(szSomExp, szSomExp.GetLength());
+ CFX_WideString::FromUTF8(szSomExp.AsByteStringC());
pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT,
(const FX_WCHAR*)wsPropertyName,
(const FX_WCHAR*)wsSomExpression);
@@ -6421,7 +6394,7 @@ void CXFA_FM2JSContext::eval_translation(FXJSE_HOBJECT hThis,
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
} else {
CFX_WideString scriptString =
- CFX_WideString::FromUTF8(argString, argString.GetLength());
+ CFX_WideString::FromUTF8(argString.AsByteStringC());
CFX_WideTextBuf wsJavaScriptBuf;
CFX_WideString wsError;
XFA_FM2JS_Translate(scriptString.AsWideStringC(), wsJavaScriptBuf,
@@ -6893,10 +6866,8 @@ FX_BOOL CXFA_FM2JSContext::GetObjectByName(
XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent;
int32_t iRet = pScriptContext->ResolveObjects(
pScriptContext->GetThisObject(),
- CFX_WideString::FromUTF8(szAccessorName.c_str(),
- szAccessorName.GetLength())
- .AsWideStringC(),
- resoveNodeRS, dwFlags);
+ CFX_WideString::FromUTF8(szAccessorName).AsWideStringC(), resoveNodeRS,
+ dwFlags);
if (iRet >= 1 && resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) {
FXJSE_Value_Set(accessorValue, pScriptContext->GetJSValueFromMap(
resoveNodeRS.nodes.GetAt(0)));
@@ -6910,8 +6881,7 @@ int32_t CXFA_FM2JSContext::ResolveObjects(FXJSE_HOBJECT hThis,
XFA_RESOLVENODE_RS& resoveNodeRS,
FX_BOOL bdotAccessor,
FX_BOOL bHasNoResolveName) {
- CFX_WideString wsSomExpression =
- CFX_WideString::FromUTF8(bsSomExp.c_str(), bsSomExp.GetLength());
+ CFX_WideString wsSomExpression = CFX_WideString::FromUTF8(bsSomExp);
int32_t iRet = -1;
CXFA_FM2JSContext* pContext =
(CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
diff --git a/xfa/fxfa/parser/xfa_document_serialize.cpp b/xfa/fxfa/parser/xfa_document_serialize.cpp
index 516a947ffb..91b8ff129c 100644
--- a/xfa/fxfa/parser/xfa_document_serialize.cpp
+++ b/xfa/fxfa/parser/xfa_document_serialize.cpp
@@ -260,7 +260,7 @@ static void XFA_DataExporter_RegenerateFormFile_Changed(
pTempStream->SetCodePage(FX_CODEPAGE_UTF8);
pRichTextXML->SaveXMLNode(pTempStream);
wsChildren += CFX_WideString::FromUTF8(
- (const FX_CHAR*)pMemStream->GetBuffer(), pMemStream->GetSize());
+ CFX_ByteStringC(pMemStream->GetBuffer(), pMemStream->GetSize()));
pTempStream->Release();
pMemStream->Release();
} else if (pRawValueNode->GetClassID() == XFA_ELEMENT_Sharpxml &&
@@ -434,8 +434,7 @@ void XFA_DataExporter_RegenerateFormFile(CXFA_Node* pNode,
pStream->WriteString(s_pwsTagName, FXSYS_wcslen(s_pwsTagName));
if (pChecksum) {
static const FX_WCHAR* s_pwChecksum = L" checksum=\"";
- CFX_WideString wsChecksum =
- CFX_WideString::FromUTF8(pChecksum, FXSYS_strlen(pChecksum));
+ CFX_WideString wsChecksum = CFX_WideString::FromUTF8(pChecksum);
pStream->WriteString(s_pwChecksum, FXSYS_wcslen(s_pwChecksum));
pStream->WriteString((const FX_WCHAR*)wsChecksum, wsChecksum.GetLength());
pStream->WriteString(L"\"", 1);
diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp
index d078423e36..c0db8111d4 100644
--- a/xfa/fxfa/parser/xfa_object_imp.cpp
+++ b/xfa/fxfa/parser/xfa_object_imp.cpp
@@ -633,10 +633,8 @@ void CXFA_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"resolveNode");
return;
}
- CFX_WideString wsExpression;
- CFX_ByteString bsExpression = pArguments->GetUTF8String(0);
- wsExpression =
- CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength());
+ CFX_WideString wsExpression =
+ CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsByteStringC());
CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
if (!pScriptContext) {
return;
@@ -680,10 +678,8 @@ void CXFA_Node::Script_TreeClass_ResolveNodes(CFXJSE_Arguments* pArguments) {
L"resolveNodes");
return;
}
- CFX_WideString wsExpression;
- CFX_ByteString bsExpression = pArguments->GetUTF8String(0);
- wsExpression =
- CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength());
+ CFX_WideString wsExpression =
+ CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsByteStringC());
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (!hValue) {
return;
@@ -828,10 +824,9 @@ void CXFA_Node::Script_NodeClass_ApplyXSL(CFXJSE_Arguments* pArguments) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"applyXSL");
return;
}
- CFX_WideString wsExpression;
- CFX_ByteString bsExpression = pArguments->GetUTF8String(0);
- wsExpression =
- CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength());
+ CFX_WideString wsExpression =
+ CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsByteStringC());
+ // TODO(tsepez): actually do something here?
}
void CXFA_Node::Script_NodeClass_AssignNode(CFXJSE_Arguments* pArguments) {
int32_t iLength = pArguments->GetLength();
@@ -844,12 +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, bsExpression.GetLength());
+ wsExpression = CFX_WideString::FromUTF8(bsExpression.AsByteStringC());
}
if (iLength >= 2) {
CFX_ByteString bsValue = pArguments->GetUTF8String(1);
- wsValue = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength());
+ wsValue = CFX_WideString::FromUTF8(bsValue.AsByteStringC());
}
if (iLength >= 3) {
iAction = pArguments->GetInt32(2);
@@ -875,10 +869,8 @@ void CXFA_Node::Script_NodeClass_GetAttribute(CFXJSE_Arguments* pArguments) {
L"getAttribute");
return;
}
- CFX_WideString wsExpression;
- CFX_ByteString bsExpression = pArguments->GetUTF8String(0);
- wsExpression =
- CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength());
+ CFX_WideString wsExpression =
+ CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsByteStringC());
CFX_WideString wsValue;
GetAttribute(wsExpression.AsWideStringC(), wsValue);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
@@ -896,8 +888,7 @@ 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, bsExpression.GetLength());
+ wsExpression = CFX_WideString::FromUTF8(bsExpression.AsByteStringC());
}
if (iLength >= 2) {
iValue = pArguments->GetInt32(1);
@@ -921,8 +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, bsExpression.GetLength());
+ wsExpression = CFX_WideString::FromUTF8(bsExpression.AsByteStringC());
}
if (iLength >= 2) {
bParent = pArguments->GetInt32(1) == 0 ? FALSE : TRUE;
@@ -958,8 +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, bsExpression.GetLength());
+ wsExpression = CFX_WideString::FromUTF8(bsExpression.AsByteStringC());
if (wsExpression.IsEmpty()) {
return;
}
@@ -1155,13 +1144,10 @@ void CXFA_Node::Script_NodeClass_SetAttribute(CFXJSE_Arguments* pArguments) {
L"setAttribute");
return;
}
- CFX_WideString wsAttribute;
- CFX_WideString wsAttributeValue;
- CFX_ByteString bsAttributeValue = pArguments->GetUTF8String(0);
- CFX_ByteString bsAttribute = pArguments->GetUTF8String(1);
- wsAttributeValue =
- CFX_WideString::FromUTF8(bsAttributeValue, bsAttributeValue.GetLength());
- wsAttribute = CFX_WideString::FromUTF8(bsAttribute, bsAttribute.GetLength());
+ CFX_WideString wsAttributeValue =
+ CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsByteStringC());
+ CFX_WideString wsAttribute =
+ CFX_WideString::FromUTF8(pArguments->GetUTF8String(1).AsByteStringC());
SetAttribute(wsAttribute.AsWideStringC(), wsAttributeValue.AsWideStringC(),
TRUE);
}
@@ -1178,7 +1164,7 @@ void CXFA_Node::Script_NodeClass_SetElement(CFXJSE_Arguments* pArguments) {
}
if (iLength >= 2) {
CFX_ByteString bsName = pArguments->GetUTF8String(1);
- wsName = CFX_WideString::FromUTF8(bsName, bsName.GetLength());
+ wsName = CFX_WideString::FromUTF8(bsName.AsByteStringC());
}
}
void CXFA_Node::Script_NodeClass_Ns(FXJSE_HVALUE hValue,
@@ -1262,8 +1248,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, bsNameSpace.GetLength());
+ wsNameSpace = CFX_WideString::FromUTF8(bsNameSpace.AsByteStringC());
}
CFX_WideString wsNodeNameSpace;
TryNamespace(wsNodeNameSpace);
@@ -1486,8 +1471,7 @@ 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, szValue.GetLength());
+ CFX_WideString wsValue = CFX_WideString::FromUTF8(szValue.AsByteStringC());
SetAttribute(eAttribute, wsValue.AsWideStringC(), TRUE);
if (eAttribute == XFA_ATTRIBUTE_Use && GetClassID() == XFA_ELEMENT_Desc) {
CFX_WideString wsUseVal = wsValue, wsID, wsSOM;
@@ -1603,15 +1587,15 @@ void CXFA_Node::Script_Som_Message(FXJSE_HVALUE hValue,
switch (iMessageType) {
case XFA_SOM_ValidationMessage:
validate.SetScriptMessageText(
- CFX_WideString::FromUTF8(bsMessage, bsMessage.GetLength()));
+ CFX_WideString::FromUTF8(bsMessage.AsByteStringC()));
break;
case XFA_SOM_FormatMessage:
validate.SetFormatMessageText(
- CFX_WideString::FromUTF8(bsMessage, bsMessage.GetLength()));
+ CFX_WideString::FromUTF8(bsMessage.AsByteStringC()));
break;
case XFA_SOM_MandatoryMessage:
validate.SetNullMessageText(
- CFX_WideString::FromUTF8(bsMessage, bsMessage.GetLength()));
+ CFX_WideString::FromUTF8(bsMessage.AsByteStringC()));
break;
default:
break;
@@ -1680,7 +1664,7 @@ void CXFA_Node::Script_Som_DefaultValue(FXJSE_HVALUE hValue,
FXJSE_Value_ToUTF8String(hValue, newValue);
}
CFX_WideString wsNewValue =
- CFX_WideString::FromUTF8(newValue, newValue.GetLength());
+ CFX_WideString::FromUTF8(newValue.AsByteStringC());
CFX_WideString wsFormatValue(wsNewValue);
CXFA_WidgetData* pContainerWidgetData = NULL;
if (GetPacketID() == XFA_XDPPACKET_Datasets) {
@@ -1865,7 +1849,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, bsValue.GetLength());
+ strColor = CFX_WideString::FromUTF8(bsValue.AsByteStringC());
int32_t r = 0, g = 0, b = 0;
XFA_STRING_TO_RGB(strColor, r, g, b);
FX_ARGB rgb = ArgbEncode(100, r, g, b);
@@ -1895,7 +1879,7 @@ void CXFA_Node::Script_Som_BorderWidth(FXJSE_HVALUE hValue,
if (bSetting) {
CFX_ByteString bsValue;
FXJSE_Value_ToUTF8String(hValue, bsValue);
- wsThickness = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength());
+ wsThickness = CFX_WideString::FromUTF8(bsValue.AsByteStringC());
for (int32_t i = 0; i < iSize; ++i) {
CXFA_Edge edge = border.GetEdge(i);
CXFA_Measurement thickness(wsThickness.AsWideStringC());
@@ -1926,7 +1910,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, bsValue.GetLength());
+ wsColor = CFX_WideString::FromUTF8(bsValue.AsByteStringC());
int32_t r, g, b;
XFA_STRING_TO_RGB(wsColor, r, g, b);
FX_ARGB color = ArgbEncode(0xff, r, g, b);
@@ -1967,7 +1951,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, newValue.GetLength());
+ CFX_WideString::FromUTF8(newValue.AsByteStringC());
CFX_WideString wsFormatValue(wsNewValue);
SetScriptContent(wsNewValue, wsFormatValue, TRUE, TRUE);
} else if (uiType != XFA_ELEMENT_Image) {
@@ -2003,7 +1987,7 @@ void CXFA_Node::Script_Field_DefaultValue(FXJSE_HVALUE hValue,
FXJSE_Value_ToUTF8String(hValue, newValue);
}
CFX_WideString wsNewText =
- CFX_WideString::FromUTF8(newValue, newValue.GetLength());
+ CFX_WideString::FromUTF8(newValue.AsByteStringC());
CXFA_Node* pUIChild = pWidgetData->GetUIChild();
if (pUIChild->GetClassID() == XFA_ELEMENT_NumericEdit) {
int32_t iLeadDigits = 0;
@@ -2065,7 +2049,7 @@ void CXFA_Node::Script_Field_EditValue(FXJSE_HVALUE hValue,
if (bSetting) {
CFX_ByteString bsValue;
FXJSE_Value_ToUTF8String(hValue, bsValue);
- wsValue = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength());
+ wsValue = CFX_WideString::FromUTF8(bsValue.AsByteStringC());
pWidgetData->SetValue(wsValue, XFA_VALUEPICTURE_Edit);
} else {
pWidgetData->GetValue(wsValue, XFA_VALUEPICTURE_Edit);
@@ -2088,7 +2072,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, bsValue.GetLength());
+ wsColor = CFX_WideString::FromUTF8(bsValue.AsByteStringC());
int32_t r, g, b;
XFA_STRING_TO_RGB(wsColor, r, g, b);
FX_ARGB color = ArgbEncode(0xff, r, g, b);
@@ -2117,7 +2101,7 @@ void CXFA_Node::Script_Field_FormattedValue(FXJSE_HVALUE hValue,
if (bSetting) {
CFX_ByteString bsValue;
FXJSE_Value_ToUTF8String(hValue, bsValue);
- wsValue = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength());
+ wsValue = CFX_WideString::FromUTF8(bsValue.AsByteStringC());
pWidgetData->SetValue(wsValue, XFA_VALUEPICTURE_Display);
} else {
pWidgetData->GetValue(wsValue, XFA_VALUEPICTURE_Display);
@@ -2136,7 +2120,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, bsValue.GetLength());
+ wsValue = CFX_WideString::FromUTF8(bsValue.AsByteStringC());
validate.SetNullTest(wsValue);
} else {
int32_t iValue = validate.GetNullTest();
@@ -2192,8 +2176,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, eventString.GetLength())
- .AsWideStringC(),
+ CFX_WideString::FromUTF8(eventString.AsByteStringC()).AsWideStringC(),
XFA_ELEMENT_Field);
if (eventString == "validate") {
FXJSE_Value_SetBoolean(pArguments->GetReturnValue(),
@@ -2270,8 +2253,7 @@ void CXFA_Node::Script_Field_BoundItem(CFXJSE_Arguments* pArguments) {
return;
}
CFX_ByteString bsValue = pArguments->GetUTF8String(0);
- CFX_WideString wsValue =
- CFX_WideString::FromUTF8(bsValue, bsValue.GetLength());
+ CFX_WideString wsValue = CFX_WideString::FromUTF8(bsValue.AsByteStringC());
CFX_WideString wsBoundValue;
pWidgetData->GetItemValue(wsValue.AsWideStringC(), wsBoundValue);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
@@ -2372,12 +2354,12 @@ void CXFA_Node::Script_Field_AddItem(CFXJSE_Arguments* pArguments) {
CFX_WideString wsLabel;
CFX_WideString wsValue;
if (iLength >= 1) {
- CFX_ByteString bsLable = pArguments->GetUTF8String(0);
- wsLabel = CFX_WideString::FromUTF8(bsLable, bsLable.GetLength());
+ CFX_ByteString bsLabel = pArguments->GetUTF8String(0);
+ wsLabel = CFX_WideString::FromUTF8(bsLabel.AsByteStringC());
}
if (iLength >= 2) {
CFX_ByteString bsValue = pArguments->GetUTF8String(1);
- wsValue = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength());
+ wsValue = CFX_WideString::FromUTF8(bsValue.AsByteStringC());
}
pWidgetData->InsertItem(wsLabel, wsValue, -1, TRUE);
}
@@ -2417,8 +2399,8 @@ void CXFA_Node::Script_ExclGroup_DefaultAndRawValue(FXJSE_HVALUE hValue,
CFX_ByteString bsValue;
FXJSE_Value_ToUTF8String(hValue, bsValue);
pWidgetData->SetSelectedMemberByValue(
- CFX_WideString::FromUTF8(bsValue, bsValue.GetLength()).AsWideStringC(),
- TRUE, TRUE);
+ CFX_WideString::FromUTF8(bsValue.AsByteStringC()).AsWideStringC(), TRUE,
+ TRUE);
} else {
CFX_WideString wsValue = GetScriptContent(TRUE);
XFA_VERSION curVersion = GetDocument()->GetCurVersionMode();
@@ -2437,8 +2419,7 @@ void CXFA_Node::Script_ExclGroup_ExecEvent(CFXJSE_Arguments* pArguments) {
if (argc == 1) {
CFX_ByteString eventString = pArguments->GetUTF8String(0);
execSingleEventByName(
- CFX_WideString::FromUTF8(eventString, eventString.GetLength())
- .AsWideStringC(),
+ CFX_WideString::FromUTF8(eventString.AsByteStringC()).AsWideStringC(),
XFA_ELEMENT_ExclGroup);
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execEvent");
@@ -2458,8 +2439,7 @@ void CXFA_Node::Script_ExclGroup_SelectedMember(CFXJSE_Arguments* pArguments) {
CFX_ByteString szName;
szName = pArguments->GetUTF8String(0);
pReturnNode = pWidgetData->SetSelectedMember(
- CFX_WideString::FromUTF8(szName, szName.GetLength())
- .AsWideStringC());
+ CFX_WideString::FromUTF8(szName.AsByteStringC()).AsWideStringC());
}
if (pReturnNode) {
FXJSE_Value_Set(
@@ -2620,8 +2600,8 @@ 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, bsLocaleName.GetLength()),
- TRUE, TRUE);
+ CFX_WideString::FromUTF8(bsLocaleName.AsByteStringC()), TRUE,
+ TRUE);
} else {
CFX_WideString wsLocaleName;
GetLocaleName(wsLocaleName);
@@ -2635,8 +2615,7 @@ void CXFA_Node::Script_Subform_ExecEvent(CFXJSE_Arguments* pArguments) {
if (argc == 1) {
CFX_ByteString eventString = pArguments->GetUTF8String(0);
execSingleEventByName(
- CFX_WideString::FromUTF8(eventString, eventString.GetLength())
- .AsWideStringC(),
+ CFX_WideString::FromUTF8(eventString.AsByteStringC()).AsWideStringC(),
XFA_ELEMENT_Subform);
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execEvent");
@@ -2742,14 +2721,13 @@ 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, bsTagName.GetLength());
+ strTagName = CFX_WideString::FromUTF8(bsTagName.AsByteStringC());
if (argc > 1) {
CFX_ByteString bsName = pArguments->GetUTF8String(1);
- strName = CFX_WideString::FromUTF8(bsName, bsName.GetLength());
+ strName = CFX_WideString::FromUTF8(bsName.AsByteStringC());
if (argc == 3) {
CFX_ByteString bsNameSpace = pArguments->GetUTF8String(2);
- strNameSpace =
- CFX_WideString::FromUTF8(bsNameSpace, bsNameSpace.GetLength());
+ strNameSpace = CFX_WideString::FromUTF8(bsNameSpace.AsByteStringC());
}
}
const XFA_ELEMENTINFO* pElement =
@@ -3519,9 +3497,9 @@ 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, bsChecksum.GetLength())
- .AsWideStringC());
+ SetAttribute(
+ XFA_ATTRIBUTE_Checksum,
+ CFX_WideString::FromUTF8(bsChecksum.AsByteStringC()).AsWideStringC());
} else {
CFX_WideString wsChecksum;
GetAttribute(XFA_ATTRIBUTE_Checksum, wsChecksum, FALSE);
@@ -3538,8 +3516,7 @@ 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,
- bsAttributeName.GetLength()),
+ ->GetString(CFX_WideString::FromUTF8(bsAttributeName.AsByteStringC()),
wsAttributeValue);
}
FXJSE_Value_SetUTF8String(
@@ -3559,8 +3536,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, bsName.GetLength()),
- CFX_WideString::FromUTF8(bsValue, bsValue.GetLength()));
+ ->SetString(CFX_WideString::FromUTF8(bsName.AsByteStringC()),
+ CFX_WideString::FromUTF8(bsValue.AsByteStringC()));
}
FXJSE_Value_SetNull(pArguments->GetReturnValue());
} else {
@@ -3572,8 +3549,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, bsName.GetLength());
+ CFX_WideString wsName = CFX_WideString::FromUTF8(bsName.AsByteStringC());
CFDE_XMLNode* pXMLNode = GetXMLMappingNode();
if (pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element) {
CFDE_XMLElement* pXMLElement = static_cast<CFDE_XMLElement*>(pXMLNode);
@@ -3597,7 +3573,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, bsNewContent.GetLength()));
+ CFX_WideString::FromUTF8(bsNewContent.AsByteStringC()));
}
} else {
CFX_WideString wsTextData;
@@ -5351,7 +5327,7 @@ void CXFA_NodeList::Script_TreelistClass_NamedItem(
if (argc == 1) {
CFX_ByteString szName = pArguments->GetUTF8String(0);
CXFA_Node* pNode = NamedItem(
- CFX_WideString::FromUTF8(szName, szName.GetLength()).AsWideStringC());
+ CFX_WideString::FromUTF8(szName.AsByteStringC()).AsWideStringC());
if (!pNode) {
return;
}
diff --git a/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp
index 4cfcf1cbc7..1daf55a79d 100644
--- a/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp
@@ -32,7 +32,7 @@ void Script_EventPseudoModel_StringProperty(FXJSE_HVALUE hValue,
if (bSetting) {
CFX_ByteString bsValue;
FXJSE_Value_ToUTF8String(hValue, bsValue);
- wsValue = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength());
+ wsValue = CFX_WideString::FromUTF8(bsValue.AsByteStringC());
} else {
FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsByteStringC());
}
diff --git a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
index c71384e130..48edc73777 100644
--- a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
@@ -165,7 +165,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Title(
FXJSE_Value_ToUTF8String(hValue, bsValue);
pNotify->GetDocProvider()->SetTitle(
hDoc,
- CFX_WideString::FromUTF8(bsValue, bsValue.GetLength()).AsWideStringC());
+ CFX_WideString::FromUTF8(bsValue.AsByteStringC()).AsWideStringC());
return;
}
CFX_WideString wsTitle;
@@ -291,7 +291,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_GotoURL(
CFX_WideString wsURL;
if (iLength >= 1) {
CFX_ByteString bsURL = pArguments->GetUTF8String(0);
- wsURL = CFX_WideString::FromUTF8(bsURL, bsURL.GetLength());
+ wsURL = CFX_WideString::FromUTF8(bsURL.AsByteStringC());
}
pNotify->GetDocProvider()->GotoURL(hDoc, wsURL.AsWideStringC());
}
@@ -318,7 +318,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList(
CFX_ByteString bsString;
FXJSE_Value_ToUTF8String(hValue, bsString);
CFX_WideString wsExpression =
- CFX_WideString::FromUTF8(bsString, bsString.GetLength());
+ CFX_WideString::FromUTF8(bsString.AsByteStringC());
CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
if (!pScriptContext) {
FXJSE_Value_Release(hValue);
@@ -371,16 +371,15 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Response(
FX_BOOL bMark = FALSE;
if (iLength >= 1) {
CFX_ByteString bsQuestion = pArguments->GetUTF8String(0);
- wsQuestion = CFX_WideString::FromUTF8(bsQuestion, bsQuestion.GetLength());
+ wsQuestion = CFX_WideString::FromUTF8(bsQuestion.AsByteStringC());
}
if (iLength >= 2) {
CFX_ByteString bsTitle = pArguments->GetUTF8String(1);
- wsTitle = CFX_WideString::FromUTF8(bsTitle, bsTitle.GetLength());
+ wsTitle = CFX_WideString::FromUTF8(bsTitle.AsByteStringC());
}
if (iLength >= 3) {
CFX_ByteString bsDefaultAnswer = pArguments->GetUTF8String(2);
- wsDefaultAnswer =
- CFX_WideString::FromUTF8(bsDefaultAnswer, bsDefaultAnswer.GetLength());
+ wsDefaultAnswer = CFX_WideString::FromUTF8(bsDefaultAnswer.AsByteStringC());
}
if (iLength >= 4) {
bMark = pArguments->GetInt32(3) == 0 ? FALSE : TRUE;
@@ -444,8 +443,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ResetData(
CFX_WideString wsExpression;
if (iLength >= 1) {
CFX_ByteString bsExpression = pArguments->GetUTF8String(0);
- wsExpression =
- CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength());
+ wsExpression = CFX_WideString::FromUTF8(bsExpression.AsByteStringC());
}
if (wsExpression.IsEmpty()) {
pNotify->ResetData();
@@ -523,7 +521,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus(
CFX_ByteString bsString;
FXJSE_Value_ToUTF8String(hValue, bsString);
CFX_WideString wsExpression =
- CFX_WideString::FromUTF8(bsString, bsString.GetLength());
+ CFX_WideString::FromUTF8(bsString.AsByteStringC());
CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
if (!pScriptContext) {
FXJSE_Value_Release(hValue);
@@ -633,7 +631,7 @@ FX_BOOL CScript_HostPseudoModel::Script_HostPseudoModel_ValidateArgsForMsg(
} else {
CFX_ByteString byMessage;
FXJSE_Value_ToUTF8String(hValueArg, byMessage);
- wsValue = CFX_WideString::FromUTF8(byMessage, byMessage.GetLength());
+ wsValue = CFX_WideString::FromUTF8(byMessage.AsByteStringC());
}
FXJSE_Value_Release(hValueArg);
return TRUE;
@@ -733,7 +731,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ImportData(
CFX_WideString wsFilePath;
if (iLength > 0) {
CFX_ByteString bsFilePath = pArguments->GetUTF8String(0);
- wsFilePath = CFX_WideString::FromUTF8(bsFilePath, bsFilePath.GetLength());
+ wsFilePath = CFX_WideString::FromUTF8(bsFilePath.AsByteStringC());
}
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
pNotify->GetDocProvider()->ImportData(hDoc, wsFilePath.AsWideStringC());
@@ -754,7 +752,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ExportData(
FX_BOOL bXDP = TRUE;
if (iLength >= 1) {
CFX_ByteString bsFilePath = pArguments->GetUTF8String(0);
- wsFilePath = CFX_WideString::FromUTF8(bsFilePath, bsFilePath.GetLength());
+ wsFilePath = CFX_WideString::FromUTF8(bsFilePath.AsByteStringC());
}
if (iLength >= 2) {
bXDP = pArguments->GetInt32(1) == 0 ? FALSE : TRUE;
diff --git a/xfa/fxfa/parser/xfa_script_imp.cpp b/xfa/fxfa/parser/xfa_script_imp.cpp
index 0b5cb1d156..e0536fc136 100644
--- a/xfa/fxfa/parser/xfa_script_imp.cpp
+++ b/xfa/fxfa/parser/xfa_script_imp.cpp
@@ -115,8 +115,7 @@ void CXFA_ScriptContext::GlobalPropertySetter(FXJSE_HOBJECT hObject,
CXFA_ScriptContext* lpScriptContext =
(CXFA_ScriptContext*)pDoc->GetScriptContext();
CXFA_Object* lpCurNode = lpScriptContext->GetVariablesThis(lpOrginalNode);
- CFX_WideString wsPropName = CFX_WideString::FromUTF8(
- (const FX_CHAR*)szPropName.raw_str(), szPropName.GetLength());
+ CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName);
uint32_t dwFlag = XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings |
XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties |
XFA_RESOLVENODE_Attributes;
@@ -174,8 +173,7 @@ void CXFA_ScriptContext::GlobalPropertyGetter(FXJSE_HOBJECT hObject,
CXFA_ScriptContext* lpScriptContext =
(CXFA_ScriptContext*)pDoc->GetScriptContext();
CXFA_Object* lpCurNode = lpScriptContext->GetVariablesThis(pOrginalObject);
- CFX_WideString wsPropName = CFX_WideString::FromUTF8(
- (const FX_CHAR*)szPropName.raw_str(), szPropName.GetLength());
+ CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName);
if (lpScriptContext->GetType() == XFA_SCRIPTLANGTYPE_Formcalc) {
if (szPropName == FOXIT_XFA_FM2JS_FORMCALC_RUNTIME) {
XFA_FM2JS_GlobalPropertyGetter(lpScriptContext->m_hFM2JSContext, hValue);
@@ -230,8 +228,7 @@ void CXFA_ScriptContext::NormalPropertyGetter(FXJSE_HOBJECT hObject,
FXJSE_Value_SetUndefined(hValue);
return;
}
- CFX_WideString wsPropName = CFX_WideString::FromUTF8(
- (const FX_CHAR*)szPropName.raw_str(), szPropName.GetLength());
+ CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName);
CXFA_ScriptContext* lpScriptContext =
(CXFA_ScriptContext*)pOrginalObject->GetDocument()->GetScriptContext();
CXFA_Object* pObject = lpScriptContext->GetVariablesThis(pOrginalObject);
@@ -279,8 +276,7 @@ void CXFA_ScriptContext::NormalPropertySetter(FXJSE_HOBJECT hObject,
CXFA_ScriptContext* lpScriptContext =
(CXFA_ScriptContext*)pOrginalObject->GetDocument()->GetScriptContext();
CXFA_Object* pObject = lpScriptContext->GetVariablesThis(pOrginalObject);
- CFX_WideString wsPropName = CFX_WideString::FromUTF8(
- (const FX_CHAR*)szPropName.raw_str(), szPropName.GetLength());
+ CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName);
const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo = XFA_GetScriptAttributeByName(
pObject->GetClassID(), wsPropName.AsWideStringC());
if (lpAttributeInfo) {
@@ -332,8 +328,7 @@ int32_t CXFA_ScriptContext::NormalPropTypeGetter(
(CXFA_ScriptContext*)pObject->GetDocument()->GetScriptContext();
pObject = lpScriptContext->GetVariablesThis(pObject);
XFA_ELEMENT objElement = pObject->GetClassID();
- CFX_WideString wsPropName = CFX_WideString::FromUTF8(
- (const FX_CHAR*)szPropName.raw_str(), szPropName.GetLength());
+ CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName);
if (XFA_GetMethodByName(objElement, wsPropName.AsWideStringC())) {
return FXJSE_ClassPropType_Method;
}
@@ -355,8 +350,7 @@ int32_t CXFA_ScriptContext::GlobalPropTypeGetter(
(CXFA_ScriptContext*)pObject->GetDocument()->GetScriptContext();
pObject = lpScriptContext->GetVariablesThis(pObject);
XFA_ELEMENT objElement = pObject->GetClassID();
- CFX_WideString wsPropName = CFX_WideString::FromUTF8(
- (const FX_CHAR*)szPropName.raw_str(), szPropName.GetLength());
+ CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName);
if (XFA_GetMethodByName(objElement, wsPropName.AsWideStringC())) {
return FXJSE_ClassPropType_Method;
}
@@ -372,8 +366,7 @@ void CXFA_ScriptContext::NormalMethodCall(FXJSE_HOBJECT hThis,
CXFA_ScriptContext* lpScriptContext =
(CXFA_ScriptContext*)pObject->GetDocument()->GetScriptContext();
pObject = lpScriptContext->GetVariablesThis(pObject);
- CFX_WideString wsFunName = CFX_WideString::FromUTF8(
- (const FX_CHAR*)szFuncName.raw_str(), szFuncName.GetLength());
+ CFX_WideString wsFunName = CFX_WideString::FromUTF8(szFuncName);
const XFA_METHODINFO* lpMethodInfo =
XFA_GetMethodByName(pObject->GetClassID(), wsFunName.AsWideStringC());
if (NULL == lpMethodInfo) {
diff --git a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp
index 1b70dffb19..da19b381bb 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, bsUnit.GetLength());
+ wsUnit = CFX_WideString::FromUTF8(bsUnit.AsByteStringC());
}
}
if (iLength >= 3) {
@@ -367,7 +367,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageContent(
}
if (iLength >= 2) {
CFX_ByteString bsType = pArguments->GetUTF8String(1);
- wsType = CFX_WideString::FromUTF8(bsType, bsType.GetLength());
+ wsType = CFX_WideString::FromUTF8(bsType.AsByteStringC());
}
if (iLength >= 3) {
bOnPageArea = pArguments->GetInt32(2) == 0 ? FALSE : TRUE;
diff --git a/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp b/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp
index f460cf764b..c5858e3e66 100644
--- a/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp
@@ -68,12 +68,11 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Sign(
}
if (iLength >= 2) {
CFX_ByteString bsExpression = pArguments->GetUTF8String(1);
- wsExpression =
- CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength());
+ wsExpression = CFX_WideString::FromUTF8(bsExpression.AsByteStringC());
}
if (iLength >= 3) {
CFX_ByteString bsXMLIdent = pArguments->GetUTF8String(2);
- wsXMLIdent = CFX_WideString::FromUTF8(bsXMLIdent, bsXMLIdent.GetLength());
+ wsXMLIdent = CFX_WideString::FromUTF8(bsXMLIdent.AsByteStringC());
}
FX_BOOL bSign = pNotify->GetDocProvider()->Sign(hDoc, pNodeList,
wsExpression.AsWideStringC(),
diff --git a/xfa/fxfa/parser/xfa_utils_imp.cpp b/xfa/fxfa/parser/xfa_utils_imp.cpp
index 3d2e8bed4e..1b3dddc674 100644
--- a/xfa/fxfa/parser/xfa_utils_imp.cpp
+++ b/xfa/fxfa/parser/xfa_utils_imp.cpp
@@ -392,8 +392,7 @@ FX_DOUBLE XFA_WideStringToDouble(const CFX_WideString& wsStringVal) {
}
FX_DOUBLE XFA_ByteStringToDouble(const CFX_ByteStringC& szStringVal) {
- CFX_WideString wsValue =
- CFX_WideString::FromUTF8(szStringVal.c_str(), szStringVal.GetLength());
+ CFX_WideString wsValue = CFX_WideString::FromUTF8(szStringVal);
return XFA_WideStringToDouble(wsValue);
}