diff options
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r-- | xfa/fxfa/parser/cscript_hostpseudomodel.cpp | 20 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_document.cpp | 7 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_node.cpp | 5 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_object.cpp | 5 |
4 files changed, 14 insertions, 23 deletions
diff --git a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp index 7493570bc2..b4559669b7 100644 --- a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp @@ -37,9 +37,8 @@ CScript_HostPseudoModel::~CScript_HostPseudoModel() {} void CScript_HostPseudoModel::LoadString(CFXJSE_Value* pValue, CXFA_FFNotify* pNotify, uint32_t dwFlag) { - CFX_WideString wsValue; - pNotify->GetAppProvider()->LoadString(dwFlag, wsValue); - pValue->SetString(FX_UTF8Encode(wsValue).AsStringC()); + pValue->SetString( + FX_UTF8Encode(pNotify->GetAppProvider()->LoadString(dwFlag)).AsStringC()); } void CScript_HostPseudoModel::AppType(CFXJSE_Value* pValue, @@ -97,9 +96,8 @@ void CScript_HostPseudoModel::Language(CFXJSE_Value* pValue, ThrowException(XFA_IDS_UNABLE_SET_LANGUAGE); return; } - CFX_WideString wsLanguage; - pNotify->GetAppProvider()->GetLanguage(wsLanguage); - pValue->SetString(FX_UTF8Encode(wsLanguage).AsStringC()); + pValue->SetString( + FX_UTF8Encode(pNotify->GetAppProvider()->GetLanguage()).AsStringC()); } void CScript_HostPseudoModel::NumPages(CFXJSE_Value* pValue, @@ -128,9 +126,8 @@ void CScript_HostPseudoModel::Platform(CFXJSE_Value* pValue, ThrowException(XFA_IDS_UNABLE_SET_PLATFORM); return; } - CFX_WideString wsPlatform; - pNotify->GetAppProvider()->GetPlatform(wsPlatform); - pValue->SetString(FX_UTF8Encode(wsPlatform).AsStringC()); + pValue->SetString( + FX_UTF8Encode(pNotify->GetAppProvider()->GetPlatform()).AsStringC()); } void CScript_HostPseudoModel::Title(CFXJSE_Value* pValue, bool bSetting, @@ -210,9 +207,8 @@ void CScript_HostPseudoModel::Name(CFXJSE_Value* pValue, ThrowException(XFA_IDS_INVAlID_PROP_SET); return; } - CFX_WideString wsAppName; - pNotify->GetAppProvider()->GetAppName(wsAppName); - pValue->SetString(FX_UTF8Encode(wsAppName).AsStringC()); + pValue->SetString( + FX_UTF8Encode(pNotify->GetAppProvider()->GetAppName()).AsStringC()); } void CScript_HostPseudoModel::GotoURL(CFXJSE_Arguments* pArguments) { diff --git a/xfa/fxfa/parser/cxfa_document.cpp b/xfa/fxfa/parser/cxfa_document.cpp index cc5f74ae23..b5c7ea1f62 100644 --- a/xfa/fxfa/parser/cxfa_document.cpp +++ b/xfa/fxfa/parser/cxfa_document.cpp @@ -283,10 +283,9 @@ bool CXFA_Document::IsInteractive() { CXFA_LocaleMgr* CXFA_Document::GetLocalMgr() { if (!m_pLocalMgr) { - CFX_WideString wsLanguage; - GetNotify()->GetAppProvider()->GetLanguage(wsLanguage); - m_pLocalMgr = new CXFA_LocaleMgr( - ToNode(GetXFAObject(XFA_HASHCODE_LocaleSet)), wsLanguage); + m_pLocalMgr = + new CXFA_LocaleMgr(ToNode(GetXFAObject(XFA_HASHCODE_LocaleSet)), + GetNotify()->GetAppProvider()->GetLanguage()); } return m_pLocalMgr; } diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index f385b11b69..cabf87fa7f 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -1107,10 +1107,7 @@ void CXFA_Node::Script_TreeClass_Nodes(CFXJSE_Value* pValue, if (!pScriptContext) return; if (bSetting) { - IXFA_AppProvider* pAppProvider = m_pDocument->GetNotify()->GetAppProvider(); - ASSERT(pAppProvider); - CFX_WideString wsMessage; - pAppProvider->LoadString(XFA_IDS_Unable_TO_SET, wsMessage); + CFX_WideString wsMessage = L"Unable to set "; FXJSE_ThrowMessage( FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC()); } else { diff --git a/xfa/fxfa/parser/cxfa_object.cpp b/xfa/fxfa/parser/cxfa_object.cpp index a31060241a..c8ed7138a8 100644 --- a/xfa/fxfa/parser/cxfa_object.cpp +++ b/xfa/fxfa/parser/cxfa_object.cpp @@ -50,12 +50,11 @@ void CXFA_Object::Script_ObjectClass_ClassName(CFXJSE_Value* pValue, void CXFA_Object::ThrowException(int32_t iStringID, ...) { IXFA_AppProvider* pAppProvider = m_pDocument->GetNotify()->GetAppProvider(); ASSERT(pAppProvider); - CFX_WideString wsFormat; - pAppProvider->LoadString(iStringID, wsFormat); + CFX_WideString wsMessage; va_list arg_ptr; va_start(arg_ptr, iStringID); - wsMessage.FormatV(wsFormat.c_str(), arg_ptr); + wsMessage.FormatV(pAppProvider->LoadString(iStringID).c_str(), arg_ptr); va_end(arg_ptr); FXJSE_ThrowMessage( FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC()); |