void CXFA_FMStringExpression::ToJavaScript(CFX_WideTextBuf& javascript) { CFX_WideString tempStr(m_wsString); if (tempStr.GetLength() > 2) { javascript.AppendChar(L'\"'); FX_WCHAR oneChar; for (int16_t i = 1; i < tempStr.GetLength() - 1; i++) { oneChar = tempStr[i]; switch (oneChar) { case L'\"': { i++; javascript << FX_WSTRC(L"\\\""); } break; case 0x0d: break; case 0x0a: { javascript << FX_WSTRC(L"\\n"); } break; default: { javascript.AppendChar(oneChar); } break; } } javascript.AppendChar(L'\"'); } else { javascript << tempStr; } }
int32_t CXFA_FMProgram::TranslateProgram(CFX_WideTextBuf& wsJavaScript) { m_globalFunction->ToJavaScript(wsJavaScript); wsJavaScript.AppendChar(0); return 0; }