Cleaning out params in CPDFXFA_Context

This CL cleans up some of the out params in CPDFXFA_Context. In the process
several of the strings returned by ::LoadString() are inlined in their
call sites and the defines removed.

BUG=pdfium:549

Change-Id: I41a7ceeba3962299eecd0cb714ddb03d28dbb0ea
Reviewed-on: https://pdfium-review.googlesource.com/2134
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
index 7a0ffeb..29888c3 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
@@ -231,19 +231,20 @@
   return runtime->GetIsolate();
 }
 
-void CPDFXFA_Context::GetAppName(CFX_WideString& wsName) {
-  if (m_pFormFillEnv)
-    wsName = m_pFormFillEnv->FFI_GetAppName();
+CFX_WideString CPDFXFA_Context::GetAppTitle() const {
+  return L"PDFium";
 }
 
-void CPDFXFA_Context::GetLanguage(CFX_WideString& wsLanguage) {
-  if (m_pFormFillEnv)
-    wsLanguage = m_pFormFillEnv->GetLanguage();
+CFX_WideString CPDFXFA_Context::GetAppName() {
+  return m_pFormFillEnv ? m_pFormFillEnv->FFI_GetAppName() : L"";
 }
 
-void CPDFXFA_Context::GetPlatform(CFX_WideString& wsPlatform) {
-  if (m_pFormFillEnv)
-    wsPlatform = m_pFormFillEnv->GetPlatform();
+CFX_WideString CPDFXFA_Context::GetLanguage() {
+  return m_pFormFillEnv ? m_pFormFillEnv->GetLanguage() : L"";
+}
+
+CFX_WideString CPDFXFA_Context::GetPlatform() {
+  return m_pFormFillEnv ? m_pFormFillEnv->GetPlatform() : L"";
 }
 
 void CPDFXFA_Context::Beep(uint32_t dwType) {
@@ -357,101 +358,46 @@
                                        wsEncode.c_str());
 }
 
-void CPDFXFA_Context::LoadString(int32_t iStringID, CFX_WideString& wsString) {
+CFX_WideString CPDFXFA_Context::LoadString(int32_t iStringID) {
   switch (iStringID) {
-    case XFA_IDS_ValidateFailed:
-      wsString = L"%s validation failed";
-      return;
-    case XFA_IDS_CalcOverride:
-      wsString = L"Calculate Override";
-      return;
-    case XFA_IDS_ModifyField:
-      wsString = L"Are you sure you want to modify this field?";
-      return;
-    case XFA_IDS_NotModifyField:
-      wsString = L"You are not allowed to modify this field.";
-      return;
-    case XFA_IDS_AppName:
-      wsString = L"pdfium";
-      return;
-    case XFA_IDS_Unable_TO_SET:
-      wsString = L"Unable to set ";
-      return;
     case XFA_IDS_INVAlID_PROP_SET:
-      wsString = L"Invalid property set operation.";
-      return;
+      return L"Invalid property set operation.";
     case XFA_IDS_NOT_DEFAUL_VALUE:
-      wsString = L" doesn't have a default property.";
-      return;
+      return L" doesn't have a default property.";
     case XFA_IDS_UNABLE_SET_LANGUAGE:
-      wsString = L"Unable to set language value.";
-      return;
+      return L"Unable to set language value.";
     case XFA_IDS_UNABLE_SET_NUMPAGES:
-      wsString = L"Unable to set numPages value.";
-      return;
+      return L"Unable to set numPages value.";
     case XFA_IDS_UNABLE_SET_PLATFORM:
-      wsString = L"Unable to set platform value.";
-      return;
+      return L"Unable to set platform value.";
     case XFA_IDS_UNABLE_SET_VARIATION:
-      wsString = L"Unable to set variation value.";
-      return;
+      return L"Unable to set variation value.";
     case XFA_IDS_UNABLE_SET_VERSION:
-      wsString = L"Unable to set version value.";
-      return;
+      return L"Unable to set version value.";
     case XFA_IDS_UNABLE_SET_READY:
-      wsString = L"Unable to set ready value.";
-      return;
+      return L"Unable to set ready value.";
     case XFA_IDS_COMPILER_ERROR:
-      wsString = L"Compiler error.";
-      return;
+      return L"Compiler error.";
     case XFA_IDS_DIVIDE_ZERO:
-      wsString = L"Divide by zero.";
-      return;
+      return L"Divide by zero.";
     case XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT:
-      wsString =
-          L"An attempt was made to reference property '%s' of a non-object in "
-          L"SOM expression %s.";
-      return;
+      return L"An attempt was made to reference property '%s' of a non-object "
+             L"in SOM expression %s.";
     case XFA_IDS_INDEX_OUT_OF_BOUNDS:
-      wsString = L"Index value is out of bounds.";
-      return;
+      return L"Index value is out of bounds.";
     case XFA_IDS_INCORRECT_NUMBER_OF_METHOD:
-      wsString = L"Incorrect number of parameters calling method '%s'.";
-      return;
+      return L"Incorrect number of parameters calling method '%s'.";
     case XFA_IDS_ARGUMENT_MISMATCH:
-      wsString = L"Argument mismatch in property or function argument.";
-      return;
+      return L"Argument mismatch in property or function argument.";
     case XFA_IDS_NOT_HAVE_PROPERTY:
-      wsString = L"'%s' doesn't have property '%s'.";
-      return;
+      return L"'%s' doesn't have property '%s'.";
     case XFA_IDS_VIOLATE_BOUNDARY:
-      wsString =
-          L"The element [%s] has violated its allowable number of occurrences.";
-      return;
+      return L"The element [%s] has violated its allowable number of "
+             L"occurrences.";
     case XFA_IDS_SERVER_DENY:
-      wsString = L"Server does not permit.";
-      return;
-    case XFA_IDS_ValidateLimit:
-      wsString =
-          L"Message limit exceeded. Remaining %d validation errors not "
-          L"reported.";
-      return;
-    case XFA_IDS_ValidateNullWarning:
-      wsString =
-          L"%s cannot be blank. To ignore validations for %s, click Ignore.";
-      return;
-    case XFA_IDS_ValidateNullError:
-      wsString = L"%s cannot be blank.";
-      return;
-    case XFA_IDS_ValidateWarning:
-      wsString =
-          L"The value you entered for %s is invalid. To ignore validations for "
-          L"%s, click Ignore.";
-      return;
-    case XFA_IDS_ValidateError:
-      wsString = L"The value you entered for %s is invalid.";
-      return;
+      return L"Server does not permit.";
   }
+  return L"";
 }
 
 IFWL_AdapterTimerMgr* CPDFXFA_Context::GetTimerMgr() {
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.h b/fpdfsdk/fpdfxfa/cpdfxfa_context.h
index 8b9daea..52b1689 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_context.h
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.h
@@ -54,9 +54,10 @@
   void ClearChangeMark();
 
   // IFXA_AppProvider:
-  void GetLanguage(CFX_WideString& wsLanguage) override;
-  void GetPlatform(CFX_WideString& wsPlatform) override;
-  void GetAppName(CFX_WideString& wsName) override;
+  CFX_WideString GetLanguage() override;
+  CFX_WideString GetPlatform() override;
+  CFX_WideString GetAppName() override;
+  CFX_WideString GetAppTitle() const override;
 
   void Beep(uint32_t dwType) override;
   int32_t MsgBox(const CFX_WideString& wsMessage,
@@ -79,7 +80,7 @@
                      const CFX_WideString& wsData,
                      const CFX_WideString& wsEncode) override;
 
-  void LoadString(int32_t iStringID, CFX_WideString& wsString) override;
+  CFX_WideString LoadString(int32_t iStringID) override;
   IFWL_AdapterTimerMgr* GetTimerMgr() override;
 
  protected:
diff --git a/xfa/fwl/cfwl_monthcalendar.cpp b/xfa/fwl/cfwl_monthcalendar.cpp
index 3b8076b..6487262 100644
--- a/xfa/fwl/cfwl_monthcalendar.cpp
+++ b/xfa/fwl/cfwl_monthcalendar.cpp
@@ -31,92 +31,54 @@
 
 namespace {
 
-CFX_WideString* GetCapacityForDay(IFWL_ThemeProvider* pTheme,
-                                  CFWL_ThemePart& params,
-                                  uint32_t day) {
+CFX_WideString GetCapacityForDay(IFWL_ThemeProvider* pTheme,
+                                 CFWL_ThemePart& params,
+                                 uint32_t day) {
   ASSERT(day < 7);
 
-  if (day == 0) {
-    return static_cast<CFX_WideString*>(
-        pTheme->GetCapacity(&params, CFWL_WidgetCapacity::Sun));
-  }
-  if (day == 1) {
-    return static_cast<CFX_WideString*>(
-        pTheme->GetCapacity(&params, CFWL_WidgetCapacity::Mon));
-  }
-  if (day == 2) {
-    return static_cast<CFX_WideString*>(
-        pTheme->GetCapacity(&params, CFWL_WidgetCapacity::Tue));
-  }
-  if (day == 3) {
-    return static_cast<CFX_WideString*>(
-        pTheme->GetCapacity(&params, CFWL_WidgetCapacity::Wed));
-  }
-  if (day == 4) {
-    return static_cast<CFX_WideString*>(
-        pTheme->GetCapacity(&params, CFWL_WidgetCapacity::Thu));
-  }
-  if (day == 5) {
-    return static_cast<CFX_WideString*>(
-        pTheme->GetCapacity(&params, CFWL_WidgetCapacity::Fri));
-  }
-
-  return static_cast<CFX_WideString*>(
-      pTheme->GetCapacity(&params, CFWL_WidgetCapacity::Sat));
+  if (day == 0)
+    return L"Sun";
+  if (day == 1)
+    return L"Mon";
+  if (day == 2)
+    return L"Tue";
+  if (day == 3)
+    return L"Wed";
+  if (day == 4)
+    return L"Thu";
+  if (day == 5)
+    return L"Fri";
+  return L"Sat";
 }
 
-CFX_WideString* GetCapacityForMonth(IFWL_ThemeProvider* pTheme,
-                                    CFWL_ThemePart& params,
-                                    uint32_t month) {
+CFX_WideString GetCapacityForMonth(IFWL_ThemeProvider* pTheme,
+                                   CFWL_ThemePart& params,
+                                   uint32_t month) {
   ASSERT(month < 12);
 
-  if (month == 0) {
-    return static_cast<CFX_WideString*>(
-        pTheme->GetCapacity(&params, CFWL_WidgetCapacity::January));
-  }
-  if (month == 1) {
-    return static_cast<CFX_WideString*>(
-        pTheme->GetCapacity(&params, CFWL_WidgetCapacity::February));
-  }
-  if (month == 2) {
-    return static_cast<CFX_WideString*>(
-        pTheme->GetCapacity(&params, CFWL_WidgetCapacity::March));
-  }
-  if (month == 3) {
-    return static_cast<CFX_WideString*>(
-        pTheme->GetCapacity(&params, CFWL_WidgetCapacity::April));
-  }
-  if (month == 4) {
-    return static_cast<CFX_WideString*>(
-        pTheme->GetCapacity(&params, CFWL_WidgetCapacity::May));
-  }
-  if (month == 5) {
-    return static_cast<CFX_WideString*>(
-        pTheme->GetCapacity(&params, CFWL_WidgetCapacity::June));
-  }
-  if (month == 6) {
-    return static_cast<CFX_WideString*>(
-        pTheme->GetCapacity(&params, CFWL_WidgetCapacity::July));
-  }
-  if (month == 7) {
-    return static_cast<CFX_WideString*>(
-        pTheme->GetCapacity(&params, CFWL_WidgetCapacity::August));
-  }
-  if (month == 8) {
-    return static_cast<CFX_WideString*>(
-        pTheme->GetCapacity(&params, CFWL_WidgetCapacity::September));
-  }
-  if (month == 9) {
-    return static_cast<CFX_WideString*>(
-        pTheme->GetCapacity(&params, CFWL_WidgetCapacity::October));
-  }
-  if (month == 10) {
-    return static_cast<CFX_WideString*>(
-        pTheme->GetCapacity(&params, CFWL_WidgetCapacity::November));
-  }
-
-  return static_cast<CFX_WideString*>(
-      pTheme->GetCapacity(&params, CFWL_WidgetCapacity::December));
+  if (month == 0)
+    return L"January";
+  if (month == 1)
+    return L"February";
+  if (month == 2)
+    return L"March";
+  if (month == 3)
+    return L"April";
+  if (month == 4)
+    return L"May";
+  if (month == 5)
+    return L"June";
+  if (month == 6)
+    return L"July";
+  if (month == 7)
+    return L"August";
+  if (month == 8)
+    return L"September";
+  if (month == 9)
+    return L"October";
+  if (month == 10)
+    return L"November";
+  return L"December";
 }
 
 }  // namespace
@@ -360,7 +322,7 @@
     rtDayOfWeek.Set(m_rtWeek.left + i * (m_szCell.x + MONTHCAL_HMARGIN * 2),
                     m_rtWeek.top, m_szCell.x, m_szCell.y);
     params.m_rtPart = rtDayOfWeek;
-    params.m_wsText = *GetCapacityForDay(pTheme, params, i);
+    params.m_wsText = GetCapacityForDay(pTheme, params, i);
     params.m_dwTTOStyles = FDE_TTOSTYLE_SingleLine;
     pTheme->DrawText(&params);
   }
@@ -376,11 +338,9 @@
   params.m_dwStates = CFWL_PartState_Normal;
   params.m_iTTOAlign = FDE_TTOALIGNMENT_CenterLeft;
 
-  CFX_WideString* wsDay = static_cast<CFX_WideString*>(
-      pTheme->GetCapacity(&params, CFWL_WidgetCapacity::Today));
   CFX_WideString wsText;
   GetTodayText(m_iYear, m_iMonth, m_iDay, wsText);
-  params.m_wsText = *wsDay + wsText;
+  params.m_wsText = L"Today" + wsText;
 
   m_szToday =
       CalcTextSize(params.m_wsText, m_pProperties->m_pThemeProvider, false);
@@ -466,7 +426,7 @@
   FX_FLOAT fMaxWeekH = 0.0f;
 
   for (uint32_t i = 0; i < 7; ++i) {
-    CFX_SizeF sz = CalcTextSize(*GetCapacityForDay(pTheme, params, i),
+    CFX_SizeF sz = CalcTextSize(GetCapacityForDay(pTheme, params, i),
                                 m_pProperties->m_pThemeProvider, false);
     fMaxWeekW = (fMaxWeekW >= sz.x) ? fMaxWeekW : sz.x;
     fMaxWeekH = (fMaxWeekH >= sz.y) ? fMaxWeekH : sz.y;
@@ -491,7 +451,7 @@
   FX_FLOAT fMonthMaxH = 0.0f;
 
   for (uint32_t i = 0; i < 12; ++i) {
-    CFX_SizeF sz = CalcTextSize(*GetCapacityForMonth(pTheme, params, i),
+    CFX_SizeF sz = CalcTextSize(GetCapacityForMonth(pTheme, params, i),
                                 m_pProperties->m_pThemeProvider, false);
     fMonthMaxW = (fMonthMaxW >= sz.x) ? fMonthMaxW : sz.x;
     fMonthMaxH = (fMonthMaxH >= sz.y) ? fMonthMaxH : sz.y;
@@ -509,9 +469,7 @@
 
   CFX_WideString wsToday;
   GetTodayText(m_iYear, m_iMonth, m_iDay, wsToday);
-  CFX_WideString* wsText = static_cast<CFX_WideString*>(
-      pTheme->GetCapacity(&params, CFWL_WidgetCapacity::Today));
-  m_wsToday = *wsText + wsToday;
+  m_wsToday = L"Today" + wsToday;
   m_szToday = CalcTextSize(wsToday, m_pProperties->m_pThemeProvider, false);
   m_szToday.y = (m_szToday.y >= m_szCell.y) ? m_szToday.y : m_szCell.y;
   fs.y = m_szCell.x + m_szCell.y * (MONTHCAL_ROWS - 2) + m_szToday.y +
diff --git a/xfa/fwl/theme/cfwl_monthcalendartp.cpp b/xfa/fwl/theme/cfwl_monthcalendartp.cpp
index 13fabb3..a76d959 100644
--- a/xfa/fwl/theme/cfwl_monthcalendartp.cpp
+++ b/xfa/fwl/theme/cfwl_monthcalendartp.cpp
@@ -248,86 +248,6 @@
       m_fValue = kHeight;
       break;
     }
-    case CFWL_WidgetCapacity::Sun: {
-      wsResource = L"Sun";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::Mon: {
-      wsResource = L"Mon";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::Tue: {
-      wsResource = L"Tue";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::Wed: {
-      wsResource = L"Wed";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::Thu: {
-      wsResource = L"Thu";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::Fri: {
-      wsResource = L"Fri";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::Sat: {
-      wsResource = L"Sat";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::January: {
-      wsResource = L"January";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::February: {
-      wsResource = L"February";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::March: {
-      wsResource = L"March";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::April: {
-      wsResource = L"April";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::May: {
-      wsResource = L"May";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::June: {
-      wsResource = L"June";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::July: {
-      wsResource = L"July";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::August: {
-      wsResource = L"August";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::September: {
-      wsResource = L"September";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::October: {
-      wsResource = L"October";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::November: {
-      wsResource = L"November";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::December: {
-      wsResource = L"December";
-      return &wsResource;
-    }
-    case CFWL_WidgetCapacity::Today: {
-      wsResource = L"Today";
-      return &wsResource;
-    }
     default:
       bDefPro = true;
       break;
diff --git a/xfa/fwl/theme/cfwl_widgettp.h b/xfa/fwl/theme/cfwl_widgettp.h
index 90d6973..1113512 100644
--- a/xfa/fwl/theme/cfwl_widgettp.h
+++ b/xfa/fwl/theme/cfwl_widgettp.h
@@ -19,28 +19,6 @@
 enum class CFWL_WidgetCapacity {
   None = 0,
 
-  Today,
-  Sun,
-  Mon,
-  Tue,
-  Wed,
-  Thu,
-  Fri,
-  Sat,
-
-  January,
-  February,
-  March,
-  April,
-  May,
-  June,
-  July,
-  August,
-  September,
-  October,
-  November,
-  December,
-
   BigIcon,
   ComboFormHandler,
   CXBorder,
diff --git a/xfa/fxfa/app/xfa_ffdocview.cpp b/xfa/fxfa/app/xfa_ffdocview.cpp
index e88517c..3d81699 100644
--- a/xfa/fxfa/app/xfa_ffdocview.cpp
+++ b/xfa/fxfa/app/xfa_ffdocview.cpp
@@ -159,17 +159,15 @@
       wsMsg += m_arrNullTestMsg[i] + FX_WSTRC(L"\n");
     }
     if (iRemain > 0) {
-      CFX_WideString wsLimit;
-      pAppProvider->LoadString(XFA_IDS_ValidateLimit, wsLimit);
-      if (!wsLimit.IsEmpty()) {
-        CFX_WideString wsTemp;
-        wsTemp.Format(wsLimit.c_str(), iRemain);
-        wsMsg += FX_WSTRC(L"\n") + wsTemp;
-      }
+      CFX_WideString wsTemp;
+      wsTemp.Format(
+          L"Message limit exceeded. Remaining %d "
+          L"validation errors not reported.",
+          iRemain);
+      wsMsg += FX_WSTRC(L"\n") + wsTemp;
     }
-    CFX_WideString wsTitle;
-    pAppProvider->LoadString(XFA_IDS_AppName, wsTitle);
-    pAppProvider->MsgBox(wsMsg, wsTitle, XFA_MBICON_Status, XFA_MB_OK);
+    pAppProvider->MsgBox(wsMsg, pAppProvider->GetAppTitle(), XFA_MBICON_Status,
+                         XFA_MB_OK);
   }
   m_arrNullTestMsg.clear();
 }
diff --git a/xfa/fxfa/app/xfa_fffield.cpp b/xfa/fxfa/app/xfa_fffield.cpp
index 68db2ba..2e15696 100644
--- a/xfa/fxfa/app/xfa_fffield.cpp
+++ b/xfa/fxfa/app/xfa_fffield.cpp
@@ -687,13 +687,8 @@
         }
         IXFA_AppProvider* pAppProvider = GetApp()->GetAppProvider();
         if (pAppProvider) {
-          CFX_WideString wsMessage;
-          CFX_WideString wsWarning;
-          pAppProvider->LoadString(XFA_IDS_NotModifyField, wsWarning);
-          wsMessage += wsWarning;
-          CFX_WideString wsTitle;
-          pAppProvider->LoadString(XFA_IDS_CalcOverride, wsTitle);
-          pAppProvider->MsgBox(wsMessage, wsTitle, XFA_MBICON_Warning,
+          pAppProvider->MsgBox(L"You are not allowed to modify this field.",
+                               L"Calculate Override", XFA_MBICON_Warning,
                                XFA_MB_OK);
         }
       }
@@ -717,15 +712,11 @@
         if (pAppProvider) {
           CFX_WideString wsMessage;
           calc.GetMessageText(wsMessage);
-          if (!wsMessage.IsEmpty()) {
+          if (!wsMessage.IsEmpty())
             wsMessage += L"\r\n";
-          }
-          CFX_WideString wsWarning;
-          pAppProvider->LoadString(XFA_IDS_ModifyField, wsWarning);
-          wsMessage += wsWarning;
-          CFX_WideString wsTitle;
-          pAppProvider->LoadString(XFA_IDS_CalcOverride, wsTitle);
-          if (pAppProvider->MsgBox(wsMessage, wsTitle, XFA_MBICON_Warning,
+          wsMessage += L"Are you sure you want to modify this field?";
+          if (pAppProvider->MsgBox(wsMessage, L"Calculate Override",
+                                   XFA_MBICON_Warning,
                                    XFA_MB_YesNo) == XFA_IDYes) {
             pAcc->GetNode()->SetFlag(XFA_NodeFlag_UserInteractive, false);
             return 1;
diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp
index 74bd99a..26e3512 100644
--- a/xfa/fxfa/app/xfa_fftextedit.cpp
+++ b/xfa/fxfa/app/xfa_fftextedit.cpp
@@ -195,15 +195,14 @@
   if (pAcc && pAcc->GetUIType() == XFA_Element::NumericEdit) {
     IXFA_AppProvider* pAppProvider = GetApp()->GetAppProvider();
     if (pAppProvider) {
-      CFX_WideString wsTitle;
-      pAppProvider->LoadString(XFA_IDS_AppName, wsTitle);
-      CFX_WideString wsError;
-      pAppProvider->LoadString(XFA_IDS_ValidateNumberError, wsError);
       CFX_WideString wsSomField;
       pAcc->GetNode()->GetSOMExpression(wsSomField);
+
       CFX_WideString wsMessage;
-      wsMessage.Format(wsError.c_str(), wsText.c_str(), wsSomField.c_str());
-      pAppProvider->MsgBox(wsMessage, wsTitle, XFA_MBICON_Error, XFA_MB_OK);
+      wsMessage.Format(L"%s can not contain %s", wsText.c_str(),
+                       wsSomField.c_str());
+      pAppProvider->MsgBox(wsMessage, pAppProvider->GetAppTitle(),
+                           XFA_MBICON_Error, XFA_MB_OK);
     }
   }
 }
diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
index c1c18eb..3ff159a 100644
--- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp
+++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
@@ -380,8 +380,7 @@
       if (!pAppProvider) {
         return;
       }
-      CFX_WideString wsTitle;
-      pAppProvider->LoadString(XFA_IDS_AppName, wsTitle);
+      CFX_WideString wsTitle = pAppProvider->GetAppTitle();
       CFX_WideString wsScriptMsg;
       validate.GetScriptMessageText(wsScriptMsg);
       int32_t eScriptTest = validate.GetScriptTest();
@@ -389,7 +388,7 @@
         if (GetNode()->IsUserInteractive())
           return;
         if (wsScriptMsg.IsEmpty())
-          GetValidateMessage(pAppProvider, wsScriptMsg, false, bVersionFlag);
+          wsScriptMsg = GetValidateMessage(false, bVersionFlag);
 
         if (bVersionFlag) {
           pAppProvider->MsgBox(wsScriptMsg, wsTitle, XFA_MBICON_Warning,
@@ -401,9 +400,8 @@
           GetNode()->SetFlag(XFA_NodeFlag_UserInteractive, false);
         }
       } else {
-        if (wsScriptMsg.IsEmpty()) {
-          GetValidateMessage(pAppProvider, wsScriptMsg, true, bVersionFlag);
-        }
+        if (wsScriptMsg.IsEmpty())
+          wsScriptMsg = GetValidateMessage(true, bVersionFlag);
         pAppProvider->MsgBox(wsScriptMsg, wsTitle, XFA_MBICON_Error, XFA_MB_OK);
       }
     }
@@ -430,20 +428,18 @@
       }
       CFX_WideString wsFormatMsg;
       validate.GetFormatMessageText(wsFormatMsg);
-      CFX_WideString wsTitle;
-      pAppProvider->LoadString(XFA_IDS_AppName, wsTitle);
+      CFX_WideString wsTitle = pAppProvider->GetAppTitle();
       int32_t eFormatTest = validate.GetFormatTest();
       if (eFormatTest == XFA_ATTRIBUTEENUM_Error) {
-        if (wsFormatMsg.IsEmpty()) {
-          GetValidateMessage(pAppProvider, wsFormatMsg, true, bVersionFlag);
-        }
+        if (wsFormatMsg.IsEmpty())
+          wsFormatMsg = GetValidateMessage(true, bVersionFlag);
         pAppProvider->MsgBox(wsFormatMsg, wsTitle, XFA_MBICON_Error, XFA_MB_OK);
         return XFA_EVENTERROR_Success;
       }
       if (GetNode()->IsUserInteractive())
         return XFA_EVENTERROR_NotExist;
       if (wsFormatMsg.IsEmpty())
-        GetValidateMessage(pAppProvider, wsFormatMsg, false, bVersionFlag);
+        wsFormatMsg = GetValidateMessage(false, bVersionFlag);
 
       if (bVersionFlag) {
         pAppProvider->MsgBox(wsFormatMsg, wsTitle, XFA_MBICON_Warning,
@@ -496,15 +492,12 @@
     return XFA_EVENTERROR_NotExist;
   }
   CFX_WideString wsCaptionName;
-  CFX_WideString wsTitle;
-  pAppProvider->LoadString(XFA_IDS_AppName, wsTitle);
+  CFX_WideString wsTitle = pAppProvider->GetAppTitle();
   switch (eNullTest) {
     case XFA_ATTRIBUTEENUM_Error: {
       if (wsNullMsg.IsEmpty()) {
-        GetValidateCaptionName(wsCaptionName, bVersionFlag);
-        CFX_WideString wsError;
-        pAppProvider->LoadString(XFA_IDS_ValidateNullError, wsError);
-        wsNullMsg.Format(wsError.c_str(), wsCaptionName.c_str());
+        wsCaptionName = GetValidateCaptionName(bVersionFlag);
+        wsNullMsg.Format(L"%s cannot be blank.", wsCaptionName.c_str());
       }
       pAppProvider->MsgBox(wsNullMsg, wsTitle, XFA_MBICON_Status, XFA_MB_OK);
       return XFA_EVENTERROR_Error;
@@ -514,11 +507,10 @@
         return true;
 
       if (wsNullMsg.IsEmpty()) {
-        GetValidateCaptionName(wsCaptionName, bVersionFlag);
-        CFX_WideString wsWarning;
-        pAppProvider->LoadString(XFA_IDS_ValidateNullWarning, wsWarning);
-        wsNullMsg.Format(wsWarning.c_str(), wsCaptionName.c_str(),
-                         wsCaptionName.c_str());
+        wsCaptionName = GetValidateCaptionName(bVersionFlag);
+        wsNullMsg.Format(
+            L"%s cannot be blank. To ignore validations for %s, click Ignore.",
+            wsCaptionName.c_str(), wsCaptionName.c_str());
       }
       if (pAppProvider->MsgBox(wsNullMsg, wsTitle, XFA_MBICON_Warning,
                                XFA_MB_YesNo) == XFA_IDYes) {
@@ -532,46 +524,44 @@
   }
   return XFA_EVENTERROR_Success;
 }
-void CXFA_WidgetAcc::GetValidateCaptionName(CFX_WideString& wsCaptionName,
-                                            bool bVersionFlag) {
+
+CFX_WideString CXFA_WidgetAcc::GetValidateCaptionName(bool bVersionFlag) {
+  CFX_WideString wsCaptionName;
+
   if (!bVersionFlag) {
-    CXFA_Caption caption = GetCaption();
-    if (caption) {
-      CXFA_Value capValue = caption.GetValue();
-      if (capValue) {
-        CXFA_Text capText = capValue.GetText();
-        if (capText) {
+    if (CXFA_Caption caption = GetCaption()) {
+      if (CXFA_Value capValue = caption.GetValue()) {
+        if (CXFA_Text capText = capValue.GetText())
           capText.GetContent(wsCaptionName);
-        }
       }
     }
   }
-  if (wsCaptionName.IsEmpty()) {
+  if (wsCaptionName.IsEmpty())
     GetName(wsCaptionName);
-  }
+
+  return wsCaptionName;
 }
-void CXFA_WidgetAcc::GetValidateMessage(IXFA_AppProvider* pAppProvider,
-                                        CFX_WideString& wsMessage,
-                                        bool bError,
-                                        bool bVersionFlag) {
-  CFX_WideString wsCaptionName;
-  GetValidateCaptionName(wsCaptionName, bVersionFlag);
-  CFX_WideString wsError;
+
+CFX_WideString CXFA_WidgetAcc::GetValidateMessage(bool bError,
+                                                  bool bVersionFlag) {
+  CFX_WideString wsCaptionName = GetValidateCaptionName(bVersionFlag);
+  CFX_WideString wsMessage;
   if (bVersionFlag) {
-    pAppProvider->LoadString(XFA_IDS_ValidateFailed, wsError);
-    wsMessage.Format(wsError.c_str(), wsCaptionName.c_str());
-    return;
+    wsMessage.Format(L"%s validation failed", wsCaptionName.c_str());
+    return wsMessage;
   }
   if (bError) {
-    pAppProvider->LoadString(XFA_IDS_ValidateError, wsError);
-    wsMessage.Format(wsError.c_str(), wsCaptionName.c_str());
-    return;
+    wsMessage.Format(L"The value you entered for %s is invalid.",
+                     wsCaptionName.c_str());
+    return wsMessage;
   }
-  CFX_WideString wsWarning;
-  pAppProvider->LoadString(XFA_IDS_ValidateWarning, wsWarning);
-  wsMessage.Format(wsWarning.c_str(), wsCaptionName.c_str(),
-                   wsCaptionName.c_str());
+  wsMessage.Format(
+      L"The value you entered for %s is invalid. To ignore "
+      L"validations for %s, click Ignore.",
+      wsCaptionName.c_str(), wsCaptionName.c_str());
+  return wsMessage;
 }
+
 int32_t CXFA_WidgetAcc::ProcessValidate(int32_t iFlags) {
   if (GetElementType() == XFA_Element::Draw) {
     return XFA_EVENTERROR_NotExist;
diff --git a/xfa/fxfa/app/xfa_fwltheme.cpp b/xfa/fxfa/app/xfa_fwltheme.cpp
index 5a494f1..c08e51f 100644
--- a/xfa/fxfa/app/xfa_fwltheme.cpp
+++ b/xfa/fxfa/app/xfa_fwltheme.cpp
@@ -228,83 +228,6 @@
     default:
       break;
   }
-
-  int dwCapValue = static_cast<int>(dwCapacity);
-  if (pThemePart->m_pWidget->GetClassID() == FWL_Type::MonthCalendar &&
-      dwCapValue >= static_cast<int>(CFWL_WidgetCapacity::Today) &&
-      dwCapValue <= static_cast<int>(CFWL_WidgetCapacity::December)) {
-    if (CXFA_FFWidget* pWidget =
-            XFA_ThemeGetOuterWidget(pThemePart->m_pWidget)) {
-      IXFA_AppProvider* pAppProvider = pWidget->GetAppProvider();
-      m_wsResource.clear();
-      switch (dwCapacity) {
-        case CFWL_WidgetCapacity::Sun:
-          pAppProvider->LoadString(XFA_IDS_StringWeekDay_Sun, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::Mon:
-          pAppProvider->LoadString(XFA_IDS_StringWeekDay_Mon, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::Tue:
-          pAppProvider->LoadString(XFA_IDS_StringWeekDay_Tue, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::Wed:
-          pAppProvider->LoadString(XFA_IDS_StringWeekDay_Wed, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::Thu:
-          pAppProvider->LoadString(XFA_IDS_StringWeekDay_Thu, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::Fri:
-          pAppProvider->LoadString(XFA_IDS_StringWeekDay_Fri, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::Sat:
-          pAppProvider->LoadString(XFA_IDS_StringWeekDay_Sat, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::January:
-          pAppProvider->LoadString(XFA_IDS_StringMonth_Jan, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::February:
-          pAppProvider->LoadString(XFA_IDS_StringMonth_Feb, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::March:
-          pAppProvider->LoadString(XFA_IDS_StringMonth_March, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::April:
-          pAppProvider->LoadString(XFA_IDS_StringMonth_April, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::May:
-          pAppProvider->LoadString(XFA_IDS_StringMonth_May, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::June:
-          pAppProvider->LoadString(XFA_IDS_StringMonth_June, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::July:
-          pAppProvider->LoadString(XFA_IDS_StringMonth_July, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::August:
-          pAppProvider->LoadString(XFA_IDS_StringMonth_Aug, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::September:
-          pAppProvider->LoadString(XFA_IDS_StringMonth_Sept, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::October:
-          pAppProvider->LoadString(XFA_IDS_StringMonth_Oct, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::November:
-          pAppProvider->LoadString(XFA_IDS_StringMonth_Nov, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::December:
-          pAppProvider->LoadString(XFA_IDS_StringMonth_Dec, m_wsResource);
-          break;
-        case CFWL_WidgetCapacity::Today:
-          pAppProvider->LoadString(XFA_IDS_String_Today, m_wsResource);
-          break;
-        default:
-          break;
-      }
-      if (!m_wsResource.IsEmpty())
-        return &m_wsResource;
-    }
-  }
   return GetTheme(pThemePart->m_pWidget)->GetCapacity(pThemePart, dwCapacity);
 }
 
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
index 01328f2..862571e 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
+++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
@@ -6512,12 +6512,11 @@
 void CXFA_FM2JSContext::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());
diff --git a/xfa/fxfa/fxfa.h b/xfa/fxfa/fxfa.h
index ec5282c..2656947 100644
--- a/xfa/fxfa/fxfa.h
+++ b/xfa/fxfa/fxfa.h
@@ -38,12 +38,7 @@
 #define XFA_IDCancel 2
 #define XFA_IDNo 3
 #define XFA_IDYes 4
-#define XFA_IDS_ValidateFailed 1
-#define XFA_IDS_CalcOverride 2
-#define XFA_IDS_ModifyField 3
-#define XFA_IDS_NotModifyField 4
-#define XFA_IDS_AppName 5
-#define XFA_IDS_Unable_TO_SET 8
+
 #define XFA_IDS_INVAlID_PROP_SET 13
 #define XFA_IDS_NOT_DEFAUL_VALUE 14
 #define XFA_IDS_UNABLE_SET_LANGUAGE 15
@@ -61,32 +56,6 @@
 #define XFA_IDS_NOT_HAVE_PROPERTY 70
 #define XFA_IDS_VIOLATE_BOUNDARY 72
 #define XFA_IDS_SERVER_DENY 73
-#define XFA_IDS_StringWeekDay_Sun 74
-#define XFA_IDS_StringWeekDay_Mon 75
-#define XFA_IDS_StringWeekDay_Tue 76
-#define XFA_IDS_StringWeekDay_Wed 77
-#define XFA_IDS_StringWeekDay_Thu 78
-#define XFA_IDS_StringWeekDay_Fri 79
-#define XFA_IDS_StringWeekDay_Sat 80
-#define XFA_IDS_StringMonth_Jan 81
-#define XFA_IDS_StringMonth_Feb 82
-#define XFA_IDS_StringMonth_March 83
-#define XFA_IDS_StringMonth_April 84
-#define XFA_IDS_StringMonth_May 85
-#define XFA_IDS_StringMonth_June 86
-#define XFA_IDS_StringMonth_July 87
-#define XFA_IDS_StringMonth_Aug 88
-#define XFA_IDS_StringMonth_Sept 89
-#define XFA_IDS_StringMonth_Oct 90
-#define XFA_IDS_StringMonth_Nov 91
-#define XFA_IDS_StringMonth_Dec 92
-#define XFA_IDS_String_Today 93
-#define XFA_IDS_ValidateLimit 94
-#define XFA_IDS_ValidateNullWarning 95
-#define XFA_IDS_ValidateNullError 96
-#define XFA_IDS_ValidateWarning 97
-#define XFA_IDS_ValidateError 98
-#define XFA_IDS_ValidateNumberError 99
 
 #define XFA_DOCVIEW_View 0x00000000
 #define XFA_DOCVIEW_MasterPage 0x00000001
@@ -180,17 +149,22 @@
   /**
    * Returns the language of the running host application. Such as zh_CN
    */
-  virtual void GetLanguage(CFX_WideString& wsLanguage) = 0;
+  virtual CFX_WideString GetLanguage() = 0;
 
   /**
    * Returns the platform of the machine running the script. Such as WIN
    */
-  virtual void GetPlatform(CFX_WideString& wsPlatform) = 0;
+  virtual CFX_WideString GetPlatform() = 0;
 
   /**
    * Get application name, such as Phantom.
    */
-  virtual void GetAppName(CFX_WideString& wsName) = 0;
+  virtual CFX_WideString GetAppName() = 0;
+
+  /**
+   * Get application message box title.
+   */
+  virtual CFX_WideString GetAppTitle() const = 0;
 
   /**
    * Causes the system to play a sound.
@@ -268,7 +242,7 @@
                              const CFX_WideString& wsData,
                              const CFX_WideString& wsEncode) = 0;
 
-  virtual void LoadString(int32_t iStringID, CFX_WideString& wsString) = 0;
+  virtual CFX_WideString LoadString(int32_t iStringID) = 0;
   virtual IFWL_AdapterTimerMgr* GetTimerMgr() = 0;
 };
 
diff --git a/xfa/fxfa/fxfa_widget.h b/xfa/fxfa/fxfa_widget.h
index 5cdec2d..9a0e66b 100644
--- a/xfa/fxfa/fxfa_widget.h
+++ b/xfa/fxfa/fxfa_widget.h
@@ -90,11 +90,8 @@
   int32_t ProcessNullTestValidate(CXFA_Validate validate,
                                   int32_t iFlags,
                                   bool bVersionFlag);
-  void GetValidateCaptionName(CFX_WideString& wsCaptionName, bool bVersionFlag);
-  void GetValidateMessage(IXFA_AppProvider* pAppProvider,
-                          CFX_WideString& wsMessage,
-                          bool bError,
-                          bool bVersionFlag);
+  CFX_WideString GetValidateCaptionName(bool bVersionFlag);
+  CFX_WideString GetValidateMessage(bool bError, bool bVersionFlag);
   void CalcCaptionSize(CFX_SizeF& szCap);
   bool CalculateFieldAutoSize(CFX_SizeF& size);
   bool CalculateWidgetAutoSize(CFX_SizeF& size);
diff --git a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp
index 7493570..b455966 100644
--- a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp
+++ b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp
@@ -37,9 +37,8 @@
 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 @@
     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 @@
     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 @@
     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 cc5f74a..b5c7ea1 100644
--- a/xfa/fxfa/parser/cxfa_document.cpp
+++ b/xfa/fxfa/parser/cxfa_document.cpp
@@ -283,10 +283,9 @@
 
 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 f385b11..cabf87f 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -1107,10 +1107,7 @@
   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 a310602..c8ed713 100644
--- a/xfa/fxfa/parser/cxfa_object.cpp
+++ b/xfa/fxfa/parser/cxfa_object.cpp
@@ -50,12 +50,11 @@
 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());