From afe94306e3c542f0d499e7f7706ee5dec4028d8a Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 13 May 2016 17:21:31 -0700 Subject: Make CFX_WideString(const CFX_WideString&) explicit. BUG= Review-Url: https://codereview.chromium.org/1979723003 --- core/fpdfdoc/doc_basic.cpp | 4 +-- core/fpdftext/fpdf_text_int.cpp | 13 +++---- core/fxcrt/fx_basic_bstring.cpp | 2 +- core/fxcrt/fx_basic_buffer.cpp | 5 --- core/fxcrt/fx_basic_wstring.cpp | 6 ++-- core/fxcrt/fx_xml_parser.cpp | 6 ++-- core/fxcrt/include/fx_basic.h | 10 +++++- core/fxcrt/include/fx_string.h | 3 +- fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp | 16 ++++----- fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h | 2 +- xfa/fgas/localization/fgas_locale.cpp | 15 ++++---- xfa/fgas/localization/fgas_locale.h | 2 +- xfa/fgas/localization/fgas_localeimp.h | 3 +- xfa/fgas/localization/fgas_localemgr.cpp | 5 ++- xfa/fgas/localization/fgas_localemgr.h | 14 ++++---- xfa/fwl/basewidget/fwl_editimp.cpp | 2 +- xfa/fxbarcode/cbc_codabar.cpp | 2 +- xfa/fxbarcode/cbc_code128.cpp | 4 +-- xfa/fxbarcode/cbc_code39.cpp | 2 +- xfa/fxbarcode/cbc_datamatrix.cpp | 7 ++-- xfa/fxbarcode/cbc_ean13.cpp | 2 +- xfa/fxbarcode/cbc_ean8.cpp | 2 +- xfa/fxbarcode/cbc_pdf417i.cpp | 7 ++-- xfa/fxbarcode/cbc_qrcode.cpp | 11 +++--- xfa/fxbarcode/cbc_upca.cpp | 2 +- xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp | 4 +-- xfa/fxfa/app/xfa_ffwidgetacc.cpp | 14 ++++---- xfa/fxfa/app/xfa_ffwidgethandler.cpp | 6 ++-- xfa/fxfa/app/xfa_fontmgr.cpp | 7 ++-- xfa/fxfa/app/xfa_textlayout.cpp | 2 +- xfa/fxfa/fm2js/xfa_expression.cpp | 4 +-- xfa/fxfa/fm2js/xfa_fm2jscontext.cpp | 33 +++++++----------- xfa/fxfa/fm2js/xfa_fmparse.cpp | 40 +++++++++++----------- xfa/fxfa/fm2js/xfa_simpleexpression.cpp | 4 +-- xfa/fxfa/include/fxfa.h | 4 +-- xfa/fxfa/include/fxfa_widget.h | 8 ++--- xfa/fxfa/parser/cxfa_validate.cpp | 16 ++++----- xfa/fxfa/parser/cxfa_validate.h | 4 +-- xfa/fxfa/parser/cxfa_widgetdata.cpp | 26 +++++++------- xfa/fxfa/parser/cxfa_widgetdata.h | 2 +- .../parser/xfa_document_datadescription_imp.cpp | 5 +-- xfa/fxfa/parser/xfa_document_datadescription_imp.h | 2 +- xfa/fxfa/parser/xfa_document_datamerger_imp.cpp | 38 +++++++++----------- xfa/fxfa/parser/xfa_document_serialize.cpp | 12 +++---- xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp | 2 +- xfa/fxfa/parser/xfa_locale.cpp | 3 +- xfa/fxfa/parser/xfa_localemgr.cpp | 4 +-- xfa/fxfa/parser/xfa_localemgr.h | 12 ++++--- xfa/fxfa/parser/xfa_object_imp.cpp | 34 +++++++++--------- xfa/fxfa/parser/xfa_parser_imp.cpp | 16 ++++----- xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp | 2 +- xfa/fxfa/parser/xfa_script_imp.cpp | 2 +- xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp | 2 +- xfa/fxfa/parser/xfa_script_nodehelper.cpp | 3 +- 54 files changed, 226 insertions(+), 232 deletions(-) diff --git a/core/fpdfdoc/doc_basic.cpp b/core/fpdfdoc/doc_basic.cpp index a0c6b2babc..76639efac6 100644 --- a/core/fpdfdoc/doc_basic.cpp +++ b/core/fpdfdoc/doc_basic.cpp @@ -315,7 +315,7 @@ CFX_WideString CPDF_FileSpec::DecodeFileName(const CFX_WideStringC& filepath) { result += ChangeSlashToPlatform(filepath.c_str()); return result; #else - return filepath; + return CFX_WideString(filepath); #endif } @@ -390,7 +390,7 @@ CFX_WideString CPDF_FileSpec::EncodeFileName(const CFX_WideStringC& filepath) { } return ChangeSlashToPDF(filepath.c_str()); #else - return filepath; + return CFX_WideString(filepath); #endif } diff --git a/core/fpdftext/fpdf_text_int.cpp b/core/fpdftext/fpdf_text_int.cpp index f843da3061..136c44b5ed 100644 --- a/core/fpdftext/fpdf_text_int.cpp +++ b/core/fpdftext/fpdf_text_int.cpp @@ -537,7 +537,8 @@ CFX_WideString CPDF_TextPage::GetPageText(int start, int nCount) const { if (nCount == -1) { nCount = pdfium::CollectionSize(m_CharList) - start; - return m_TextBuf.AsStringC().Mid(start, m_TextBuf.AsStringC().GetLength()); + return CFX_WideString( + m_TextBuf.AsStringC().Mid(start, m_TextBuf.AsStringC().GetLength())); } if (nCount <= 0 || m_CharList.empty()) { return L""; @@ -574,7 +575,7 @@ CFX_WideString CPDF_TextPage::GetPageText(int start, int nCount) const { if (nCount <= 0) { return L""; } - return m_TextBuf.AsStringC().Mid(startindex, nCount); + return CFX_WideString(m_TextBuf.AsStringC().Mid(startindex, nCount)); } int CPDF_TextPage::CountRects(int start, int nCount) { @@ -890,7 +891,7 @@ void CPDF_TextPage::CloseTempLine() { if (m_TempCharList.empty()) return; - CFX_WideString str = m_TempTextBuf.AsStringC(); + CFX_WideString str = m_TempTextBuf.MakeString(); FX_BOOL bPrevSpace = FALSE; for (int i = 0; i < str.GetLength(); i++) { if (str.GetAt(i) != ' ') { @@ -1299,7 +1300,7 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) { charinfo.m_OriginY = 0; pTextObj->GetItemInfo(i, &item); if (item.m_CharCode == (uint32_t)-1) { - CFX_WideString str = m_TempTextBuf.AsStringC(); + CFX_WideString str = m_TempTextBuf.MakeString(); if (str.IsEmpty()) { str = m_TextBuf.AsStringC(); } @@ -1435,7 +1436,7 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) { m_TempCharList.push_back(charinfo); } } else if (i == 0) { - CFX_WideString str = m_TempTextBuf.AsStringC(); + CFX_WideString str = m_TempTextBuf.MakeString(); if (!str.IsEmpty() && str.GetAt(str.GetLength() - 1) == TEXT_BLANK_CHAR) { m_TempTextBuf.Delete(m_TempTextBuf.GetLength() - 1, 1); @@ -1478,7 +1479,7 @@ int32_t CPDF_TextPage::GetTextObjectWritingMode( return m_TextlineDir; } FX_BOOL CPDF_TextPage::IsHyphen(FX_WCHAR curChar) { - CFX_WideString strCurText = m_TempTextBuf.AsStringC(); + CFX_WideString strCurText = m_TempTextBuf.MakeString(); if (strCurText.GetLength() == 0) { strCurText = m_TextBuf.AsStringC(); } diff --git a/core/fxcrt/fx_basic_bstring.cpp b/core/fxcrt/fx_basic_bstring.cpp index 3a81e41920..c774e80cb7 100644 --- a/core/fxcrt/fx_basic_bstring.cpp +++ b/core/fxcrt/fx_basic_bstring.cpp @@ -820,7 +820,7 @@ CFX_WideString CFX_ByteString::UTF8Decode() const { for (FX_STRSIZE i = 0; i < GetLength(); i++) { decoder.Input((uint8_t)m_pData->m_String[i]); } - return decoder.GetResult(); + return CFX_WideString(decoder.GetResult()); } // static diff --git a/core/fxcrt/fx_basic_buffer.cpp b/core/fxcrt/fx_basic_buffer.cpp index 5a75f8b487..6008a00b40 100644 --- a/core/fxcrt/fx_basic_buffer.cpp +++ b/core/fxcrt/fx_basic_buffer.cpp @@ -186,11 +186,6 @@ CFX_WideTextBuf& CFX_WideTextBuf::operator<<(const CFX_WideTextBuf& buf) { return *this; } -CFX_WideStringC CFX_WideTextBuf::AsStringC() const { - return CFX_WideStringC(reinterpret_cast(m_pBuffer.get()), - m_DataSize / sizeof(FX_WCHAR)); -} - #ifdef PDF_ENABLE_XFA CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(uint8_t i) { if (m_pStream) { diff --git a/core/fxcrt/fx_basic_wstring.cpp b/core/fxcrt/fx_basic_wstring.cpp index 8c1d494e7a..241c3a6985 100644 --- a/core/fxcrt/fx_basic_wstring.cpp +++ b/core/fxcrt/fx_basic_wstring.cpp @@ -786,10 +786,10 @@ CFX_WideString CFX_WideString::FromUTF8(const CFX_ByteStringC& str) { return CFX_WideString(); CFX_UTF8Decoder decoder; - for (FX_STRSIZE i = 0; i < str.GetLength(); i++) { + for (FX_STRSIZE i = 0; i < str.GetLength(); i++) decoder.Input(str[i]); - } - return decoder.GetResult(); + + return CFX_WideString(decoder.GetResult()); } // static diff --git a/core/fxcrt/fx_xml_parser.cpp b/core/fxcrt/fx_xml_parser.cpp index 4b52189142..a5e351fe56 100644 --- a/core/fxcrt/fx_xml_parser.cpp +++ b/core/fxcrt/fx_xml_parser.cpp @@ -457,7 +457,7 @@ CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, iState = 10; } else { content << decoder.GetResult(); - CFX_WideString dataStr = content.AsStringC(); + CFX_WideString dataStr = content.MakeString(); if (!bCDATA && !m_bSaveSpaceChars) { dataStr.TrimRight(L" \t\r\n"); } @@ -501,7 +501,7 @@ CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, } } while (ReadNextBlock()); content << decoder.GetResult(); - CFX_WideString dataStr = content.AsStringC(); + CFX_WideString dataStr = content.MakeString(); if (!m_bSaveSpaceChars) { dataStr.TrimRight(L" \t\r\n"); } @@ -784,7 +784,7 @@ void CXML_AttrMap::SetAt(const CFX_ByteStringC& space, } } - m_pMap->push_back({space, name, value}); + m_pMap->push_back({space, name, CFX_WideString(value)}); } int CXML_AttrMap::GetSize() const { diff --git a/core/fxcrt/include/fx_basic.h b/core/fxcrt/include/fx_basic.h index 7437d9567c..48999c4f19 100644 --- a/core/fxcrt/include/fx_basic.h +++ b/core/fxcrt/include/fx_basic.h @@ -80,7 +80,15 @@ class CFX_WideTextBuf : public CFX_BinaryBuf { FX_WCHAR* GetBuffer() const { return reinterpret_cast(m_pBuffer.get()); } - CFX_WideStringC AsStringC() const; + + CFX_WideStringC AsStringC() const { + return CFX_WideStringC(reinterpret_cast(m_pBuffer.get()), + m_DataSize / sizeof(FX_WCHAR)); + } + CFX_WideString MakeString() const { + return CFX_WideString(reinterpret_cast(m_pBuffer.get()), + m_DataSize / sizeof(FX_WCHAR)); + } void Delete(int start_index, int count) { CFX_BinaryBuf::Delete(start_index * sizeof(FX_WCHAR), diff --git a/core/fxcrt/include/fx_string.h b/core/fxcrt/include/fx_string.h index 9019522eca..df8afb386f 100644 --- a/core/fxcrt/include/fx_string.h +++ b/core/fxcrt/include/fx_string.h @@ -250,8 +250,7 @@ class CFX_WideString { CFX_WideString(const FX_WCHAR* ptr, FX_STRSIZE len); - // TODO(tsepez): mark constructor as explicit. - CFX_WideString(const CFX_WideStringC& str); + explicit CFX_WideString(const CFX_WideStringC& str); CFX_WideString(const CFX_WideStringC& str1, const CFX_WideStringC& str2); ~CFX_WideString(); diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp index 4b44669c0d..deba943072 100644 --- a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp +++ b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp @@ -614,18 +614,16 @@ void CPDFXFA_Document::GetTitle(CXFA_FFDoc* hDoc, CFX_WideString& wsTitle) { wsTitle = wsTitle.FromLocal(csTitle.GetBuffer(csTitle.GetLength())); csTitle.ReleaseBuffer(csTitle.GetLength()); } + void CPDFXFA_Document::SetTitle(CXFA_FFDoc* hDoc, - const CFX_WideStringC& wsTitle) { - if (hDoc != m_pXFADoc) - return; - if (m_pPDFDoc == NULL) + const CFX_WideString& wsTitle) { + if (hDoc != m_pXFADoc || !m_pPDFDoc) return; - CPDF_Dictionary* pInfoDict = m_pPDFDoc->GetInfo(); - if (pInfoDict == NULL) - return; - pInfoDict->SetAt("Title", new CPDF_String(wsTitle)); + if (CPDF_Dictionary* pInfoDict = m_pPDFDoc->GetInfo()) + pInfoDict->SetAt("Title", new CPDF_String(wsTitle)); } + void CPDFXFA_Document::ExportData(CXFA_FFDoc* hDoc, const CFX_WideStringC& wsFilePath, FX_BOOL bXDP) { @@ -1140,7 +1138,7 @@ FX_BOOL CPDFXFA_Document::_SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) { return FALSE; CFX_WideStringC csURLC; submit.GetSubmitTarget(csURLC); - CFX_WideString csURL = csURLC; + CFX_WideString csURL(csURLC); if (csURL.IsEmpty()) { CFX_WideString ws; ws.FromLocal("Submit cancelled."); diff --git a/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h b/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h index 5ffeb21022..a67b7803a0 100644 --- a/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h +++ b/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h @@ -90,7 +90,7 @@ class CPDFXFA_Document : public IXFA_DocProvider { virtual FX_BOOL IsCalculationsEnabled(CXFA_FFDoc* hDoc); virtual void SetCalculationsEnabled(CXFA_FFDoc* hDoc, FX_BOOL bEnabled); virtual void GetTitle(CXFA_FFDoc* hDoc, CFX_WideString& wsTitle); - virtual void SetTitle(CXFA_FFDoc* hDoc, const CFX_WideStringC& wsTitle); + virtual void SetTitle(CXFA_FFDoc* hDoc, const CFX_WideString& wsTitle); virtual void ExportData(CXFA_FFDoc* hDoc, const CFX_WideStringC& wsFilePath, FX_BOOL bXDP = TRUE); diff --git a/xfa/fgas/localization/fgas_locale.cpp b/xfa/fgas/localization/fgas_locale.cpp index 2336b20ee3..851b687c4b 100644 --- a/xfa/fgas/localization/fgas_locale.cpp +++ b/xfa/fgas/localization/fgas_locale.cpp @@ -677,7 +677,7 @@ IFX_Locale* CFX_FormatString::GetTextFormat(const CFX_WideString& wsPattern, while (ccf < iLenf && pStr[ccf] != ')') { wsLCID += pStr[ccf++]; } - pLocale = GetPatternLocale(wsLCID.AsStringC()); + pLocale = GetPatternLocale(wsLCID); } else if (pStr[ccf] == '{') { bBrackOpen = TRUE; break; @@ -737,7 +737,7 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, while (ccf < iLenf && pStr[ccf] != ')') { wsLCID += pStr[ccf++]; } - pLocale = GetPatternLocale(wsLCID.AsStringC()); + pLocale = GetPatternLocale(wsLCID); } else if (pStr[ccf] == '{') { bBrackOpen = TRUE; break; @@ -2192,7 +2192,7 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat( while (ccf < iLenf && pStr[ccf] != ')') { wsLCID += pStr[ccf++]; } - pLocale = GetPatternLocale(wsLCID.AsStringC()); + pLocale = GetPatternLocale(wsLCID); } else if (pStr[ccf] == '{') { bBraceOpen = TRUE; break; @@ -2883,7 +2883,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum, int32_t cc = 0, ccf = 0; const FX_WCHAR* strf = wsNumFormat.c_str(); int lenf = wsNumFormat.GetLength(); - CFX_WideString wsSrcNum = wsInputNum; + CFX_WideString wsSrcNum(wsInputNum); wsSrcNum.TrimLeft('0'); if (wsSrcNum.IsEmpty() || wsSrcNum[0] == '.') { wsSrcNum.Insert(0, '0'); @@ -4269,7 +4269,7 @@ FX_BOOL CFX_FormatString::FormatDateTime(const CFX_WideString& wsSrcDateTime, wsOutput); } } else { - CFX_WideStringC wsSrcDate(wsSrcDateTime.c_str(), iT); + CFX_WideString wsSrcDate(wsSrcDateTime.c_str(), iT); CFX_WideStringC wsSrcTime(wsSrcDateTime.c_str() + iT + 1, wsSrcDateTime.GetLength() - iT - 1); if (wsSrcDate.IsEmpty() || wsSrcTime.IsEmpty()) { @@ -4345,10 +4345,7 @@ FX_BOOL CFX_FormatString::FormatNull(const CFX_WideString& wsPattern, } return TRUE; } -IFX_Locale* CFX_FormatString::GetPatternLocale( - const CFX_WideStringC& wsLocale) { - if (m_bUseLCID) { - } +IFX_Locale* CFX_FormatString::GetPatternLocale(const CFX_WideString& wsLocale) { return m_pLocaleMgr->GetLocaleByName(wsLocale); } #define FXMATH_DECIMAL_SCALELIMIT 0x1c diff --git a/xfa/fgas/localization/fgas_locale.h b/xfa/fgas/localization/fgas_locale.h index 48592a3bb2..d1d862b0b5 100644 --- a/xfa/fgas/localization/fgas_locale.h +++ b/xfa/fgas/localization/fgas_locale.h @@ -90,7 +90,7 @@ class IFX_LocaleMgr { virtual uint16_t GetDefLocaleID() = 0; virtual IFX_Locale* GetDefLocale() = 0; virtual IFX_Locale* GetLocale(uint16_t lcid) = 0; - virtual IFX_Locale* GetLocaleByName(const CFX_WideStringC& wsLocaleName) = 0; + virtual IFX_Locale* GetLocaleByName(const CFX_WideString& wsLocaleName) = 0; }; IFX_LocaleMgr* FX_LocaleMgr_Create(const FX_WCHAR* pszLocalPath, uint16_t wDefaultLCID); diff --git a/xfa/fgas/localization/fgas_localeimp.h b/xfa/fgas/localization/fgas_localeimp.h index c828a6bbd7..bbbdcb17e1 100644 --- a/xfa/fgas/localization/fgas_localeimp.h +++ b/xfa/fgas/localization/fgas_localeimp.h @@ -114,7 +114,8 @@ class CFX_FormatString { IFX_Locale*& pLocale, CFX_WideString& wsDatePattern, CFX_WideString& wsTimePattern); - IFX_Locale* GetPatternLocale(const CFX_WideStringC& wsLocale); + IFX_Locale* GetPatternLocale(const CFX_WideString& wsLocale); + IFX_LocaleMgr* m_pLocaleMgr; FX_BOOL m_bUseLCID; }; diff --git a/xfa/fgas/localization/fgas_localemgr.cpp b/xfa/fgas/localization/fgas_localemgr.cpp index 93e5ea0874..e0ce8d9127 100644 --- a/xfa/fgas/localization/fgas_localemgr.cpp +++ b/xfa/fgas/localization/fgas_localemgr.cpp @@ -91,7 +91,6 @@ IFX_Locale* CFX_LocaleMgr::GetLocale(uint16_t lcid) { } return pLocale; } -IFX_Locale* CFX_LocaleMgr::GetLocaleByName( - const CFX_WideStringC& wsLocaleName) { - return NULL; +IFX_Locale* CFX_LocaleMgr::GetLocaleByName(const CFX_WideString& wsLocaleName) { + return nullptr; } diff --git a/xfa/fgas/localization/fgas_localemgr.h b/xfa/fgas/localization/fgas_localemgr.h index 5f2647071b..d0ba90c9a8 100644 --- a/xfa/fgas/localization/fgas_localemgr.h +++ b/xfa/fgas/localization/fgas_localemgr.h @@ -12,15 +12,17 @@ class CFX_LocaleMgr : public IFX_LocaleMgr { public: CFX_LocaleMgr(uint16_t wDefLCID); - virtual void Release() { delete this; } - virtual uint16_t GetDefLocaleID(); - virtual IFX_Locale* GetDefLocale(); - virtual IFX_Locale* GetLocale(uint16_t lcid); - virtual IFX_Locale* GetLocaleByName(const CFX_WideStringC& wsLocaleName); + + void Release() override { delete this; } + uint16_t GetDefLocaleID() override; + IFX_Locale* GetDefLocale() override; + IFX_Locale* GetLocale(uint16_t lcid) override; + IFX_Locale* GetLocaleByName(const CFX_WideString& wsLocaleName) override; + CFX_MapPtrToPtr m_lcid2xml; protected: - ~CFX_LocaleMgr(); + ~CFX_LocaleMgr() override; CFX_MapPtrToPtr m_lcid2locale; uint16_t m_wDefLCID; }; diff --git a/xfa/fwl/basewidget/fwl_editimp.cpp b/xfa/fwl/basewidget/fwl_editimp.cpp index 083a0885f7..a2eab8a60d 100644 --- a/xfa/fwl/basewidget/fwl_editimp.cpp +++ b/xfa/fwl/basewidget/fwl_editimp.cpp @@ -667,7 +667,7 @@ FWL_Error CFWL_EditImp::Replace(int32_t nStart, if (!m_pEdtEngine) return FWL_Error::Indefinite; - m_pEdtEngine->Replace(nStart, nLen, wsReplace); + m_pEdtEngine->Replace(nStart, nLen, CFX_WideString(wsReplace)); return FWL_Error::Succeeded; } diff --git a/xfa/fxbarcode/cbc_codabar.cpp b/xfa/fxbarcode/cbc_codabar.cpp index 3bdc6c1935..23cd2d1e7e 100644 --- a/xfa/fxbarcode/cbc_codabar.cpp +++ b/xfa/fxbarcode/cbc_codabar.cpp @@ -118,6 +118,6 @@ CFX_WideString CBC_Codabar::Decode(CFX_DIBitmap* pBitmap, int32_t& e) { CBC_GlobalHistogramBinarizer binarizer(&source); CBC_BinaryBitmap bitmap(&binarizer); CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e); - BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); + BC_EXCEPTION_CHECK_ReturnValue(e, CFX_WideString()); return CFX_WideString::FromUTF8(str.AsStringC()); } diff --git a/xfa/fxbarcode/cbc_code128.cpp b/xfa/fxbarcode/cbc_code128.cpp index 039e37275d..85d7afbbe8 100644 --- a/xfa/fxbarcode/cbc_code128.cpp +++ b/xfa/fxbarcode/cbc_code128.cpp @@ -53,7 +53,7 @@ FX_BOOL CBC_Code128::Encode(const CFX_WideStringC& contents, BCFORMAT format = BCFORMAT_CODE_128; int32_t outWidth = 0; int32_t outHeight = 0; - CFX_WideString content = contents; + CFX_WideString content(contents); if (contents.GetLength() % 2 && ((CBC_OnedCode128Writer*)m_pBCWriter)->GetType() == BC_CODE128_C) { content += '0'; @@ -101,6 +101,6 @@ CFX_WideString CBC_Code128::Decode(CFX_DIBitmap* pBitmap, int32_t& e) { CBC_GlobalHistogramBinarizer binarizer(&source); CBC_BinaryBitmap bitmap(&binarizer); CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e); - BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); + BC_EXCEPTION_CHECK_ReturnValue(e, CFX_WideString()); return CFX_WideString::FromUTF8(str.AsStringC()); } diff --git a/xfa/fxbarcode/cbc_code39.cpp b/xfa/fxbarcode/cbc_code39.cpp index 516b34e8e3..5d00d772e4 100644 --- a/xfa/fxbarcode/cbc_code39.cpp +++ b/xfa/fxbarcode/cbc_code39.cpp @@ -109,7 +109,7 @@ CFX_WideString CBC_Code39::Decode(CFX_DIBitmap* pBitmap, int32_t& e) { CBC_GlobalHistogramBinarizer binarizer(&source); CBC_BinaryBitmap bitmap(&binarizer); CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e); - BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); + BC_EXCEPTION_CHECK_ReturnValue(e, CFX_WideString()); return CFX_WideString::FromUTF8(str.AsStringC()); } diff --git a/xfa/fxbarcode/cbc_datamatrix.cpp b/xfa/fxbarcode/cbc_datamatrix.cpp index 63385aa2db..7430187f5b 100644 --- a/xfa/fxbarcode/cbc_datamatrix.cpp +++ b/xfa/fxbarcode/cbc_datamatrix.cpp @@ -43,8 +43,9 @@ FX_BOOL CBC_DataMatrix::Encode(const CFX_WideStringC& contents, int32_t& e) { int32_t outWidth = 0; int32_t outHeight = 0; - uint8_t* data = ((CBC_DataMatrixWriter*)m_pBCWriter) - ->Encode(contents, outWidth, outHeight, e); + uint8_t* data = + ((CBC_DataMatrixWriter*)m_pBCWriter) + ->Encode(CFX_WideString(contents), outWidth, outHeight, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); ((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e); FX_Free(data); @@ -78,6 +79,6 @@ CFX_WideString CBC_DataMatrix::Decode(CFX_DIBitmap* pBitmap, int32_t& e) { CBC_GlobalHistogramBinarizer binarizer(&source); CBC_BinaryBitmap bitmap(&binarizer); CFX_ByteString retStr = m_pBCReader->Decode(&bitmap, 0, e); - BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); + BC_EXCEPTION_CHECK_ReturnValue(e, CFX_WideString()); return CFX_WideString::FromUTF8(retStr.AsStringC()); } diff --git a/xfa/fxbarcode/cbc_ean13.cpp b/xfa/fxbarcode/cbc_ean13.cpp index 5f33f4c3d2..ea67c9f64b 100644 --- a/xfa/fxbarcode/cbc_ean13.cpp +++ b/xfa/fxbarcode/cbc_ean13.cpp @@ -109,6 +109,6 @@ CFX_WideString CBC_EAN13::Decode(CFX_DIBitmap* pBitmap, int32_t& e) { CBC_GlobalHistogramBinarizer binarizer(&source); CBC_BinaryBitmap bitmap(&binarizer); CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e); - BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); + BC_EXCEPTION_CHECK_ReturnValue(e, CFX_WideString()); return CFX_WideString::FromUTF8(str.AsStringC()); } diff --git a/xfa/fxbarcode/cbc_ean8.cpp b/xfa/fxbarcode/cbc_ean8.cpp index e92605f2c4..418ef87c1f 100644 --- a/xfa/fxbarcode/cbc_ean8.cpp +++ b/xfa/fxbarcode/cbc_ean8.cpp @@ -108,6 +108,6 @@ CFX_WideString CBC_EAN8::Decode(CFX_DIBitmap* pBitmap, int32_t& e) { CBC_GlobalHistogramBinarizer binarizer(&source); CBC_BinaryBitmap bitmap(&binarizer); CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e); - BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); + BC_EXCEPTION_CHECK_ReturnValue(e, CFX_WideString()); return CFX_WideString::FromUTF8(str.AsStringC()); } diff --git a/xfa/fxbarcode/cbc_pdf417i.cpp b/xfa/fxbarcode/cbc_pdf417i.cpp index 0b7a558327..228caed47f 100644 --- a/xfa/fxbarcode/cbc_pdf417i.cpp +++ b/xfa/fxbarcode/cbc_pdf417i.cpp @@ -51,8 +51,9 @@ FX_BOOL CBC_PDF417I::Encode(const CFX_WideStringC& contents, int32_t& e) { int32_t outWidth = 0; int32_t outHeight = 0; - uint8_t* data = ((CBC_PDF417Writer*)m_pBCWriter) - ->Encode(contents, outWidth, outHeight, e); + uint8_t* data = + ((CBC_PDF417Writer*)m_pBCWriter) + ->Encode(CFX_WideString(contents), outWidth, outHeight, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); ((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e); FX_Free(data); @@ -86,6 +87,6 @@ CFX_WideString CBC_PDF417I::Decode(CFX_DIBitmap* pBitmap, int32_t& e) { CBC_GlobalHistogramBinarizer binarizer(&source); CBC_BinaryBitmap bitmap(&binarizer); CFX_ByteString bytestring = m_pBCReader->Decode(&bitmap, 0, e); - BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); + BC_EXCEPTION_CHECK_ReturnValue(e, CFX_WideString()); return CFX_WideString::FromUTF8(bytestring.AsStringC()); } diff --git a/xfa/fxbarcode/cbc_qrcode.cpp b/xfa/fxbarcode/cbc_qrcode.cpp index 8faf5ad2de..6f93b4415e 100644 --- a/xfa/fxbarcode/cbc_qrcode.cpp +++ b/xfa/fxbarcode/cbc_qrcode.cpp @@ -59,10 +59,11 @@ FX_BOOL CBC_QRCode::Encode(const CFX_WideStringC& contents, int32_t& e) { int32_t outWidth = 0; int32_t outHeight = 0; - uint8_t* data = ((CBC_QRCodeWriter*)m_pBCWriter) - ->Encode(contents, ((CBC_QRCodeWriter*)m_pBCWriter) - ->GetErrorCorrectionLevel(), - outWidth, outHeight, e); + uint8_t* data = + ((CBC_QRCodeWriter*)m_pBCWriter) + ->Encode(CFX_WideString(contents), + ((CBC_QRCodeWriter*)m_pBCWriter)->GetErrorCorrectionLevel(), + outWidth, outHeight, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); ((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e); FX_Free(data); @@ -96,6 +97,6 @@ CFX_WideString CBC_QRCode::Decode(CFX_DIBitmap* pBitmap, int32_t& e) { CBC_GlobalHistogramBinarizer binarizer(&source); CBC_BinaryBitmap bitmap(&binarizer); CFX_ByteString retStr = m_pBCReader->Decode(&bitmap, 0, e); - BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); + BC_EXCEPTION_CHECK_ReturnValue(e, CFX_WideString()); return CFX_WideString::FromUTF8(retStr.AsStringC()); } diff --git a/xfa/fxbarcode/cbc_upca.cpp b/xfa/fxbarcode/cbc_upca.cpp index 2c60c92f40..886525ab54 100644 --- a/xfa/fxbarcode/cbc_upca.cpp +++ b/xfa/fxbarcode/cbc_upca.cpp @@ -111,6 +111,6 @@ CFX_WideString CBC_UPCA::Decode(CFX_DIBitmap* pBitmap, int32_t& e) { CBC_GlobalHistogramBinarizer binarizer(&source); CBC_BinaryBitmap bitmap(&binarizer); CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e); - BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); + BC_EXCEPTION_CHECK_ReturnValue(e, L""); return CFX_WideString::FromUTF8(str.AsStringC()); } diff --git a/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp b/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp index cdbc59ce5b..efebfe547d 100644 --- a/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp +++ b/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp @@ -341,13 +341,13 @@ uint8_t* CBC_OnedCode39Writer::Encode(const CFX_ByteString& contents, CFX_WideString CBC_OnedCode39Writer::encodedContents( const CFX_WideStringC& contents, int32_t& e) { - CFX_WideString encodedContents = contents; + CFX_WideString encodedContents(contents); if (m_bCalcChecksum && m_bPrintChecksum) { CFX_WideString checksumContent = FilterContents(contents); CFX_ByteString str = checksumContent.UTF8Encode(); FX_CHAR checksum; checksum = CalcCheckSum(str, e); - BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); + BC_EXCEPTION_CHECK_ReturnValue(e, CFX_WideString()); str += checksum; encodedContents += checksum; } diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp index fd3757ace5..11081fd5d7 100644 --- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp +++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp @@ -210,8 +210,7 @@ void CXFA_WidgetAcc::ResetData() { image.GetContentType(wsContentType); image.GetHref(wsHref); } - SetImageEdit(wsContentType.AsStringC(), wsHref.AsStringC(), - wsValue.AsStringC()); + SetImageEdit(wsContentType, wsHref, wsValue); } break; case XFA_ELEMENT_ExclGroup: { CXFA_Node* pNextChild = m_pNode->GetNodeItem( @@ -252,12 +251,12 @@ void CXFA_WidgetAcc::ResetData() { break; } } -void CXFA_WidgetAcc::SetImageEdit(const CFX_WideStringC& wsContentType, - const CFX_WideStringC& wsHref, - const CFX_WideStringC& wsData) { +void CXFA_WidgetAcc::SetImageEdit(const CFX_WideString& wsContentType, + const CFX_WideString& wsHref, + const CFX_WideString& wsData) { CXFA_Image image = GetFormValue().GetImage(); if (image) { - image.SetContentType(wsContentType); + image.SetContentType(CFX_WideString(wsContentType)); image.SetHref(wsHref); } CFX_WideString wsFormatValue(wsData); @@ -275,8 +274,7 @@ void CXFA_WidgetAcc::SetImageEdit(const CFX_WideStringC& wsContentType, } else { CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); ASSERT(pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element); - static_cast(pXMLNode) - ->SetString(FX_WSTRC(L"href"), wsHref); + static_cast(pXMLNode)->SetString(L"href", wsHref); } } diff --git a/xfa/fxfa/app/xfa_ffwidgethandler.cpp b/xfa/fxfa/app/xfa_ffwidgethandler.cpp index 314b22731a..13cee333a5 100644 --- a/xfa/fxfa/app/xfa_ffwidgethandler.cpp +++ b/xfa/fxfa/app/xfa_ffwidgethandler.cpp @@ -328,7 +328,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreatePushButton(CXFA_Node* pParent, CXFA_Node* pCaption = CreateCopyNode(XFA_ELEMENT_Caption, pField); CXFA_Node* pValue = CreateCopyNode(XFA_ELEMENT_Value, pCaption); CXFA_Node* pText = CreateCopyNode(XFA_ELEMENT_Text, pValue); - pText->SetContent(FX_WSTRC(L"Button"), FX_WSTRC(L"Button"), FALSE); + pText->SetContent(L"Button", L"Button", FALSE); CXFA_Node* pPara = CreateCopyNode(XFA_ELEMENT_Para, pCaption); pPara->SetEnum(XFA_ATTRIBUTE_VAlign, XFA_ATTRIBUTEENUM_Middle, FALSE); @@ -343,7 +343,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreatePushButton(CXFA_Node* pParent, CXFA_Node* pFill = CreateCopyNode(XFA_ELEMENT_Fill, pBorder); CXFA_Node* pColor = CreateCopyNode(XFA_ELEMENT_Color, pFill); - pColor->SetCData(XFA_ATTRIBUTE_Value, FX_WSTRC(L"212, 208, 200"), FALSE); + pColor->SetCData(XFA_ATTRIBUTE_Value, L"212, 208, 200", FALSE); CXFA_Node* pBind = CreateCopyNode(XFA_ELEMENT_Bind, pField); pBind->SetEnum(XFA_ATTRIBUTE_Match, XFA_ATTRIBUTEENUM_None); @@ -515,7 +515,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateTemplateNode(XFA_ELEMENT eElement, CXFA_Node* CXFA_FFWidgetHandler::CreateFontNode(CXFA_Node* pParent) const { CXFA_Node* pFont = CreateCopyNode(XFA_ELEMENT_Font, pParent); - pFont->SetCData(XFA_ATTRIBUTE_Typeface, FX_WSTRC(L"Myriad Pro"), FALSE); + pFont->SetCData(XFA_ATTRIBUTE_Typeface, L"Myriad Pro", FALSE); return pFont; } diff --git a/xfa/fxfa/app/xfa_fontmgr.cpp b/xfa/fxfa/app/xfa_fontmgr.cpp index 608c9073c3..bf8c1a7326 100644 --- a/xfa/fxfa/app/xfa_fontmgr.cpp +++ b/xfa/fxfa/app/xfa_fontmgr.cpp @@ -1713,7 +1713,7 @@ void XFA_LocalFontNameToEnglishName(const CFX_WideStringC& wsLocalName, } const XFA_FONTINFO* XFA_GetFontINFOByFontName( const CFX_WideStringC& wsFontName) { - CFX_WideString wsFontNameTemp = wsFontName; + CFX_WideString wsFontNameTemp(wsFontName); wsFontNameTemp.Remove(L' '); uint32_t dwCurFontNameHash = FX_HashCode_GetW(wsFontNameTemp.AsStringC(), true); @@ -1745,7 +1745,7 @@ IFX_Font* CXFA_DefFontMgr::GetFont(CXFA_FFDoc* hDoc, const CFX_WideStringC& wsFontFamily, uint32_t dwFontStyles, uint16_t wCodePage) { - CFX_WideString wsFontName = wsFontFamily; + CFX_WideString wsFontName(wsFontFamily); IFX_FontMgr* pFDEFontMgr = hDoc->GetApp()->GetFDEFontMgr(); IFX_Font* pFont = pFDEFontMgr->LoadFont(wsFontName.c_str(), dwFontStyles, wCodePage); @@ -1882,7 +1882,8 @@ IFX_Font* CXFA_PDFFontMgr::GetFont(const CFX_WideStringC& wsFontFamily, auto it = m_FontMap.find(strKey); if (it != m_FontMap.end()) return it->second; - CFX_ByteString bsPsName = CFX_ByteString::FromUnicode(wsFontFamily); + CFX_ByteString bsPsName = + CFX_ByteString::FromUnicode(CFX_WideString(wsFontFamily)); FX_BOOL bBold = (dwFontStyles & FX_FONTSTYLE_Bold) == FX_FONTSTYLE_Bold; FX_BOOL bItalic = (dwFontStyles & FX_FONTSTYLE_Italic) == FX_FONTSTYLE_Italic; CFX_ByteString strFontName = PsNameToFontName(bsPsName, bBold, bItalic); diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp index 1f34b45670..884ec149f2 100644 --- a/xfa/fxfa/app/xfa_textlayout.cpp +++ b/xfa/fxfa/app/xfa_textlayout.cpp @@ -283,7 +283,7 @@ void CXFA_TextParser::ParseTagInfo(CFDE_XMLNode* pXMLNode, CFX_WideString wsValue; pXMLElement->GetString(FX_WSTRC(L"style").c_str(), wsValue); if (!wsValue.IsEmpty()) { - tagProvider.SetAttribute(FX_WSTRC(L"style"), wsValue); + tagProvider.SetAttribute(L"style", wsValue); } } else if (pXMLNode->GetType() == FDE_XMLNODE_Text) { tagProvider.m_bTagAviliable = TRUE; diff --git a/xfa/fxfa/fm2js/xfa_expression.cpp b/xfa/fxfa/fm2js/xfa_expression.cpp index cecffb9112..72020c3f0c 100644 --- a/xfa/fxfa/fm2js/xfa_expression.cpp +++ b/xfa/fxfa/fm2js/xfa_expression.cpp @@ -122,7 +122,7 @@ CXFA_FMVarExpression::CXFA_FMVarExpression(uint32_t line, void CXFA_FMVarExpression::ToJavaScript(CFX_WideTextBuf& javascript) { javascript << FX_WSTRC(L"var "); - CFX_WideString tempName = m_wsName; + CFX_WideString tempName(m_wsName); if (m_wsName.GetAt(0) == L'!') { tempName = EXCLAMATION_IN_IDENTIFIER + m_wsName.Mid(1); } @@ -143,7 +143,7 @@ void CXFA_FMVarExpression::ToJavaScript(CFX_WideTextBuf& javascript) { void CXFA_FMVarExpression::ToImpliedReturnJS(CFX_WideTextBuf& javascript) { javascript << FX_WSTRC(L"var "); - CFX_WideString tempName = m_wsName; + CFX_WideString tempName(m_wsName); if (m_wsName.GetAt(0) == L'!') { tempName = EXCLAMATION_IN_IDENTIFIER + m_wsName.Mid(1); } diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp index 852ea1bd6a..484191f1be 100644 --- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp +++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp @@ -1583,7 +1583,7 @@ void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis, pLocale = widgetData.GetLocal(); } else { pLocale = pMgr->GetLocaleByName( - CFX_WideString::FromUTF8(localString.AsStringC()).AsStringC()); + CFX_WideString::FromUTF8(localString.AsStringC())); } CFX_WideString wsFormat; if (formatString.IsEmpty()) { @@ -2029,8 +2029,7 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoDate(FXJSE_HOBJECT hThis, CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { - pLocale = - pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale).AsStringC()); + pLocale = pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale)); } if (!pLocale) { return FALSE; @@ -2066,8 +2065,7 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoTime(FXJSE_HOBJECT hThis, CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { - pLocale = - pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale).AsStringC()); + pLocale = pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale)); } if (!pLocale) { return FALSE; @@ -2106,8 +2104,7 @@ FX_BOOL CXFA_FM2JSContext::IsoDate2Local(FXJSE_HOBJECT hThis, CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { - pLocale = - pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale).AsStringC()); + pLocale = pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale)); } if (!pLocale) { return FALSE; @@ -2145,8 +2142,7 @@ FX_BOOL CXFA_FM2JSContext::IsoTime2Local(FXJSE_HOBJECT hThis, CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { - pLocale = - pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale).AsStringC()); + pLocale = pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale)); } if (!pLocale) { return FALSE; @@ -2186,8 +2182,7 @@ FX_BOOL CXFA_FM2JSContext::GetGMTTime(FXJSE_HOBJECT hThis, CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { - pLocale = - pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale).AsStringC()); + pLocale = pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale)); } if (!pLocale) { return FALSE; @@ -2368,8 +2363,7 @@ void CXFA_FM2JSContext::GetLocalDateFormat(FXJSE_HOBJECT hThis, CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { - pLocale = - pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocalStr).AsStringC()); + pLocale = pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocalStr)); } if (!pLocale) { return; @@ -2423,8 +2417,7 @@ void CXFA_FM2JSContext::GetLocalTimeFormat(FXJSE_HOBJECT hThis, CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { - pLocale = - pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocalStr).AsStringC()); + pLocale = pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocalStr)); } if (!pLocale) { return; @@ -4388,10 +4381,10 @@ void CXFA_FM2JSContext::Format(FXJSE_HOBJECT hThis, switch (patternType) { case XFA_VT_DATETIME: { FX_STRSIZE iTChar = wsPattern.Find(L'T'); - CFX_WideString wsDatePattern = FX_WSTRC(L"date{"); + CFX_WideString wsDatePattern(L"date{"); wsDatePattern += wsPattern.Left(iTChar); wsDatePattern += FX_WSTRC(L"} "); - CFX_WideString wsTimePattern = FX_WSTRC(L"time{"); + CFX_WideString wsTimePattern(L"time{"); wsTimePattern += wsPattern.Mid(iTChar + 1); wsTimePattern += FX_WSTRC(L"}"); wsPattern = wsDatePattern + wsTimePattern; @@ -4614,10 +4607,10 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, switch (patternType) { case XFA_VT_DATETIME: { FX_STRSIZE iTChar = wsPattern.Find(L'T'); - CFX_WideString wsDatePattern = FX_WSTRC(L"date{"); + CFX_WideString wsDatePattern(L"date{"); wsDatePattern += wsPattern.Left(iTChar); wsDatePattern += FX_WSTRC(L"} "); - CFX_WideString wsTimePattern = FX_WSTRC(L"time{"); + CFX_WideString wsTimePattern(L"time{"); wsTimePattern += wsPattern.Mid(iTChar + 1); wsTimePattern += FX_WSTRC(L"}"); wsPattern = wsDatePattern + wsTimePattern; @@ -6377,7 +6370,7 @@ void CXFA_FM2JSContext::eval_translation(FXJSE_HOBJECT hThis, CFX_WideString wsError; XFA_FM2JS_Translate(scriptString.AsStringC(), wsJavaScriptBuf, wsError); if (wsError.IsEmpty()) { - CFX_WideString javaScript = wsJavaScriptBuf.AsStringC(); + CFX_WideString javaScript = wsJavaScriptBuf.MakeString(); FXJSE_Value_SetUTF8String( args.GetReturnValue(), FX_UTF8Encode(javaScript.c_str(), javaScript.GetLength()) diff --git a/xfa/fxfa/fm2js/xfa_fmparse.cpp b/xfa/fxfa/fm2js/xfa_fmparse.cpp index 0a9fa81bad..efbf224a40 100644 --- a/xfa/fxfa/fm2js/xfa_fmparse.cpp +++ b/xfa/fxfa/fm2js/xfa_fmparse.cpp @@ -29,7 +29,7 @@ void CXFA_FMParse::NextToken() { void CXFA_FMParse::Check(XFA_FM_TOKEN op) { if (m_pToken->m_type != op) { - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrExpectedToken, XFA_FM_KeywordToString(op), ws_TempString.c_str()); } @@ -82,7 +82,7 @@ CXFA_FMExpression* CXFA_FMParse::ParseFunction() { uint32_t line = m_pToken->m_uLinenum; NextToken(); if (m_pToken->m_type != TOKidentifier) { - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrExpectedIdentifier, ws_TempString.c_str()); } else { @@ -111,7 +111,7 @@ CXFA_FMExpression* CXFA_FMParse::ParseFunction() { break; } } else { - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrExpectedIdentifier, ws_TempString.c_str()); NextToken(); @@ -181,7 +181,7 @@ CXFA_FMExpression* CXFA_FMParse::ParseExpression() { NextToken(); break; default: - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrUnexpectedExpression, ws_TempString.c_str()); NextToken(); @@ -196,7 +196,7 @@ CXFA_FMExpression* CXFA_FMParse::ParseVarExpression() { uint32_t line = m_pToken->m_uLinenum; NextToken(); if (m_pToken->m_type != TOKidentifier) { - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrExpectedIdentifier, ws_TempString.c_str()); } else { @@ -532,7 +532,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParsePrimaryExpression() { e.reset(ParseParenExpression()); break; default: - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrUnexpectedExpression, ws_TempString.c_str()); NextToken(); @@ -567,7 +567,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParsePostExpression( } } if (m_pToken->m_type != TOKrparen) { - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrExpectedToken, XFA_FM_KeywordToString(TOKrparen), ws_TempString.c_str()); } @@ -620,7 +620,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParsePostExpression( } } if (m_pToken->m_type != TOKrparen) { - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrExpectedToken, XFA_FM_KeywordToString(TOKrparen), ws_TempString.c_str()); } @@ -666,7 +666,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParsePostExpression( continue; } } else { - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrExpectedIdentifier, ws_TempString.c_str()); return e; @@ -694,7 +694,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParsePostExpression( continue; } } else { - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrExpectedIdentifier, ws_TempString.c_str()); return e; @@ -722,7 +722,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParsePostExpression( continue; } } else { - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrExpectedIdentifier, ws_TempString.c_str()); return e; @@ -753,7 +753,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParseIndexExpression() { new CXFA_FMIndexExpression(line, accessorIndex, s.release(), TRUE)); NextToken(); if (m_pToken->m_type != TOKrbracket) { - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrExpectedToken, XFA_FM_KeywordToString(TOKrparen), ws_TempString.c_str()); pExp.reset(); @@ -769,7 +769,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParseIndexExpression() { } s.reset(ParseSimpleExpression()); if (m_pToken->m_type != TOKrbracket) { - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrExpectedToken, XFA_FM_KeywordToString(TOKrparen), ws_TempString.c_str()); } else { @@ -891,7 +891,7 @@ CXFA_FMExpression* CXFA_FMParse::ParseIfExpression() { Check(TOKendif); break; default: - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrExpectedEndIf, ws_TempString.c_str()); NextToken(); break; @@ -927,7 +927,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParseSubassignmentInForExpression() { e.reset(ParseSimpleExpression()); break; default: - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrUnexpectedExpression, ws_TempString.c_str()); NextToken(); @@ -941,7 +941,7 @@ CXFA_FMExpression* CXFA_FMParse::ParseForExpression() { uint32_t line = m_pToken->m_uLinenum; NextToken(); if (m_pToken->m_type != TOKidentifier) { - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrExpectedToken, XFA_FM_KeywordToString(m_pToken->m_type), ws_TempString.c_str()); } @@ -952,7 +952,7 @@ CXFA_FMExpression* CXFA_FMParse::ParseForExpression() { NextToken(); pAssignment.reset(ParseSimpleExpression()); } else { - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrExpectedToken, XFA_FM_KeywordToString(m_pToken->m_type), ws_TempString.c_str()); } @@ -962,7 +962,7 @@ CXFA_FMExpression* CXFA_FMParse::ParseForExpression() { } else if (m_pToken->m_type == TOKdownto) { iDirection = -1; } else { - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrExpectedToken, L"upto or downto", ws_TempString.c_str()); } @@ -993,7 +993,7 @@ CXFA_FMExpression* CXFA_FMParse::ParseForeachExpression() { uint32_t line = m_pToken->m_uLinenum; NextToken(); if (m_pToken->m_type != TOKidentifier) { - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrExpectedToken, XFA_FM_KeywordToString(m_pToken->m_type), ws_TempString.c_str()); } @@ -1002,7 +1002,7 @@ CXFA_FMExpression* CXFA_FMParse::ParseForeachExpression() { Check(TOKin); Check(TOKlparen); if (m_pToken->m_type == TOKrparen) { - CFX_WideString ws_TempString = m_pToken->m_wstring; + CFX_WideString ws_TempString(m_pToken->m_wstring); Error(m_pToken->m_uLinenum, kFMErrUnexpectedExpression, ws_TempString.c_str()); NextToken(); diff --git a/xfa/fxfa/fm2js/xfa_simpleexpression.cpp b/xfa/fxfa/fm2js/xfa_simpleexpression.cpp index aad8f7bed0..e77623de3a 100644 --- a/xfa/fxfa/fm2js/xfa_simpleexpression.cpp +++ b/xfa/fxfa/fm2js/xfa_simpleexpression.cpp @@ -146,7 +146,7 @@ CXFA_FMStringExpression::CXFA_FMStringExpression(uint32_t line, : CXFA_FMSimpleExpression(line, TOKstring), m_wsString(wsString) {} void CXFA_FMStringExpression::ToJavaScript(CFX_WideTextBuf& javascript) { - CFX_WideString tempStr = m_wsString; + CFX_WideString tempStr(m_wsString); if (tempStr.GetLength() > 2) { javascript.AppendChar(L'\"'); FX_WCHAR oneChar; @@ -178,7 +178,7 @@ CXFA_FMIdentifierExpressionn::CXFA_FMIdentifierExpressionn( m_wsIdentifier(wsIdentifier) {} void CXFA_FMIdentifierExpressionn::ToJavaScript(CFX_WideTextBuf& javascript) { - CFX_WideString tempStr = m_wsIdentifier; + CFX_WideString tempStr(m_wsIdentifier); if (tempStr == FX_WSTRC(L"$")) { tempStr = FX_WSTRC(L"this"); } else if (tempStr == FX_WSTRC(L"!")) { diff --git a/xfa/fxfa/include/fxfa.h b/xfa/fxfa/include/fxfa.h index 672ca302fd..a7d1a282ba 100644 --- a/xfa/fxfa/include/fxfa.h +++ b/xfa/fxfa/include/fxfa.h @@ -414,7 +414,7 @@ class IXFA_DocProvider { virtual FX_BOOL IsCalculationsEnabled(CXFA_FFDoc* hDoc) = 0; virtual void SetCalculationsEnabled(CXFA_FFDoc* hDoc, FX_BOOL bEnabled) = 0; virtual void GetTitle(CXFA_FFDoc* hDoc, CFX_WideString& wsTitle) = 0; - virtual void SetTitle(CXFA_FFDoc* hDoc, const CFX_WideStringC& wsTitle) = 0; + virtual void SetTitle(CXFA_FFDoc* hDoc, const CFX_WideString& wsTitle) = 0; virtual void ExportData(CXFA_FFDoc* hDoc, const CFX_WideStringC& wsFilePath, FX_BOOL bXDP = TRUE) = 0; @@ -546,7 +546,7 @@ class IXFA_WidgetIterator { virtual FX_BOOL SetCurrentWidget(CXFA_FFWidget* hWidget) = 0; protected: - ~IXFA_WidgetIterator() {} + virtual ~IXFA_WidgetIterator() {} }; #endif // XFA_FXFA_INCLUDE_FXFA_H_ diff --git a/xfa/fxfa/include/fxfa_widget.h b/xfa/fxfa/include/fxfa_widget.h index acd800dcd4..3745a38ec0 100644 --- a/xfa/fxfa/include/fxfa_widget.h +++ b/xfa/fxfa/include/fxfa_widget.h @@ -35,13 +35,11 @@ class CXFA_WidgetAcc : public CXFA_WidgetData { FX_BOOL GetName(CFX_WideString& wsName, int32_t iNameType = 0); FX_BOOL ProcessValueChanged(); - - public: void ResetData(); - void SetImageEdit(const CFX_WideStringC& wsContentType, - const CFX_WideStringC& wsHref, - const CFX_WideStringC& wsData); + void SetImageEdit(const CFX_WideString& wsContentType, + const CFX_WideString& wsHref, + const CFX_WideString& wsData); CXFA_WidgetAcc* GetExclGroup(); CXFA_FFDocView* GetDocView(); diff --git a/xfa/fxfa/parser/cxfa_validate.cpp b/xfa/fxfa/parser/cxfa_validate.cpp index db0ffb4fa6..17140fbbc3 100644 --- a/xfa/fxfa/parser/cxfa_validate.cpp +++ b/xfa/fxfa/parser/cxfa_validate.cpp @@ -40,7 +40,7 @@ int32_t CXFA_Validate::GetScriptTest() { } void CXFA_Validate::GetMessageText(CFX_WideString& wsMessage, - const CFX_WideStringC& wsMessageType) { + const CFX_WideString& wsMessageType) { CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Message, FALSE); if (!pNode) return; @@ -61,23 +61,23 @@ void CXFA_Validate::GetMessageText(CFX_WideString& wsMessage, } void CXFA_Validate::SetFormatMessageText(CFX_WideString wsMessage) { - SetMessageText(wsMessage, FX_WSTRC(L"formatTest")); + SetMessageText(wsMessage, L"formatTest"); } void CXFA_Validate::GetFormatMessageText(CFX_WideString& wsMessage) { - GetMessageText(wsMessage, FX_WSTRC(L"formatTest")); + GetMessageText(wsMessage, L"formatTest"); } void CXFA_Validate::SetNullMessageText(CFX_WideString wsMessage) { - SetMessageText(wsMessage, FX_WSTRC(L"nullTest")); + SetMessageText(wsMessage, L"nullTest"); } void CXFA_Validate::GetNullMessageText(CFX_WideString& wsMessage) { - GetMessageText(wsMessage, FX_WSTRC(L"nullTest")); + GetMessageText(wsMessage, L"nullTest"); } void CXFA_Validate::SetMessageText(CFX_WideString& wsMessage, - const CFX_WideStringC& wsMessageType) { + const CFX_WideString& wsMessageType) { CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Message, TRUE); if (!pNode) return; @@ -102,11 +102,11 @@ void CXFA_Validate::SetMessageText(CFX_WideString& wsMessage, } void CXFA_Validate::GetScriptMessageText(CFX_WideString& wsMessage) { - GetMessageText(wsMessage, FX_WSTRC(L"scriptTest")); + GetMessageText(wsMessage, L"scriptTest"); } void CXFA_Validate::SetScriptMessageText(CFX_WideString wsMessage) { - SetMessageText(wsMessage, FX_WSTRC(L"scriptTest")); + SetMessageText(wsMessage, L"scriptTest"); } void CXFA_Validate::GetPicture(CFX_WideString& wsPicture) { diff --git a/xfa/fxfa/parser/cxfa_validate.h b/xfa/fxfa/parser/cxfa_validate.h index aab5de3466..bdd7be98b2 100644 --- a/xfa/fxfa/parser/cxfa_validate.h +++ b/xfa/fxfa/parser/cxfa_validate.h @@ -33,9 +33,9 @@ class CXFA_Validate : public CXFA_Data { protected: void GetMessageText(CFX_WideString& wsMessage, - const CFX_WideStringC& wsMessageType); + const CFX_WideString& wsMessageType); void SetMessageText(CFX_WideString& wsMessage, - const CFX_WideStringC& wsMessageType); + const CFX_WideString& wsMessageType); FX_BOOL SetTestValue(int32_t iType, CFX_WideString& wsValue, XFA_ATTRIBUTEENUM eName); diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index 7ca020fe6f..6ef88cdc74 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -888,19 +888,19 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString& wsLabel, if (iCount < 1) { CXFA_Node* pItems = m_pNode->CreateSamePacketNode(XFA_ELEMENT_Items); m_pNode->InsertChild(-1, pItems); - InsertListTextItem(pItems, wsLabel.AsStringC(), nIndex); + InsertListTextItem(pItems, wsLabel, nIndex); CXFA_Node* pSaveItems = m_pNode->CreateSamePacketNode(XFA_ELEMENT_Items); m_pNode->InsertChild(-1, pSaveItems); pSaveItems->SetBoolean(XFA_ATTRIBUTE_Save, TRUE); - InsertListTextItem(pSaveItems, wsNewValue.AsStringC(), nIndex); + InsertListTextItem(pSaveItems, wsNewValue, nIndex); } else if (iCount > 1) { for (int32_t i = 0; i < 2; i++) { CXFA_Node* pNode = listitems[i]; FX_BOOL bHasSave = pNode->GetBoolean(XFA_ATTRIBUTE_Save); if (bHasSave) - InsertListTextItem(pNode, wsNewValue.AsStringC(), nIndex); + InsertListTextItem(pNode, wsNewValue, nIndex); else - InsertListTextItem(pNode, wsLabel.AsStringC(), nIndex); + InsertListTextItem(pNode, wsLabel, nIndex); } } else { CXFA_Node* pNode = listitems[0]; @@ -916,12 +916,12 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString& wsLabel, while (pListNode) { CFX_WideString wsOldValue; pListNode->TryContent(wsOldValue); - InsertListTextItem(pSaveItems, wsOldValue.AsStringC(), i); + InsertListTextItem(pSaveItems, wsOldValue, i); i++; pListNode = pListNode->GetNodeItem(XFA_NODEITEM_NextSibling); } - InsertListTextItem(pNode, wsLabel.AsStringC(), nIndex); - InsertListTextItem(pSaveItems, wsNewValue.AsStringC(), nIndex); + InsertListTextItem(pNode, wsLabel, nIndex); + InsertListTextItem(pSaveItems, wsNewValue, nIndex); } if (!bNotify) return; @@ -1074,7 +1074,8 @@ int32_t CXFA_WidgetData::GetNumberOfCells() { CFX_WideString CXFA_WidgetData::GetBarcodeType() { CXFA_Node* pUIChild = GetUIChild(); - return pUIChild ? pUIChild->GetCData(XFA_ATTRIBUTE_Type) : NULL; + return pUIChild ? CFX_WideString(pUIChild->GetCData(XFA_ATTRIBUTE_Type)) + : nullptr; } FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_CharEncoding(int32_t& val) { @@ -1084,7 +1085,8 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_CharEncoding(int32_t& val) { if (wsCharEncoding.CompareNoCase(L"UTF-16")) { val = CHAR_ENCODING_UNICODE; return TRUE; - } else if (wsCharEncoding.CompareNoCase(L"UTF-8")) { + } + if (wsCharEncoding.CompareNoCase(L"UTF-8")) { val = CHAR_ENCODING_UTF8; return TRUE; } @@ -1475,8 +1477,8 @@ IFX_Locale* CXFA_WidgetData::GetLocal() { if (wsLocaleName == FX_WSTRC(L"ambient")) { pLocale = m_pNode->GetDocument()->GetLocalMgr()->GetDefLocale(); } else { - pLocale = m_pNode->GetDocument()->GetLocalMgr()->GetLocaleByName( - wsLocaleName.AsStringC()); + pLocale = + m_pNode->GetDocument()->GetLocalMgr()->GetLocaleByName(wsLocaleName); } } return pLocale; @@ -1739,7 +1741,7 @@ void CXFA_WidgetData::SyncValue(const CFX_WideString& wsValue, } void CXFA_WidgetData::InsertListTextItem(CXFA_Node* pItems, - const CFX_WideStringC& wsText, + const CFX_WideString& wsText, int32_t nIndex) { CXFA_Node* pText = pItems->CreateSamePacketNode(XFA_ELEMENT_Text); pItems->InsertChild(nIndex, pText); diff --git a/xfa/fxfa/parser/cxfa_widgetdata.h b/xfa/fxfa/parser/cxfa_widgetdata.h index 3cdc7cc8e4..c0d06e353c 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.h +++ b/xfa/fxfa/parser/cxfa_widgetdata.h @@ -168,7 +168,7 @@ class CXFA_WidgetData : public CXFA_Data { protected: void SyncValue(const CFX_WideString& wsValue, FX_BOOL bNotify); void InsertListTextItem(CXFA_Node* pItems, - const CFX_WideStringC& wsText, + const CFX_WideString& wsText, int32_t nIndex = -1); void FormatNumStr(const CFX_WideString& wsValue, IFX_Locale* pLocale, diff --git a/xfa/fxfa/parser/xfa_document_datadescription_imp.cpp b/xfa/fxfa/parser/xfa_document_datadescription_imp.cpp index c988902b63..31cf4119ad 100644 --- a/xfa/fxfa/parser/xfa_document_datadescription_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_datadescription_imp.cpp @@ -69,7 +69,7 @@ CXFA_Node* XFA_DataDescription_MaybeCreateDataNode( CXFA_Document* pDocument, CXFA_Node* pDataParent, XFA_ELEMENT eNodeType, - const CFX_WideStringC& wsName) { + const CFX_WideString& wsName) { if (!pDataParent) { return NULL; } @@ -98,7 +98,8 @@ CXFA_Node* XFA_DataDescription_MaybeCreateDataNode( continue; } } - CXFA_Node* pDDNode = pDDGroupNode->GetFirstChildByName(wsName); + CXFA_Node* pDDNode = + pDDGroupNode->GetFirstChildByName(wsName.AsStringC()); if (!pDDNode) { continue; } diff --git a/xfa/fxfa/parser/xfa_document_datadescription_imp.h b/xfa/fxfa/parser/xfa_document_datadescription_imp.h index f7c626dfb7..47bc358972 100644 --- a/xfa/fxfa/parser/xfa_document_datadescription_imp.h +++ b/xfa/fxfa/parser/xfa_document_datadescription_imp.h @@ -13,6 +13,6 @@ CXFA_Node* XFA_DataDescription_MaybeCreateDataNode( CXFA_Document* pDocument, CXFA_Node* pDataParent, XFA_ELEMENT eNodeType, - const CFX_WideStringC& wsName); + const CFX_WideString& wsName); #endif // XFA_FXFA_PARSER_XFA_DOCUMENT_DATADESCRIPTION_IMP_H_ diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp index ccb69df1a1..41a0acd70b 100644 --- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp @@ -135,7 +135,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, pDataNode->SetAttributeValue(wsValue, wsFormatedValue); pDataNode->SetCData(XFA_ATTRIBUTE_ContentType, wsContentType); if (!wsHref.IsEmpty()) { - pXMLDataElement->SetString(FX_WSTRC(L"href"), wsHref); + pXMLDataElement->SetString(L"href", wsHref); } } break; case XFA_ELEMENT_ChoiceList: @@ -148,7 +148,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, CXFA_Node* pValue = NULL; for (int32_t i = 0; i < iSize; i++) { pValue = pDataNode->CreateSamePacketNode(XFA_ELEMENT_DataValue); - pValue->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"value")); + pValue->SetCData(XFA_ATTRIBUTE_Name, L"value"); pValue->CreateXMLMappingNode(); pDataNode->InsertChild(pValue); pValue->SetCData(XFA_ATTRIBUTE_Value, wsSelTextArray[i]); @@ -156,8 +156,8 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, } else { CFDE_XMLNode* pXMLNode = pDataNode->GetXMLMappingNode(); ASSERT(pXMLNode->GetType() == FDE_XMLNODE_Element); - static_cast(pXMLNode) - ->SetString(FX_WSTRC(L"xfa:dataNode"), FX_WSTRC(L"dataGroup")); + static_cast(pXMLNode)->SetString(L"xfa:dataNode", + L"dataGroup"); } } else if (!wsValue.IsEmpty()) { pWidgetData->GetFormatDataValue(wsValue, wsFormatedValue); @@ -297,8 +297,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, } CXFA_ExData exData = defValue.GetExData(); ASSERT(exData); - exData.SetContentType((iCounts == 1) ? FX_WSTRC(L"text/plain") - : FX_WSTRC(L"text/xml")); + exData.SetContentType(iCounts == 1 ? L"text/plain" : L"text/xml"); } XFA_DataMerge_FormValueNode_SetChildContent( defValue.GetNode(), wsNormailizeValue, XFA_ELEMENT_ExData); @@ -1130,7 +1129,7 @@ static void XFA_DataMerge_UpdateBindingRelations(CXFA_Document* pDocument, : XFA_ELEMENT_DataValue; pDataNode = XFA_DataDescription_MaybeCreateDataNode( pDocument, pDataScope, eDataNodeType, - pFormNode->GetCData(XFA_ATTRIBUTE_Name)); + CFX_WideString(pFormNode->GetCData(XFA_ATTRIBUTE_Name))); if (pDataNode) { XFA_DataMerge_CreateDataBinding(pFormNode, pDataNode, FALSE); } @@ -1163,7 +1162,7 @@ static void XFA_DataMerge_UpdateBindingRelations(CXFA_Document* pDocument, ToNode(pDocument->GetXFAObject(XFA_HASHCODE_Record)); pDataNode = XFA_DataDescription_MaybeCreateDataNode( pDocument, pRecordNode, eDataNodeType, - pFormNode->GetCData(XFA_ATTRIBUTE_Name)); + CFX_WideString(pFormNode->GetCData(XFA_ATTRIBUTE_Name))); if (pDataNode) { XFA_DataMerge_CreateDataBinding(pFormNode, pDataNode, FALSE); XFA_DataMerge_RegisterGlobalBinding( @@ -1260,14 +1259,11 @@ CXFA_Node* CXFA_Document::GetNotBindNode(CXFA_ObjArray& arrayNodes) { void CXFA_Document::DoDataMerge() { CXFA_Node* pDatasetsRoot = ToNode(GetXFAObject(XFA_HASHCODE_Datasets)); if (!pDatasetsRoot) { - CFDE_XMLElement* pDatasetsXMLNode = - new CFDE_XMLElement(FX_WSTRC(L"xfa:datasets")); - - pDatasetsXMLNode->SetString( - FX_WSTRC(L"xmlns:xfa"), - FX_WSTRC(L"http://www.xfa.org/schema/xfa-data/1.0/")); + CFDE_XMLElement* pDatasetsXMLNode = new CFDE_XMLElement(L"xfa:datasets"); + pDatasetsXMLNode->SetString(L"xmlns:xfa", + L"http://www.xfa.org/schema/xfa-data/1.0/"); pDatasetsRoot = CreateNode(XFA_XDPPACKET_Datasets, XFA_ELEMENT_DataModel); - pDatasetsRoot->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"datasets")); + pDatasetsRoot->SetCData(XFA_ATTRIBUTE_Name, L"datasets"); m_pRootNode->GetXMLMappingNode()->InsertChildNode(pDatasetsXMLNode); m_pRootNode->InsertChild(pDatasetsRoot); pDatasetsRoot->SetXMLMappingNode(pDatasetsXMLNode); @@ -1304,11 +1300,9 @@ void CXFA_Document::DoDataMerge() { } } if (!pDataRoot) { - CFDE_XMLElement* pDataRootXMLNode = - new CFDE_XMLElement(FX_WSTRC(L"xfa:data")); - + CFDE_XMLElement* pDataRootXMLNode = new CFDE_XMLElement(L"xfa:data"); pDataRoot = CreateNode(XFA_XDPPACKET_Datasets, XFA_ELEMENT_DataGroup); - pDataRoot->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"data")); + pDataRoot->SetCData(XFA_ATTRIBUTE_Name, L"data"); pDataRoot->SetXMLMappingNode(pDataRootXMLNode); pDatasetsRoot->InsertChild(pDataRoot); } @@ -1335,7 +1329,7 @@ void CXFA_Document::DoDataMerge() { bEmptyForm = TRUE; pFormRoot = CreateNode(XFA_XDPPACKET_Form, XFA_ELEMENT_Form); ASSERT(pFormRoot); - pFormRoot->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"form")); + pFormRoot->SetCData(XFA_ATTRIBUTE_Name, L"form"); m_pRootNode->InsertChild(pFormRoot, NULL); } else { CXFA_NodeIteratorTemplate @@ -1350,8 +1344,8 @@ void CXFA_Document::DoDataMerge() { ASSERT(pSubformSetNode); if (!pDataTopLevel) { CFX_WideStringC wsFormName = pSubformSetNode->GetCData(XFA_ATTRIBUTE_Name); - CFX_WideString wsDataTopLevelName = - wsFormName.IsEmpty() ? FX_WSTRC(L"form") : wsFormName; + CFX_WideString wsDataTopLevelName(wsFormName.IsEmpty() ? L"form" + : wsFormName); CFDE_XMLElement* pDataTopLevelXMLNode = new CFDE_XMLElement(wsDataTopLevelName); diff --git a/xfa/fxfa/parser/xfa_document_serialize.cpp b/xfa/fxfa/parser/xfa_document_serialize.cpp index fce951420d..ef85d0e266 100644 --- a/xfa/fxfa/parser/xfa_document_serialize.cpp +++ b/xfa/fxfa/parser/xfa_document_serialize.cpp @@ -93,7 +93,7 @@ CFX_WideString XFA_ExportEncodeAttribute(const CFX_WideString& str) { textBuf.AppendChar(str[i]); } } - return textBuf.AsStringC(); + return textBuf.MakeString(); } CFX_WideString XFA_ExportEncodeContent(const CFX_WideStringC& str) { CFX_WideTextBuf textBuf; @@ -123,7 +123,7 @@ CFX_WideString XFA_ExportEncodeContent(const CFX_WideStringC& str) { textBuf.AppendChar(str.GetAt(i)); } } - return textBuf.AsStringC(); + return textBuf.MakeString(); } static void XFA_SaveAttribute(CXFA_Node* pNode, XFA_ATTRIBUTE eName, @@ -547,8 +547,8 @@ FX_BOOL CXFA_DataExporter::Export(IFX_Stream* pStream, return FALSE; } XFA_DataExporter_DealWithDataGroupNode(pExportNode); - pElement->SetString(FX_WSTRC(L"xmlns:xfa"), - FX_WSTRC(L"http://www.xfa.org/schema/xfa-data/1.0/")); + pElement->SetString(L"xmlns:xfa", + L"http://www.xfa.org/schema/xfa-data/1.0/"); pXMLDoc->SaveXMLNode(pStream, pElement); pElement->RemoveAttribute(L"xmlns:xfa"); } @@ -576,8 +576,8 @@ void XFA_DataExporter_DealWithDataGroupNode(CXFA_Node* pDataNode) { } else { CFDE_XMLNode* pXMLNode = pDataNode->GetXMLMappingNode(); ASSERT(pXMLNode->GetType() == FDE_XMLNODE_Element); - static_cast(pXMLNode) - ->SetString(FX_WSTRC(L"xfa:dataNode"), FX_WSTRC(L"dataGroup")); + static_cast(pXMLNode)->SetString(L"xfa:dataNode", + L"dataGroup"); } } } diff --git a/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp b/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp index 75bcbbecae..08ce54f844 100644 --- a/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp +++ b/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp @@ -274,7 +274,7 @@ static CXFA_Node* XFA_ResolveBreakTarget(CXFA_Node* pPageSetRoot, if (wsTargetExpr.IsEmpty()) { return NULL; } - CFX_WideString wsTargetAll = wsTargetExpr; + CFX_WideString wsTargetAll(wsTargetExpr); wsTargetAll.TrimLeft(); wsTargetAll.TrimRight(); int32_t iSpliteIndex = 0; diff --git a/xfa/fxfa/parser/xfa_locale.cpp b/xfa/fxfa/parser/xfa_locale.cpp index ff0371bc88..7883856b67 100644 --- a/xfa/fxfa/parser/xfa_locale.cpp +++ b/xfa/fxfa/parser/xfa_locale.cpp @@ -226,7 +226,8 @@ void CXFA_NodeLocale::Release() { delete this; } CFX_WideString CXFA_NodeLocale::GetName() { - return m_pLocale ? m_pLocale->GetCData(XFA_ATTRIBUTE_Name) : NULL; + return CFX_WideString(m_pLocale ? m_pLocale->GetCData(XFA_ATTRIBUTE_Name) + : nullptr); } void CXFA_NodeLocale::GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, CFX_WideString& wsNumSymbol) const { diff --git a/xfa/fxfa/parser/xfa_localemgr.cpp b/xfa/fxfa/parser/xfa_localemgr.cpp index 519c4819bd..0982537b15 100644 --- a/xfa/fxfa/parser/xfa_localemgr.cpp +++ b/xfa/fxfa/parser/xfa_localemgr.cpp @@ -1131,7 +1131,7 @@ CXFA_LocaleMgr::CXFA_LocaleMgr(CXFA_Node* pLocaleSet, CFX_WideString wsDeflcid) pNodeLocale = pNodeLocale->GetNodeItem(XFA_NODEITEM_NextSibling); } } - m_pDefLocale = GetLocaleByName(wsDeflcid.AsStringC()); + m_pDefLocale = GetLocaleByName(wsDeflcid); } CXFA_LocaleMgr::~CXFA_LocaleMgr() { for (int32_t i = 0; i < m_LocaleArray.GetSize(); i++) @@ -1217,7 +1217,7 @@ IFX_Locale* CXFA_LocaleMgr::GetLocale(uint16_t lcid) { return pLocal; } IFX_Locale* CXFA_LocaleMgr::GetLocaleByName( - const CFX_WideStringC& wsLocaleName) { + const CFX_WideString& wsLocaleName) { int32_t iCount = m_LocaleArray.GetSize(); int32_t i = 0; for (i = 0; i < iCount; i++) { diff --git a/xfa/fxfa/parser/xfa_localemgr.h b/xfa/fxfa/parser/xfa_localemgr.h index c82c47c7f3..a3a1d4c2b9 100644 --- a/xfa/fxfa/parser/xfa_localemgr.h +++ b/xfa/fxfa/parser/xfa_localemgr.h @@ -33,11 +33,13 @@ class IFX_Locale; class CXFA_LocaleMgr : public IFX_LocaleMgr { public: CXFA_LocaleMgr(CXFA_Node* pLocaleSet, CFX_WideString wsDeflcid); - virtual void Release(); - virtual uint16_t GetDefLocaleID(); - virtual IFX_Locale* GetDefLocale(); - virtual IFX_Locale* GetLocale(uint16_t lcid); - virtual IFX_Locale* GetLocaleByName(const CFX_WideStringC& wsLocaleName); + + void Release() override; + uint16_t GetDefLocaleID() override; + IFX_Locale* GetDefLocale() override; + IFX_Locale* GetLocale(uint16_t lcid) override; + IFX_Locale* GetLocaleByName(const CFX_WideString& wsLocaleName) override; + ~CXFA_LocaleMgr(); void SetDefLocale(IFX_Locale* pLocale); CFX_WideStringC GetConfigLocaleName(CXFA_Node* pConfig); diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp index e3631c60f2..0fbde1f160 100644 --- a/xfa/fxfa/parser/xfa_object_imp.cpp +++ b/xfa/fxfa/parser/xfa_object_imp.cpp @@ -140,7 +140,7 @@ CXFA_Node* CXFA_Node::Clone(FX_BOOL bRecursive) { CFDE_XMLElement* pCloneXMLElement = new CFDE_XMLElement(wsName); CFX_WideStringC wsValue = GetCData(XFA_ATTRIBUTE_Value); if (!wsValue.IsEmpty()) { - pCloneXMLElement->SetTextData(wsValue); + pCloneXMLElement->SetTextData(CFX_WideString(wsValue)); } pCloneXML = pCloneXMLElement; pCloneXMLElement = NULL; @@ -981,7 +981,8 @@ void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) { CXFA_Node* pFakeRoot = Clone(FALSE); CFX_WideStringC wsContentType = GetCData(XFA_ATTRIBUTE_ContentType); if (!wsContentType.IsEmpty()) { - pFakeRoot->SetCData(XFA_ATTRIBUTE_ContentType, wsContentType); + pFakeRoot->SetCData(XFA_ATTRIBUTE_ContentType, + CFX_WideString(wsContentType)); } CFDE_XMLNode* pFakeXMLRoot = pFakeRoot->GetXMLMappingNode(); if (!pFakeXMLRoot) { @@ -991,7 +992,7 @@ void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) { if (!pFakeXMLRoot) { CFX_WideStringC wsClassName; GetClassName(wsClassName); - pFakeXMLRoot = new CFDE_XMLElement(wsClassName); + pFakeXMLRoot = new CFDE_XMLElement(CFX_WideString(wsClassName)); } if (bIgnoreRoot) { CFDE_XMLNode* pXMLChild = pXMLNode->GetNodeItem(CFDE_XMLNode::FirstChild); @@ -1724,7 +1725,7 @@ void CXFA_Node::Script_Boolean_Value(FXJSE_HVALUE hValue, FXJSE_Value_ToUTF8String(hValue, newValue); } int32_t iValue = FXSYS_atoi(newValue.c_str()); - CFX_WideString wsNewValue = (iValue == 0) ? FX_WSTRC(L"0") : FX_WSTRC(L"1"); + CFX_WideString wsNewValue(iValue == 0 ? L"0" : L"1"); CFX_WideString wsFormatValue(wsNewValue); CXFA_WidgetData* pContainerWidgetData = GetContainerWidgetData(); if (pContainerWidgetData) { @@ -3263,9 +3264,9 @@ int32_t CXFA_Node::InstanceManager_SetInstances(int32_t iDesired) { } if (iDesired < iCount) { CFX_WideStringC wsInstManagerName = GetCData(XFA_ATTRIBUTE_Name); - CFX_WideString wsInstanceName = wsInstManagerName.IsEmpty() - ? wsInstManagerName - : wsInstManagerName.Mid(1); + CFX_WideString wsInstanceName = + CFX_WideString(wsInstManagerName.IsEmpty() ? wsInstManagerName + : wsInstManagerName.Mid(1)); uint32_t dInstanceNameHash = FX_HashCode_GetW(wsInstanceName.AsStringC(), false); CXFA_Node* pPrevSibling = @@ -3737,7 +3738,7 @@ FX_BOOL CXFA_Node::SetAttribute(XFA_ATTRIBUTE eAttr, bNotify); } break; case XFA_ATTRIBUTETYPE_Cdata: - return SetCData(pAttr->eName, wsValue, bNotify); + return SetCData(pAttr->eName, CFX_WideString(wsValue), bNotify); case XFA_ATTRIBUTETYPE_Boolean: return SetBoolean(pAttr->eName, wsValue != FX_WSTRC(L"0"), bNotify); case XFA_ATTRIBUTETYPE_Integer: @@ -3938,7 +3939,8 @@ FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr, case FDE_XMLNODE_Element: if (IsAttributeInXML()) { static_cast(m_pXMLNode) - ->SetString(GetCData(XFA_ATTRIBUTE_QualifiedName), wsValue); + ->SetString(CFX_WideString(GetCData(XFA_ATTRIBUTE_QualifiedName)), + wsValue); } else { FX_BOOL bDeleteChildren = TRUE; if (GetPacketID() == XFA_XDPPACKET_Datasets) { @@ -3995,7 +3997,8 @@ FX_BOOL CXFA_Node::SetAttributeValue(const CFX_WideString& wsValue, case FDE_XMLNODE_Element: if (IsAttributeInXML()) { static_cast(m_pXMLNode) - ->SetString(GetCData(XFA_ATTRIBUTE_QualifiedName), wsXMLValue); + ->SetString(CFX_WideString(GetCData(XFA_ATTRIBUTE_QualifiedName)), + wsXMLValue); } else { FX_BOOL bDeleteChildren = TRUE; if (GetPacketID() == XFA_XDPPACKET_Datasets) { @@ -4114,8 +4117,7 @@ FX_BOOL CXFA_Node::SetValue(XFA_ATTRIBUTE eAttr, break; case XFA_ATTRIBUTETYPE_Boolean: static_cast(m_pXMLNode) - ->SetString(pInfo->pName, - pValue ? FX_WSTRC(L"1") : FX_WSTRC(L"0")); + ->SetString(pInfo->pName, pValue ? L"1" : L"0"); break; case XFA_ATTRIBUTETYPE_Integer: static_cast(m_pXMLNode) @@ -4172,7 +4174,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, CXFA_Node* pValue = GetProperty(0, XFA_ELEMENT_Value); CXFA_Node* pChildValue = pValue->GetNodeItem(XFA_NODEITEM_FirstChild); ASSERT(pChildValue); - pChildValue->SetCData(XFA_ATTRIBUTE_ContentType, FX_WSTRC(L"text/xml")); + pChildValue->SetCData(XFA_ATTRIBUTE_ContentType, L"text/xml"); pChildValue->SetScriptContent(wsContent, wsContent, bNotify, bScriptModify, FALSE); CXFA_Node* pBind = GetBindData(); @@ -4212,7 +4214,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, while (iAddNodes-- > 0) { pValueNodes = pBind->CreateSamePacketNode(XFA_ELEMENT_DataValue); - pValueNodes->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"value")); + pValueNodes->SetCData(XFA_ATTRIBUTE_Name, L"value"); pValueNodes->CreateXMLMappingNode(); pBind->InsertChild(pValueNodes); } @@ -4699,7 +4701,7 @@ FX_BOOL CXFA_Node::RemoveChild(CXFA_Node* pNode, bool bNotify) { CFDE_XMLElement* pNewXMLElement = new CFDE_XMLElement(wsName); CFX_WideStringC wsValue = GetCData(XFA_ATTRIBUTE_Value); if (!wsValue.IsEmpty()) { - pNewXMLElement->SetTextData(wsValue); + pNewXMLElement->SetTextData(CFX_WideString(wsValue)); } pNode->m_pXMLNode = pNewXMLElement; pNode->SetEnum(XFA_ATTRIBUTE_Contains, XFA_ATTRIBUTEENUM_Unknown); @@ -4936,7 +4938,7 @@ void CXFA_Node::UpdateNameHash() { } CFDE_XMLNode* CXFA_Node::CreateXMLMappingNode() { if (!m_pXMLNode) { - CFX_WideStringC wsTag = GetCData(XFA_ATTRIBUTE_Name); + CFX_WideString wsTag(GetCData(XFA_ATTRIBUTE_Name)); m_pXMLNode = new CFDE_XMLElement(wsTag); SetFlag(XFA_NODEFLAG_OwnXMLNode, false); } diff --git a/xfa/fxfa/parser/xfa_parser_imp.cpp b/xfa/fxfa/parser/xfa_parser_imp.cpp index 23a8dbc925..01ea1d6fae 100644 --- a/xfa/fxfa/parser/xfa_parser_imp.cpp +++ b/xfa/fxfa/parser/xfa_parser_imp.cpp @@ -377,7 +377,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP( return nullptr; } m_pRootNode = pXFARootNode; - pXFARootNode->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"xfa")); + pXFARootNode->SetCData(XFA_ATTRIBUTE_Name, L"xfa"); { CFDE_XMLElement* pElement = static_cast(pXMLDocumentNode); int32_t iAttributeCount = pElement->CountAttributes(); @@ -662,7 +662,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Data( ->RemoveAttribute(L"xmlns:xfa"); pDataXMLNode = pXMLDocumentNode; } else { - CFDE_XMLElement* pDataElement = new CFDE_XMLElement(FX_WSTRC(L"xfa:data")); + CFDE_XMLElement* pDataElement = new CFDE_XMLElement(L"xfa:data"); CFDE_XMLNode* pParentXMLNode = pXMLDocumentNode->GetNodeItem(CFDE_XMLNode::Parent); if (pParentXMLNode) { @@ -1147,7 +1147,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode, pXFAMetaData->SetFlag(XFA_NODEFLAG_Initialized, false); } if (!bNeedValue) { - CFX_WideString wsNilName = FX_WSTRC(L"xsi:nil"); + CFX_WideString wsNilName(L"xsi:nil"); pXMLElement->RemoveAttribute(wsNilName.c_str()); } } @@ -1247,14 +1247,14 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode, } else { bMarkAsCompound = TRUE; if (pXMLCurValueNode) { - CFX_WideStringC wsCurValue = wsCurValueTextBuf.AsStringC(); + CFX_WideString wsCurValue = wsCurValueTextBuf.MakeString(); if (!wsCurValue.IsEmpty()) { CXFA_Node* pXFAChild = m_pFactory->CreateNode(ePacketID, XFA_ELEMENT_DataValue); if (!pXFAChild) return; - pXFAChild->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"")); + pXFAChild->SetCData(XFA_ATTRIBUTE_Name, L""); pXFAChild->SetCData(XFA_ATTRIBUTE_Value, wsCurValue); pXFANode->InsertChild(pXFAChild); pXFAChild->SetXMLMappingNode(pXMLCurValueNode); @@ -1281,7 +1281,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode, } } if (pXMLCurValueNode) { - CFX_WideStringC wsCurValue = wsCurValueTextBuf.AsStringC(); + CFX_WideString wsCurValue = wsCurValueTextBuf.MakeString(); if (!wsCurValue.IsEmpty()) { if (bMarkAsCompound) { CXFA_Node* pXFAChild = @@ -1289,7 +1289,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode, if (!pXFAChild) return; - pXFAChild->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"")); + pXFAChild->SetCData(XFA_ATTRIBUTE_Name, L""); pXFAChild->SetCData(XFA_ATTRIBUTE_Value, wsCurValue); pXFANode->InsertChild(pXFAChild); pXFAChild->SetXMLMappingNode(pXMLCurValueNode); @@ -1300,7 +1300,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode, } pXMLCurValueNode = nullptr; } - CFX_WideStringC wsNodeValue = wsValueTextBuf.AsStringC(); + CFX_WideString wsNodeValue = wsValueTextBuf.MakeString(); pXFANode->SetCData(XFA_ATTRIBUTE_Value, wsNodeValue); } diff --git a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp index c771000ebd..e6de66d803 100644 --- a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp +++ b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp @@ -163,7 +163,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Title( CFX_ByteString bsValue; FXJSE_Value_ToUTF8String(hValue, bsValue); pNotify->GetDocProvider()->SetTitle( - hDoc, CFX_WideString::FromUTF8(bsValue.AsStringC()).AsStringC()); + hDoc, CFX_WideString::FromUTF8(bsValue.AsStringC())); return; } CFX_WideString wsTitle; diff --git a/xfa/fxfa/parser/xfa_script_imp.cpp b/xfa/fxfa/parser/xfa_script_imp.cpp index 1cd5689045..893c5b79ea 100644 --- a/xfa/fxfa/parser/xfa_script_imp.cpp +++ b/xfa/fxfa/parser/xfa_script_imp.cpp @@ -291,7 +291,7 @@ void CXFA_ScriptContext::NormalPropertySetter(FXJSE_HOBJECT hObject, pPropOrChild = pNode->GetFirstChildByName(wsPropName.AsStringC()); } if (pPropOrChild) { - CFX_WideString wsDefaultName = FX_WSTRC(L"{default}"); + CFX_WideString wsDefaultName(L"{default}"); const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo = XFA_GetScriptAttributeByName(pPropOrChild->GetClassID(), wsDefaultName.AsStringC()); diff --git a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp index e46b7060a1..e48d3d5ffa 100644 --- a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp +++ b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp @@ -65,7 +65,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_HWXY( return; } CXFA_Node* pNode = NULL; - CFX_WideString wsUnit = FX_WSTRC(L"pt"); + CFX_WideString wsUnit(L"pt"); int32_t iIndex = 0; if (iLength >= 1) { pNode = static_cast(pArguments->GetObject(0)); diff --git a/xfa/fxfa/parser/xfa_script_nodehelper.cpp b/xfa/fxfa/parser/xfa_script_nodehelper.cpp index 96ecc5a125..93bf40e324 100644 --- a/xfa/fxfa/parser/xfa_script_nodehelper.cpp +++ b/xfa/fxfa/parser/xfa_script_nodehelper.cpp @@ -308,9 +308,8 @@ FX_BOOL CXFA_NodeHelper::XFA_NodeIsTransparent(CXFA_Node* refNode) { FX_BOOL CXFA_NodeHelper::XFA_CreateNode_ForCondition( CFX_WideString& wsCondition) { int32_t iLen = wsCondition.GetLength(); - CFX_WideString wsIndex = FX_WSTRC(L"0"); + CFX_WideString wsIndex(L"0"); FX_BOOL bAll = FALSE; - if (iLen == 0) { m_iCreateFlag = XFA_RESOLVENODE_RSTYPE_CreateNodeOne; return FALSE; -- cgit v1.2.3