From d983b09c3ae29a97cba8e9ec9c6351545f6087ee Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Mon, 14 Dec 2015 16:58:33 -0800 Subject: Merge to XFA: Remove FX_BSTRC. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1521563002 . (cherry picked from commit 1956a174020686f91cd3b34294e91f4560fe45aa) Review URL: https://codereview.chromium.org/1526823002 . --- xfa/src/fgas/src/localization/fx_locale.cpp | 21 ++-- xfa/src/fxfa/src/app/xfa_checksum.cpp | 33 +++---- xfa/src/fxfa/src/app/xfa_ffdoc.cpp | 4 +- xfa/src/fxfa/src/app/xfa_fontmgr.cpp | 28 +++--- xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp | 144 ++++++++++++++-------------- xfa/src/fxfa/src/parser/xfa_locale.cpp | 56 +++++------ xfa/src/fxfa/src/parser/xfa_object_imp.cpp | 23 ++--- xfa/src/fxfa/src/parser/xfa_script_imp.cpp | 2 +- 8 files changed, 141 insertions(+), 170 deletions(-) (limited to 'xfa/src') diff --git a/xfa/src/fgas/src/localization/fx_locale.cpp b/xfa/src/fgas/src/localization/fx_locale.cpp index 1227086bb5..c97156999a 100644 --- a/xfa/src/fgas/src/localization/fx_locale.cpp +++ b/xfa/src/fgas/src/localization/fx_locale.cpp @@ -90,7 +90,7 @@ static CFX_WideString FX_GetXMLContent(const CFX_ByteStringC& bsSpace, int32_t i = 0; for (; i < nCount; i++) { pDatePattern = pxmlElement->GetElement(bsSpace, bsTag, i); - if (pDatePattern->GetAttrValue(FX_BSTRC("name")) == wsName) { + if (pDatePattern->GetAttrValue("name") == wsName) { break; } } @@ -107,12 +107,12 @@ void CFX_Locale::GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, CFX_ByteString bsSpace; CFX_WideString wsName = gs_LocalNumberSymbols[eType]; CXML_Element* pNumberSymbols = - m_pElement->GetElement(bsSpace, FX_BSTRC("numberSymbols")); + m_pElement->GetElement(bsSpace, "numberSymbols"); if (!pNumberSymbols) { return; } - wsNumSymbol = FX_GetXMLContent(bsSpace, pNumberSymbols, - FX_BSTRC("numberSymbol"), wsName); + wsNumSymbol = + FX_GetXMLContent(bsSpace, pNumberSymbols, "numberSymbol", wsName); } void CFX_Locale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const { if (!m_pElement) { @@ -120,7 +120,7 @@ void CFX_Locale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const { } CFX_ByteString bsSpace; CXML_Element* pNumberSymbols = - m_pElement->GetElement(bsSpace, FX_BSTRC("dateTimeSymbols")); + m_pElement->GetElement(bsSpace, "dateTimeSymbols"); if (!pNumberSymbols) { return; } @@ -132,9 +132,8 @@ static void FX_GetCalendarSymbol(CXML_Element* pXmlElement, FX_BOOL bAbbr, CFX_WideString& wsName) { CFX_ByteString bsSpace; - CFX_ByteString pstrSymbolNames = symbol_type + FX_BSTRC("Names"); - CXML_Element* pChild = - pXmlElement->GetElement(bsSpace, FX_BSTRC("calendarSymbols")); + CFX_ByteString pstrSymbolNames = symbol_type + "Names"; + CXML_Element* pChild = pXmlElement->GetElement(bsSpace, "calendarSymbols"); if (!pChild) { return; } @@ -142,10 +141,10 @@ static void FX_GetCalendarSymbol(CXML_Element* pXmlElement, if (!pSymbolNames) { return; } - if (pSymbolNames->GetAttrInteger(FX_BSTRC("abbr")) != bAbbr) { + if (pSymbolNames->GetAttrInteger("abbr") != bAbbr) { pSymbolNames = pChild->GetElement(bsSpace, pstrSymbolNames, 1); } - if (pSymbolNames && pSymbolNames->GetAttrInteger(FX_BSTRC("abbr")) == bAbbr) { + if (pSymbolNames && pSymbolNames->GetAttrInteger("abbr") == bAbbr) { CXML_Element* pSymbolName = pSymbolNames->GetElement(bsSpace, symbol_type, index); if (pSymbolName) { @@ -208,7 +207,7 @@ void CFX_Locale::GetTimeZone(FX_TIMEZONE& tz) const { if (!m_pElement) { return; } - CXML_Element* pxmlTimeZone = m_pElement->GetElement("", FX_BSTRC("timeZone")); + CXML_Element* pxmlTimeZone = m_pElement->GetElement("", "timeZone"); if (pxmlTimeZone) { CFX_WideString wsTimeZone = pxmlTimeZone->GetContent(0); FX_ParseTimeZone(wsTimeZone, wsTimeZone.GetLength(), tz); diff --git a/xfa/src/fxfa/src/app/xfa_checksum.cpp b/xfa/src/fxfa/src/app/xfa_checksum.cpp index f0bc8cf53b..a70db6cba0 100644 --- a/xfa/src/fxfa/src/app/xfa_checksum.cpp +++ b/xfa/src/fxfa/src/app/xfa_checksum.cpp @@ -21,9 +21,9 @@ void* CXFA_SAXReaderHandler::OnTagEnter(const CFX_ByteStringC& bsTagName, } m_SAXContext.m_eNode = eType; CFX_ByteTextBuf& textBuf = m_SAXContext.m_TextBuf; - textBuf << FX_BSTRC("<"); + textBuf << "<"; if (eType == FX_SAXNODE_Instruction) { - textBuf << FX_BSTRC("?"); + textBuf << "?"; } textBuf << bsTagName; m_SAXContext.m_bsTagName = bsTagName; @@ -36,18 +36,14 @@ void CXFA_SAXReaderHandler::OnTagAttribute(void* pTag, return; } CFX_ByteTextBuf& textBuf = ((CXFA_SAXContext*)pTag)->m_TextBuf; - textBuf << FX_BSTRC(" "); - textBuf << bsAttri; - textBuf << FX_BSTRC("=\""); - textBuf << bsValue; - textBuf << FX_BSTRC("\""); + textBuf << " " << bsAttri << "=\"" << bsValue << "\""; } void CXFA_SAXReaderHandler::OnTagBreak(void* pTag) { if (pTag == NULL) { return; } CFX_ByteTextBuf& textBuf = ((CXFA_SAXContext*)pTag)->m_TextBuf; - textBuf << FX_BSTRC(">"); + textBuf << ">"; UpdateChecksum(FALSE); } void CXFA_SAXReaderHandler::OnTagData(void* pTag, @@ -59,11 +55,11 @@ void CXFA_SAXReaderHandler::OnTagData(void* pTag, } CFX_ByteTextBuf& textBuf = ((CXFA_SAXContext*)pTag)->m_TextBuf; if (eType == FX_SAXNODE_CharData) { - textBuf << FX_BSTRC(""); + textBuf << "]]>"; } } void CXFA_SAXReaderHandler::OnTagClose(void* pTag, FX_DWORD dwEndPos) { @@ -73,11 +69,9 @@ void CXFA_SAXReaderHandler::OnTagClose(void* pTag, FX_DWORD dwEndPos) { CXFA_SAXContext* pSAXContext = (CXFA_SAXContext*)pTag; CFX_ByteTextBuf& textBuf = pSAXContext->m_TextBuf; if (pSAXContext->m_eNode == FX_SAXNODE_Instruction) { - textBuf << FX_BSTRC("?>"); + textBuf << "?>"; } else if (pSAXContext->m_eNode == FX_SAXNODE_Tag) { - textBuf << FX_BSTRC(">m_bsTagName; - textBuf << FX_BSTRC(">"); + textBuf << ">m_bsTagName << ">"; } UpdateChecksum(FALSE); } @@ -88,9 +82,7 @@ void CXFA_SAXReaderHandler::OnTagEnd(void* pTag, return; } CFX_ByteTextBuf& textBuf = ((CXFA_SAXContext*)pTag)->m_TextBuf; - textBuf << FX_BSTRC(""); + textBuf << ""; UpdateChecksum(FALSE); } void CXFA_SAXReaderHandler::OnTargetData(void* pTag, @@ -102,14 +94,11 @@ void CXFA_SAXReaderHandler::OnTargetData(void* pTag, } if (eType == FX_SAXNODE_Comment) { CFX_ByteTextBuf& textBuf = m_SAXContext.m_TextBuf; - textBuf << FX_BSTRC(""); + textBuf << ""; UpdateChecksum(FALSE); } else { CFX_ByteTextBuf& textBuf = ((CXFA_SAXContext*)pTag)->m_TextBuf; - textBuf << FX_BSTRC(" "); - textBuf << bsData; + textBuf << " " << bsData; } } void CXFA_SAXReaderHandler::UpdateChecksum(FX_BOOL bCheckSpace) { diff --git a/xfa/src/fxfa/src/app/xfa_ffdoc.cpp b/xfa/src/fxfa/src/app/xfa_ffdoc.cpp index cb2cb3b9ea..0a4d592988 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdoc.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffdoc.cpp @@ -228,11 +228,11 @@ FX_BOOL CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) { if (pRoot == NULL) { return FALSE; } - CPDF_Dictionary* pAcroForm = pRoot->GetDict(FX_BSTRC("AcroForm")); + CPDF_Dictionary* pAcroForm = pRoot->GetDict("AcroForm"); if (pAcroForm == NULL) { return FALSE; } - CPDF_Object* pElementXFA = pAcroForm->GetElementValue(FX_BSTRC("XFA")); + CPDF_Object* pElementXFA = pAcroForm->GetElementValue("XFA"); if (pElementXFA == NULL) { return FALSE; } diff --git a/xfa/src/fxfa/src/app/xfa_fontmgr.cpp b/xfa/src/fxfa/src/app/xfa_fontmgr.cpp index f63c4f2810..015ff1f476 100644 --- a/xfa/src/fxfa/src/app/xfa_fontmgr.cpp +++ b/xfa/src/fxfa/src/app/xfa_fontmgr.cpp @@ -1886,11 +1886,11 @@ IFX_Font* CXFA_PDFFontMgr::FindFont(CFX_ByteString strPsName, return NULL; } CPDF_Dictionary* pFontSetDict = - pDoc->GetRoot()->GetDict(FX_BSTRC("AcroForm"))->GetDict(FX_BSTRC("DR")); + pDoc->GetRoot()->GetDict("AcroForm")->GetDict("DR"); if (!pFontSetDict) { return NULL; } - pFontSetDict = (CPDF_Dictionary*)pFontSetDict->GetDict(FX_BSTRC("Font")); + pFontSetDict = (CPDF_Dictionary*)pFontSetDict->GetDict("Font"); if (!pFontSetDict) { return NULL; } @@ -1908,7 +1908,7 @@ IFX_Font* CXFA_PDFFontMgr::FindFont(CFX_ByteString strPsName, return NULL; } CPDF_Dictionary* pFontDict = (CPDF_Dictionary*)pDirect; - if (pFontDict->GetString("Type") != FX_BSTRC("Font")) { + if (pFontDict->GetString("Type") != "Font") { return NULL; } CPDF_Font* pPDFFont = pDoc->LoadFont(pFontDict); @@ -1977,7 +1977,7 @@ FX_BOOL CXFA_PDFFontMgr::PsNameMatchDRFontName( } int32_t iDifferLength = bsDRName.GetLength() - iPsLen; if (iDifferLength > 1 || (bBold || bItalic)) { - int32_t iBoldIndex = bsDRName.Find(FX_BSTRC("Bold")); + int32_t iBoldIndex = bsDRName.Find("Bold"); FX_BOOL bBoldFont = iBoldIndex > 0; if (bBold ^ bBoldFont) { return FALSE; @@ -1987,11 +1987,11 @@ FX_BOOL CXFA_PDFFontMgr::PsNameMatchDRFontName( FX_MIN(iDifferLength - 4, bsDRName.GetLength() - iBoldIndex - 4); } FX_BOOL bItalicFont = TRUE; - if (bsDRName.Find(FX_BSTRC("Italic")) > 0) { + if (bsDRName.Find("Italic") > 0) { iDifferLength -= 6; - } else if (bsDRName.Find(FX_BSTRC("It")) > 0) { + } else if (bsDRName.Find("It") > 0) { iDifferLength -= 2; - } else if (bsDRName.Find(FX_BSTRC("Oblique")) > 0) { + } else if (bsDRName.Find("Oblique") > 0) { iDifferLength -= 7; } else { bItalicFont = FALSE; @@ -2001,10 +2001,8 @@ FX_BOOL CXFA_PDFFontMgr::PsNameMatchDRFontName( } if (iDifferLength > 1) { CFX_ByteString bsDRTailer = bsDRName.Right(iDifferLength); - if (bsDRTailer.Equal(FX_BSTRC("MT")) || - bsDRTailer.Equal(FX_BSTRC("PSMT")) || - bsDRTailer.Equal(FX_BSTRC("Regular")) || - bsDRTailer.Equal(FX_BSTRC("Reg"))) { + if (bsDRTailer.Equal("MT") || bsDRTailer.Equal("PSMT") || + bsDRTailer.Equal("Regular") || bsDRTailer.Equal("Reg")) { return TRUE; } if (bBoldFont || bItalicFont) { @@ -2013,18 +2011,18 @@ FX_BOOL CXFA_PDFFontMgr::PsNameMatchDRFontName( FX_BOOL bMatch = FALSE; switch (bsPsName.GetAt(iPsLen - 1)) { case 'L': { - if (bsDRName.Right(5).Equal(FX_BSTRC("Light"))) { + if (bsDRName.Right(5).Equal("Light")) { bMatch = TRUE; } } break; case 'R': { - if (bsDRName.Right(7).Equal(FX_BSTRC("Regular")) || - bsDRName.Right(3).Equal(FX_BSTRC("Reg"))) { + if (bsDRName.Right(7).Equal("Regular") || + bsDRName.Right(3).Equal("Reg")) { bMatch = TRUE; } } break; case 'M': { - if (bsDRName.Right(5).Equal(FX_BSTRC("Medium"))) { + if (bsDRName.Right(5).Equal("Medium")) { bMatch = TRUE; } } break; diff --git a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp index 66ecfb8890..3412aa258b 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp @@ -270,7 +270,7 @@ void CXFA_FM2JSContext::Avg(FXJSE_HOBJECT hThis, continue; } else if (FXJSE_Value_IsArray(argValue)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argValue, FX_BSTRC("length"), lengthValue); + FXJSE_Value_GetObjectProp(argValue, "length", lengthValue); int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if (iLength > 2) { @@ -355,7 +355,7 @@ void CXFA_FM2JSContext::Count(FXJSE_HOBJECT hThis, continue; } else if (FXJSE_Value_IsArray(argValue)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argValue, FX_BSTRC("length"), lengthValue); + FXJSE_Value_GetObjectProp(argValue, "length", lengthValue); int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if (iLength > 2) { @@ -439,7 +439,7 @@ void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis, continue; } else if (FXJSE_Value_IsArray(argValue)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argValue, FX_BSTRC("length"), lengthValue); + FXJSE_Value_GetObjectProp(argValue, "length", lengthValue); int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if (iLength > 2) { @@ -542,7 +542,7 @@ void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis, continue; } else if (FXJSE_Value_IsArray(argValue)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argValue, FX_BSTRC("length"), lengthValue); + FXJSE_Value_GetObjectProp(argValue, "length", lengthValue); int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if (iLength > 2) { @@ -644,7 +644,7 @@ void CXFA_FM2JSContext::Mod(FXJSE_HOBJECT hThis, FX_DOUBLE dDividor = 0.0; if (FXJSE_Value_IsArray(argOne)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argOne, FX_BSTRC("length"), lengthValue); + FXJSE_Value_GetObjectProp(argOne, "length", lengthValue); int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if (iLength > 2) { @@ -673,7 +673,7 @@ void CXFA_FM2JSContext::Mod(FXJSE_HOBJECT hThis, } if (FXJSE_Value_IsArray(argTwo)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argTwo, FX_BSTRC("length"), lengthValue); + FXJSE_Value_GetObjectProp(argTwo, "length", lengthValue); int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if (iLength > 2) { @@ -841,7 +841,7 @@ void CXFA_FM2JSContext::Sum(FXJSE_HOBJECT hThis, continue; } else if (FXJSE_Value_IsArray(argValue)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argValue, FX_BSTRC("length"), lengthValue); + FXJSE_Value_GetObjectProp(argValue, "length", lengthValue); int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if (iLength > 2) { @@ -1015,7 +1015,7 @@ void CXFA_FM2JSContext::DateFmt(FXJSE_HOBJECT hThis, CFX_ByteString formatStr; GetStandardDateFormat(hThis, iStyle, szLocal, formatStr); if (formatStr.IsEmpty()) { - formatStr = FX_BSTRC(""); + formatStr = ""; } FXJSE_Value_SetUTF8String(args.GetReturnValue(), formatStr); } else { @@ -1145,7 +1145,7 @@ void CXFA_FM2JSContext::LocalDateFmt(FXJSE_HOBJECT hThis, CFX_ByteString formatStr; GetLocalDateFormat(hThis, iStyle, szLocal, formatStr, FALSE); if (formatStr.IsEmpty()) { - formatStr = FX_BSTRC(""); + formatStr = ""; } FXJSE_Value_SetUTF8String(args.GetReturnValue(), formatStr); } else { @@ -1196,7 +1196,7 @@ void CXFA_FM2JSContext::LocalTimeFmt(FXJSE_HOBJECT hThis, CFX_ByteString formatStr; GetLocalTimeFormat(hThis, iStyle, szLocal, formatStr, FALSE); if (formatStr.IsEmpty()) { - formatStr = FX_BSTRC(""); + formatStr = ""; } FXJSE_Value_SetUTF8String(args.GetReturnValue(), formatStr); } else { @@ -1348,7 +1348,7 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, IsoDate2Local(hThis, szIsoDateString, formatString, localString, szLocalDateString); if (szLocalDateString.IsEmpty()) { - szLocalDateString = FX_BSTRC(""); + szLocalDateString = ""; } FXJSE_Value_SetUTF8String(args.GetReturnValue(), szLocalDateString); } else { @@ -1409,7 +1409,7 @@ void CXFA_FM2JSContext::Num2GMTime(FXJSE_HOBJECT hThis, Num2AllTime(hThis, iTime, formatString, localString, TRUE, szGMTTimeString); if (szGMTTimeString.IsEmpty()) { - szGMTTimeString = FX_BSTRC(""); + szGMTTimeString = ""; } FXJSE_Value_SetUTF8String(args.GetReturnValue(), szGMTTimeString); } else { @@ -1470,7 +1470,7 @@ void CXFA_FM2JSContext::Num2Time(FXJSE_HOBJECT hThis, Num2AllTime(hThis, (int32_t)fTime, formatString, localString, FALSE, szLocalTimeString); if (szLocalTimeString.IsEmpty()) { - szLocalTimeString = FX_BSTRC(""); + szLocalTimeString = ""; } FXJSE_Value_SetUTF8String(args.GetReturnValue(), szLocalTimeString); } else { @@ -1646,7 +1646,7 @@ void CXFA_FM2JSContext::TimeFmt(FXJSE_HOBJECT hThis, CFX_ByteString formatStr; GetStandardTimeFormat(hThis, iStyle, szLocal, formatStr); if (formatStr.IsEmpty()) { - formatStr = FX_BSTRC(""); + formatStr = ""; } FXJSE_Value_SetUTF8String(args.GetReturnValue(), formatStr); } else { @@ -2470,7 +2470,7 @@ void CXFA_FM2JSContext::Num2AllTime(FXJSE_HOBJECT hThis, iRet = IsoTime2Local(hThis, strIsoTime, szFormat, szLocale, strTime); } if (!iRet) { - strTime = FX_BSTRC(""); + strTime = ""; } return; } @@ -3021,7 +3021,7 @@ void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis, if (argOneIsNull) { FXJSE_Value_SetNull(args.GetReturnValue()); } else if (iIndex < 1) { - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } else { FX_BOOL bFound = FALSE; FX_BOOL bStopCounterFlags = FALSE; @@ -3031,8 +3031,7 @@ void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis, FXJSE_HVALUE argIndexValue = args.GetValue(iArgIndex); if (FXJSE_Value_IsArray(argIndexValue)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argIndexValue, FX_BSTRC("length"), - lengthValue); + FXJSE_Value_GetObjectProp(argIndexValue, "length", lengthValue); int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if (iLength > 3) { @@ -3075,7 +3074,7 @@ void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis, iArgIndex++; } if (!bFound) { - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } } } else { @@ -3269,7 +3268,7 @@ void CXFA_FM2JSContext::Ref(FXJSE_HOBJECT hThis, } } else if (FXJSE_Value_IsArray(argOne)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argOne, FX_BSTRC("length"), lengthValue); + FXJSE_Value_GetObjectProp(argOne, "length", lengthValue); int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); FXSYS_assert(iLength >= 3); @@ -3335,7 +3334,7 @@ void CXFA_FM2JSContext::UnitType(FXJSE_HOBJECT hThis, CFX_ByteString unitspanString; HValueToUTF8String(unitspanValue, unitspanString); if (unitspanString.IsEmpty()) { - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("in")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), "in"); } else { enum XFA_FM2JS_VALUETYPE_ParserStatus { VALUETYPE_START, @@ -3415,19 +3414,19 @@ void CXFA_FM2JSContext::UnitType(FXJSE_HOBJECT hThis, } switch (eParserStatus) { case VALUETYPE_ISCM: - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("cm")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), "cm"); break; case VALUETYPE_ISMM: - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("mm")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), "mm"); break; case VALUETYPE_ISPT: - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("pt")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), "pt"); break; case VALUETYPE_ISMP: - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("mp")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), "mp"); break; default: - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("in")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), "in"); break; } } @@ -3693,9 +3692,9 @@ void CXFA_FM2JSContext::Decode(FXJSE_HOBJECT hThis, CFX_ByteString identifyString; HValueToUTF8String(argTwo, identifyString); CFX_ByteTextBuf resultBuf; - if (identifyString.EqualNoCase(FX_BSTRC("html"))) { + if (identifyString.EqualNoCase("html")) { DecodeHTML(toDecodeString, resultBuf); - } else if (identifyString.EqualNoCase(FX_BSTRC("xml"))) { + } else if (identifyString.EqualNoCase("xml")) { DecodeXML(toDecodeString, resultBuf); } else { DecodeURL(toDecodeString, resultBuf); @@ -3963,9 +3962,9 @@ void CXFA_FM2JSContext::Encode(FXJSE_HOBJECT hThis, CFX_ByteString identifyString; HValueToUTF8String(argTwo, identifyString); CFX_ByteTextBuf resultBuf; - if (identifyString.EqualNoCase(FX_BSTRC("html"))) { + if (identifyString.EqualNoCase("html")) { EncodeHTML(toEncodeString, resultBuf); - } else if (identifyString.EqualNoCase(FX_BSTRC("xml"))) { + } else if (identifyString.EqualNoCase("xml")) { EncodeXML(toEncodeString, resultBuf); } else { EncodeURL(toEncodeString, resultBuf); @@ -4424,7 +4423,7 @@ void CXFA_FM2JSContext::Format(FXJSE_HOBJECT hThis, FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_UTF8Encode(wsRet, wsRet.GetLength())); } else { - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } FXJSE_Value_Release(argOne); FXJSE_Value_Release(argTwo); @@ -4591,7 +4590,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, szParsedValue = FX_UTF8Encode(localeValue.GetValue()); FXJSE_Value_SetUTF8String(args.GetReturnValue(), szParsedValue); } else { - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } } else { switch (patternType) { @@ -4610,7 +4609,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, szParsedValue = FX_UTF8Encode(localeValue.GetValue()); FXJSE_Value_SetUTF8String(args.GetReturnValue(), szParsedValue); } else { - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } } break; case XFA_VT_DATE: { @@ -4622,7 +4621,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, szParsedValue = FX_UTF8Encode(localeValue.GetValue()); FXJSE_Value_SetUTF8String(args.GetReturnValue(), szParsedValue); } else { - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } } break; case XFA_VT_TIME: { @@ -4634,7 +4633,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, szParsedValue = FX_UTF8Encode(localeValue.GetValue()); FXJSE_Value_SetUTF8String(args.GetReturnValue(), szParsedValue); } else { - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } } break; case XFA_VT_TEXT: { @@ -4646,7 +4645,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, szParsedValue = FX_UTF8Encode(localeValue.GetValue()); FXJSE_Value_SetUTF8String(args.GetReturnValue(), szParsedValue); } else { - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } } break; case XFA_VT_FLOAT: { @@ -4658,7 +4657,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, FXJSE_Value_SetDouble(args.GetReturnValue(), localeValue.GetDoubleNum()); } else { - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } } break; default: { @@ -4679,7 +4678,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, szParsedValue = FX_UTF8Encode(localeValue.GetValue()); FXJSE_Value_SetUTF8String(args.GetReturnValue(), szParsedValue); } else { - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } } } break; @@ -5054,7 +5053,7 @@ void CXFA_FM2JSContext::Substr(FXJSE_HOBJECT hThis, HValueToUTF8String(stringValue, szSourceStr); int32_t iLength = szSourceStr.GetLength(); if (iLength == 0) { - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } else { iStart = (int32_t)HValueToFloat(hThis, startValue); iCount = (int32_t)HValueToFloat(hThis, endValue); @@ -5193,7 +5192,7 @@ void CXFA_FM2JSContext::WordNum(FXJSE_HOBJECT hThis, } if (!bFlags) { if ((fNumber < 0) || (fNumber > 922337203685477550)) { - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("*")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), "*"); } else { CFX_ByteTextBuf resultBuf; CFX_ByteString numberString; @@ -5259,7 +5258,7 @@ void CXFA_FM2JSContext::TrillionUS(const CFX_ByteStringC& szData, } else { if (*(pData + iIndex + 1) > '1') { strBuf << pLastTens[*(pData + iIndex + 1) - '2']; - strBuf << FX_BSTRC("-"); + strBuf << "-"; strBuf << pUnits[*(pData + iIndex + 2) - '0']; } else if (*(pData + iIndex + 1) == '1') { strBuf << pTens[*(pData + iIndex + 2) - '0']; @@ -5274,7 +5273,7 @@ void CXFA_FM2JSContext::TrillionUS(const CFX_ByteStringC& szData, } else { if (*(pData + iIndex) > '1') { strBuf << pLastTens[*(pData + iIndex) - '2']; - strBuf << FX_BSTRC("-"); + strBuf << "-"; strBuf << pUnits[*(pData + iIndex + 1) - '0']; } else if (*(pData + iIndex) == '1') { strBuf << pTens[*(pData + iIndex + 1) - '0']; @@ -5301,7 +5300,7 @@ void CXFA_FM2JSContext::TrillionUS(const CFX_ByteStringC& szData, } else { if (*(pData + iIndex + 1) > '1') { strBuf << pLastTens[*(pData + iIndex + 1) - '2']; - strBuf << FX_BSTRC("-"); + strBuf << "-"; strBuf << pUnits[*(pData + iIndex + 2) - '0']; } else if (*(pData + iIndex + 1) == '1') { strBuf << pTens[*(pData + iIndex + 2) - '0']; @@ -5341,7 +5340,7 @@ void CXFA_FM2JSContext::WordUS(const CFX_ByteStringC& szData, TrillionUS(CFX_ByteStringC(pData + iIndex, iCount), strBuf); iIndex += iCount; if (iIndex < iLength) { - strBuf << FX_BSTRC(" Trillion "); + strBuf << " Trillion "; } } } break; @@ -5364,10 +5363,10 @@ void CXFA_FM2JSContext::WordUS(const CFX_ByteStringC& szData, TrillionUS(CFX_ByteStringC(pData + iIndex, iCount), strBuf); iIndex += iCount; if (iIndex < iLength) { - strBuf << FX_BSTRC(" Trillion "); + strBuf << " Trillion "; } } - strBuf << FX_BSTRC(" Dollars"); + strBuf << " Dollars"; } break; case 2: { int32_t iIndex = 0; @@ -5388,12 +5387,12 @@ void CXFA_FM2JSContext::WordUS(const CFX_ByteStringC& szData, TrillionUS(CFX_ByteStringC(pData + iIndex, iCount), strBuf); iIndex += iCount; if (iIndex < iInteger) { - strBuf << FX_BSTRC(" Trillion "); + strBuf << " Trillion "; } } - strBuf << FX_BSTRC(" Dollars"); + strBuf << " Dollars"; if (iInteger < iLength) { - strBuf << FX_BSTRC(" And "); + strBuf << " And "; iIndex = iInteger + 1; int32_t iCount = 0; while (iIndex < iLength) { @@ -5404,10 +5403,10 @@ void CXFA_FM2JSContext::WordUS(const CFX_ByteStringC& szData, TrillionUS(CFX_ByteStringC(pData + iIndex, iCount), strBuf); iIndex += iCount; if (iIndex < iLength) { - strBuf << FX_BSTRC(" Trillion "); + strBuf << " Trillion "; } } - strBuf << FX_BSTRC(" Cents"); + strBuf << " Cents"; } } break; default: @@ -5565,7 +5564,7 @@ void CXFA_FM2JSContext::Put(FXJSE_HOBJECT hThis, FXJSE_Value_Release(argThree); } if (bFlags) { - FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("")); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); } else { pContext->ThrowScriptErrorMessage(XFA_IDS_SERVER_DENY); } @@ -5586,7 +5585,7 @@ void CXFA_FM2JSContext::assign_value_operator(FXJSE_HOBJECT hThis, FX_BOOL bSetStatus = TRUE; if (FXJSE_Value_IsArray(lValue)) { FXJSE_HVALUE leftLengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(lValue, FX_BSTRC("length"), leftLengthValue); + FXJSE_Value_GetObjectProp(lValue, "length", leftLengthValue); int32_t iLeftLength = FXJSE_Value_ToInteger(leftLengthValue); FXJSE_Value_Release(leftLengthValue); FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(hruntime); @@ -6067,7 +6066,7 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, GenerateSomExpression(szName, iIndexFlags, iIndexValue, bIsStar, szSomExp); if (FXJSE_Value_IsArray(argAccessor)) { FXJSE_HVALUE hLengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argAccessor, FX_BSTRC("length"), hLengthValue); + FXJSE_Value_GetObjectProp(argAccessor, "length", hLengthValue); int32_t iLength = FXJSE_Value_ToInteger(hLengthValue); FXJSE_Value_Release(hLengthValue); int32_t iCounter = 0; @@ -6218,7 +6217,7 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, GenerateSomExpression(szName, iIndexFlags, iIndexValue, bIsStar, szSomExp); if (FXJSE_Value_IsArray(argAccessor)) { FXJSE_HVALUE hLengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argAccessor, FX_BSTRC("length"), hLengthValue); + FXJSE_Value_GetObjectProp(argAccessor, "length", hLengthValue); int32_t iLength = FXJSE_Value_ToInteger(hLengthValue); int32_t iCounter = 0; FXJSE_HVALUE** hResolveValues = FX_Alloc(FXJSE_HVALUE*, iLength - 2); @@ -6443,7 +6442,7 @@ void CXFA_FM2JSContext::get_fm_jsobj(FXJSE_HOBJECT hThis, FXJSE_HVALUE argOne = args.GetValue(0); if (FXJSE_Value_IsArray(argOne)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argOne, FX_BSTRC("length"), lengthValue); + FXJSE_Value_GetObjectProp(argOne, "length", lengthValue); int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXSYS_assert(iLength >= 3); FXJSE_Value_Release(lengthValue); @@ -6467,7 +6466,7 @@ void CXFA_FM2JSContext::fm_var_filter(FXJSE_HOBJECT hThis, FXJSE_HVALUE argOne = args.GetValue(0); if (FXJSE_Value_IsArray(argOne)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argOne, FX_BSTRC("length"), lengthValue); + FXJSE_Value_GetObjectProp(argOne, "length", lengthValue); int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXSYS_assert(iLength >= 3); FXJSE_Value_Release(lengthValue); @@ -6524,7 +6523,7 @@ void CXFA_FM2JSContext::concat_fm_object(FXJSE_HOBJECT hThis, argValues[i] = args.GetValue(i); if (FXJSE_Value_IsArray(argValues[i])) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argValues[i], FX_BSTRC("length"), lengthValue); + FXJSE_Value_GetObjectProp(argValues[i], "length", lengthValue); int32_t length = FXJSE_Value_ToInteger(lengthValue); iLength = iLength + ((length > 2) ? (length - 2) : 0); FXJSE_Value_Release(lengthValue); @@ -6539,7 +6538,7 @@ void CXFA_FM2JSContext::concat_fm_object(FXJSE_HOBJECT hThis, for (int32_t i = 0; i < argCount; i++) { if (FXJSE_Value_IsArray(argValues[i])) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argValues[i], FX_BSTRC("length"), lengthValue); + FXJSE_Value_GetObjectProp(argValues[i], "length", lengthValue); int32_t length = FXJSE_Value_ToInteger(lengthValue); for (int32_t j = 2; j < length; j++) { FXJSE_Value_GetObjectPropByIdx(argValues[i], j, returnValues[index]); @@ -6570,7 +6569,7 @@ FXJSE_HVALUE CXFA_FM2JSContext::GetSimpleHValue(FXJSE_HOBJECT hThis, FXJSE_HVALUE argIndex = args.GetValue(index); if (FXJSE_Value_IsArray(argIndex)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argIndex, FX_BSTRC("length"), lengthValue); + FXJSE_Value_GetObjectProp(argIndex, "length", lengthValue); int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); FXJSE_HVALUE simpleValue = FXJSE_Value_Create(hruntime); @@ -6656,7 +6655,7 @@ int32_t CXFA_FM2JSContext::hvalue_get_array_length(FXJSE_HOBJECT hThis, int32_t iLength = 0; if (FXJSE_Value_IsArray(arg)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(arg, FX_BSTRC("length"), lengthValue); + FXJSE_Value_GetObjectProp(arg, "length", lengthValue); iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); } @@ -6699,7 +6698,7 @@ void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis, argsValue[i] = args.GetValue(i); if (FXJSE_Value_IsArray(argsValue[i])) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argsValue[i], FX_BSTRC("length"), lengthValue); + FXJSE_Value_GetObjectProp(argsValue[i], "length", lengthValue); int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); iCount += ((iLength > 2) ? (iLength - 2) : 0); @@ -6715,7 +6714,7 @@ void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis, for (int32_t i = iStart; i < argc; i++) { if (FXJSE_Value_IsArray(argsValue[i])) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); - FXJSE_Value_GetObjectProp(argsValue[i], FX_BSTRC("length"), lengthValue); + FXJSE_Value_GetObjectProp(argsValue[i], "length", lengthValue); int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if (iLength > 2) { @@ -6781,7 +6780,7 @@ void CXFA_FM2JSContext::GenerateSomExpression(const CFX_ByteStringC& szName, FX_BOOL bIsStar, CFX_ByteString& szSomExp) { if (bIsStar) { - szSomExp = szName + FX_BSTRC("[*]"); + szSomExp = szName + "[*]"; return; } if (iIndexFlags == 0) { @@ -6789,21 +6788,19 @@ void CXFA_FM2JSContext::GenerateSomExpression(const CFX_ByteStringC& szName, return; } if (iIndexFlags == 1 || iIndexValue == 0) { - szSomExp = szName + FX_BSTRC("[") + + szSomExp = szName + "[" + CFX_ByteString::FormatInteger(iIndexValue, FXFORMAT_SIGNED) + - FX_BSTRC("]"); + "]"; } else if (iIndexFlags == 2) { - szSomExp = (iIndexValue < 0) ? (szName + FX_BSTRC("[-")) - : (szName + FX_BSTRC("[+")); + szSomExp = (iIndexValue < 0) ? (szName + "[-") : (szName + "[+"); iIndexValue = (iIndexValue < 0) ? (0 - iIndexValue) : iIndexValue; szSomExp += CFX_ByteString::FormatInteger(iIndexValue); - szSomExp += FX_BSTRC("]"); + szSomExp += "]"; } else { - szSomExp = (iIndexValue < 0) ? (szName + FX_BSTRC("[")) - : (szName + FX_BSTRC("[-")); + szSomExp = (iIndexValue < 0) ? (szName + "[") : (szName + "[-"); iIndexValue = (iIndexValue < 0) ? (0 - iIndexValue) : iIndexValue; szSomExp += CFX_ByteString::FormatInteger(iIndexValue); - szSomExp += FX_BSTRC("]"); + szSomExp += "]"; } } FX_BOOL CXFA_FM2JSContext::GetObjectByName( @@ -7203,6 +7200,5 @@ void CXFA_FM2JSContext::ThrowScriptErrorMessage(int32_t iStringID, ...) { va_start(arg_ptr, iStringID); wsMessage.FormatV((const FX_WCHAR*)wsFormat, arg_ptr); va_end(arg_ptr); - FXJSE_ThrowMessage(FX_BSTRC(""), - FX_UTF8Encode(wsMessage, wsMessage.GetLength())); + FXJSE_ThrowMessage("", FX_UTF8Encode(wsMessage, wsMessage.GetLength())); } diff --git a/xfa/src/fxfa/src/parser/xfa_locale.cpp b/xfa/src/fxfa/src/parser/xfa_locale.cpp index b0d3181ede..50157aa83f 100644 --- a/xfa/src/fxfa/src/parser/xfa_locale.cpp +++ b/xfa/src/fxfa/src/parser/xfa_locale.cpp @@ -35,8 +35,7 @@ void CXFA_XMLLocale::Release() { delete this; } CFX_WideString CXFA_XMLLocale::GetName() { - return m_pLocaleData ? m_pLocaleData->GetAttrValue(FX_BSTRC("name")) - : CFX_WideString(); + return m_pLocaleData ? m_pLocaleData->GetAttrValue("name") : CFX_WideString(); } void CXFA_XMLLocale::GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, CFX_WideString& wsNumSymbol) const { @@ -44,37 +43,37 @@ void CXFA_XMLLocale::GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, CFX_WideString wsName; switch (eType) { case FX_LOCALENUMSYMBOL_Decimal: - bsSymbols = FX_BSTRC("numberSymbols"); + bsSymbols = "numberSymbols"; wsName = FX_WSTRC(L"decimal"); break; case FX_LOCALENUMSYMBOL_Grouping: - bsSymbols = FX_BSTRC("numberSymbols"); + bsSymbols = "numberSymbols"; wsName = FX_WSTRC(L"grouping"); break; case FX_LOCALENUMSYMBOL_Percent: - bsSymbols = FX_BSTRC("numberSymbols"); + bsSymbols = "numberSymbols"; wsName = FX_WSTRC(L"percent"); break; case FX_LOCALENUMSYMBOL_Minus: - bsSymbols = (FX_BSTRC("numberSymbols")); + bsSymbols = "numberSymbols"; wsName = FX_WSTRC(L"minus"); break; case FX_LOCALENUMSYMBOL_Zero: - bsSymbols = (FX_BSTRC("numberSymbols")); + bsSymbols = "numberSymbols"; wsName = FX_WSTRC(L"zero"); break; case FX_LOCALENUMSYMBOL_CurrencySymbol: - bsSymbols = (FX_BSTRC("currencySymbols")); + bsSymbols = "currencySymbols"; wsName = FX_WSTRC(L"symbol"); break; case FX_LOCALENUMSYMBOL_CurrencyName: - bsSymbols = (FX_BSTRC("currencySymbols")); + bsSymbols = "currencySymbols"; wsName = FX_WSTRC(L"isoname"); break; default: return; } - CXML_Element* pElement = m_pLocaleData->GetElement(FX_BSTRC(""), bsSymbols); + CXML_Element* pElement = m_pLocaleData->GetElement("", bsSymbols); if (!pElement) { return; } @@ -88,7 +87,7 @@ void CXFA_XMLLocale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const { } CFX_ByteString bsSpace; CXML_Element* pNumberSymbols = - m_pLocaleData->GetElement(bsSpace, FX_BSTRC("dateTimeSymbols")); + m_pLocaleData->GetElement(bsSpace, "dateTimeSymbols"); if (!pNumberSymbols) { return; } @@ -97,23 +96,23 @@ void CXFA_XMLLocale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const { void CXFA_XMLLocale::GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr) const { - wsMonthName = GetCalendarSymbol(FX_BSTRC("month"), nMonth, bAbbr); + wsMonthName = GetCalendarSymbol("month", nMonth, bAbbr); } void CXFA_XMLLocale::GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr) const { - wsDayName = GetCalendarSymbol(FX_BSTRC("day"), nWeek, bAbbr); + wsDayName = GetCalendarSymbol("day", nWeek, bAbbr); } void CXFA_XMLLocale::GetMeridiemName(CFX_WideString& wsMeridiemName, FX_BOOL bAM) const { - wsMeridiemName = GetCalendarSymbol(FX_BSTRC("meridiem"), bAM ? 0 : 1, FALSE); + wsMeridiemName = GetCalendarSymbol("meridiem", bAM ? 0 : 1, FALSE); } void CXFA_XMLLocale::GetTimeZone(FX_TIMEZONE& tz) const { IXFA_TimeZoneProvider* pProvider = IXFA_TimeZoneProvider::Get(); pProvider->GetTimeZone(tz); } void CXFA_XMLLocale::GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD) const { - wsEraName = GetCalendarSymbol(FX_BSTRC("era"), bAD ? 1 : 0, FALSE); + wsEraName = GetCalendarSymbol("era", bAD ? 1 : 0, FALSE); } CFX_WideString CXFA_XMLLocale::GetCalendarSymbol(const CFX_ByteStringC& symbol, int index, @@ -121,16 +120,14 @@ CFX_WideString CXFA_XMLLocale::GetCalendarSymbol(const CFX_ByteStringC& symbol, CFX_ByteString pstrSymbolNames = symbol + "Names"; CFX_WideString wsSymbolName = L""; if (m_pLocaleData) { - CXML_Element* pChild = - m_pLocaleData->GetElement("", FX_BSTRC("calendarSymbols")); + CXML_Element* pChild = m_pLocaleData->GetElement("", "calendarSymbols"); if (pChild) { CXML_Element* pSymbolNames = pChild->GetElement("", pstrSymbolNames); if (pSymbolNames) { - if (pSymbolNames->GetAttrInteger(FX_BSTRC("abbr")) != bAbbr) { + if (pSymbolNames->GetAttrInteger("abbr") != bAbbr) { pSymbolNames = pChild->GetElement("", pstrSymbolNames, 1); } - if (pSymbolNames && - pSymbolNames->GetAttrInteger(FX_BSTRC("abbr")) == bAbbr) { + if (pSymbolNames && pSymbolNames->GetAttrInteger("abbr") == bAbbr) { CXML_Element* pSymbolName = pSymbolNames->GetElement("", symbol, index); if (pSymbolName) { @@ -144,8 +141,7 @@ CFX_WideString CXFA_XMLLocale::GetCalendarSymbol(const CFX_ByteStringC& symbol, } void CXFA_XMLLocale::GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType, CFX_WideString& wsPattern) const { - CXML_Element* pElement = - m_pLocaleData->GetElement(FX_BSTRC(""), FX_BSTRC("datePatterns")); + CXML_Element* pElement = m_pLocaleData->GetElement("", "datePatterns"); if (pElement == NULL) { return; } @@ -165,12 +161,11 @@ void CXFA_XMLLocale::GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType, wsName = L"long"; break; } - GetPattern(pElement, FX_BSTRC("datePattern"), wsName, wsPattern); + GetPattern(pElement, "datePattern", wsName, wsPattern); } void CXFA_XMLLocale::GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY eType, CFX_WideString& wsPattern) const { - CXML_Element* pElement = - m_pLocaleData->GetElement(FX_BSTRC(""), FX_BSTRC("timePatterns")); + CXML_Element* pElement = m_pLocaleData->GetElement("", "timePatterns"); if (pElement == NULL) { return; } @@ -190,12 +185,11 @@ void CXFA_XMLLocale::GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY eType, wsName = L"long"; break; } - GetPattern(pElement, FX_BSTRC("timePattern"), wsName, wsPattern); + GetPattern(pElement, "timePattern", wsName, wsPattern); } void CXFA_XMLLocale::GetNumPattern(FX_LOCALENUMSUBCATEGORY eType, CFX_WideString& wsPattern) const { - CXML_Element* pElement = - m_pLocaleData->GetElement(FX_BSTRC(""), FX_BSTRC("numberPatterns")); + CXML_Element* pElement = m_pLocaleData->GetElement("", "numberPatterns"); if (pElement == NULL) { return; } @@ -218,10 +212,10 @@ void CXFA_XMLLocale::GetPattern(CXML_Element* pElement, const CFX_ByteStringC& bsTag, const CFX_WideStringC& wsName, CFX_WideString& wsPattern) const { - int32_t iCount = pElement->CountElements(FX_BSTRC(""), bsTag); + int32_t iCount = pElement->CountElements("", bsTag); for (int32_t i = 0; i < iCount; i++) { - CXML_Element* pChild = pElement->GetElement(FX_BSTRC(""), bsTag, i); - if (pChild->GetAttrValue(FX_BSTRC("name")) == wsName) { + CXML_Element* pChild = pElement->GetElement("", bsTag, i); + if (pChild->GetAttrValue("name") == wsName) { wsPattern = pChild->GetContent(0); return; } diff --git a/xfa/src/fxfa/src/parser/xfa_object_imp.cpp b/xfa/src/fxfa/src/parser/xfa_object_imp.cpp index bbc2e5b685..9f77d7e75a 100644 --- a/xfa/src/fxfa/src/parser/xfa_object_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_object_imp.cpp @@ -65,8 +65,7 @@ void CXFA_Object::ThrowScriptErrorMessage(int32_t iStringID, ...) { va_start(arg_ptr, iStringID); wsMessage.FormatV((const FX_WCHAR*)wsFormat, arg_ptr); va_end(arg_ptr); - FXJSE_ThrowMessage(FX_BSTRC(""), - FX_UTF8Encode(wsMessage, wsMessage.GetLength())); + FXJSE_ThrowMessage("", FX_UTF8Encode(wsMessage, wsMessage.GetLength())); } static void XFA_DeleteWideString(void* pData) { if (pData) { @@ -742,8 +741,7 @@ void CXFA_Node::Script_TreeClass_Nodes(FXJSE_HVALUE hValue, FXSYS_assert(pAppProvider); CFX_WideString wsMessage; pAppProvider->LoadString(XFA_IDS_Unable_TO_SET, wsMessage); - FXJSE_ThrowMessage(FX_BSTRC(""), - FX_UTF8Encode(wsMessage, wsMessage.GetLength())); + FXJSE_ThrowMessage("", FX_UTF8Encode(wsMessage, wsMessage.GetLength())); } else { CXFA_AttachNodeList* pNodeList = new CXFA_AttachNodeList(m_pDocument, this); FXJSE_Value_SetObject(hValue, (CXFA_Object*)pNodeList, @@ -1066,15 +1064,14 @@ void CXFA_Node::Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments) { FX_BOOL bPrettyMode = FALSE; if (iLength == 1) { CFX_ByteString bsPretty = pArguments->GetUTF8String(0); - if (bsPretty.Equal(FX_BSTRC("pretty"))) { + if (bsPretty.Equal("pretty")) { bPrettyMode = TRUE; } else { ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH); return; } } - CFX_ByteStringC bsXMLHeader = - FX_BSTRC("\n"); + CFX_ByteStringC bsXMLHeader = "\n"; if (GetPacketID() == XFA_XDPPACKET_Form) { IFX_MemoryStream* pMemoryStream = FX_CreateMemoryStream(TRUE); if (!pMemoryStream) { @@ -1137,7 +1134,7 @@ void CXFA_Node::Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments) { return; } } else { - FXJSE_Value_SetUTF8String(pArguments->GetReturnValue(), FX_BSTRC("")); + FXJSE_Value_SetUTF8String(pArguments->GetReturnValue(), ""); } } void CXFA_Node::Script_NodeClass_SetAttribute(CFXJSE_Arguments* pArguments) { @@ -1292,16 +1289,14 @@ void CXFA_Node::Script_Attribute_BOOL(FXJSE_HVALUE hValue, if (bSetting) { SetBoolean(eAttribute, FXJSE_Value_ToBoolean(hValue), TRUE); } else { - FXJSE_Value_SetUTF8String( - hValue, GetBoolean(eAttribute) ? FX_BSTRC("1") : FX_BSTRC("0")); + FXJSE_Value_SetUTF8String(hValue, GetBoolean(eAttribute) ? "1" : "0"); } } void CXFA_Node::Script_Attribute_BOOLRead(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { if (!bSetting) { - FXJSE_Value_SetUTF8String( - hValue, GetBoolean(eAttribute) ? FX_BSTRC("1") : FX_BSTRC("0")); + FXJSE_Value_SetUTF8String(hValue, GetBoolean(eAttribute) ? "1" : "0"); } else { ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); } @@ -2181,7 +2176,7 @@ void CXFA_Node::Script_Field_ExecEvent(CFXJSE_Arguments* pArguments) { int32_t iRet = execSingleEventByName( CFX_WideString::FromUTF8(eventString, eventString.GetLength()), XFA_ELEMENT_Field); - if (eventString == FX_BSTRC("validate")) { + if (eventString == "validate") { FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE)); } @@ -3401,7 +3396,7 @@ void CXFA_Node::Script_Occur_Min(FXJSE_HVALUE hValue, void CXFA_Node::Script_Desc_Metadata(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if ((argc == 0) || (argc == 1)) { - FXJSE_Value_SetUTF8String(pArguments->GetReturnValue(), FX_BSTRC("")); + FXJSE_Value_SetUTF8String(pArguments->GetReturnValue(), ""); } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"metadata"); } diff --git a/xfa/src/fxfa/src/parser/xfa_script_imp.cpp b/xfa/src/fxfa/src/parser/xfa_script_imp.cpp index 95b8b78377..d35c48f1a9 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_imp.cpp @@ -209,7 +209,7 @@ void CXFA_ScriptContext::GlobalPropertyGetter(FXJSE_HOBJECT hObject, CFX_WideString wsPropName = CFX_WideString::FromUTF8( (const FX_CHAR*)szPropName.GetPtr(), szPropName.GetLength()); if (lpScriptContext->GetType() == XFA_SCRIPTLANGTYPE_Formcalc) { - if (szPropName == FX_BSTRC(FOXIT_XFA_FM2JS_FORMCALC_RUNTIME)) { + if (szPropName == FOXIT_XFA_FM2JS_FORMCALC_RUNTIME) { XFA_FM2JS_GlobalPropertyGetter(lpScriptContext->m_hFM2JSContext, hValue); return; } -- cgit v1.2.3