Make CFX_WideString(const CFX_WideString&) explicit.
BUG=
Review-Url: https://codereview.chromium.org/1979723003
diff --git a/core/fpdfdoc/doc_basic.cpp b/core/fpdfdoc/doc_basic.cpp
index a0c6b2b..76639ef 100644
--- a/core/fpdfdoc/doc_basic.cpp
+++ b/core/fpdfdoc/doc_basic.cpp
@@ -315,7 +315,7 @@
result += ChangeSlashToPlatform(filepath.c_str());
return result;
#else
- return filepath;
+ return CFX_WideString(filepath);
#endif
}
@@ -390,7 +390,7 @@
}
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 f843da3..136c44b 100644
--- a/core/fpdftext/fpdf_text_int.cpp
+++ b/core/fpdftext/fpdf_text_int.cpp
@@ -537,7 +537,8 @@
if (nCount == -1) {
nCount = pdfium::CollectionSize<int>(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 @@
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 @@
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 @@
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 @@
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 @@
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 3a81e41..c774e80 100644
--- a/core/fxcrt/fx_basic_bstring.cpp
+++ b/core/fxcrt/fx_basic_bstring.cpp
@@ -820,7 +820,7 @@
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 5a75f8b..6008a00 100644
--- a/core/fxcrt/fx_basic_buffer.cpp
+++ b/core/fxcrt/fx_basic_buffer.cpp
@@ -186,11 +186,6 @@
return *this;
}
-CFX_WideStringC CFX_WideTextBuf::AsStringC() const {
- return CFX_WideStringC(reinterpret_cast<const FX_WCHAR*>(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 8c1d494..241c3a6 100644
--- a/core/fxcrt/fx_basic_wstring.cpp
+++ b/core/fxcrt/fx_basic_wstring.cpp
@@ -786,10 +786,10 @@
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 4b52189..a5e351f 100644
--- a/core/fxcrt/fx_xml_parser.cpp
+++ b/core/fxcrt/fx_xml_parser.cpp
@@ -457,7 +457,7 @@
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 @@
}
} 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 @@
}
}
- 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 7437d95..48999c4 100644
--- a/core/fxcrt/include/fx_basic.h
+++ b/core/fxcrt/include/fx_basic.h
@@ -80,7 +80,15 @@
FX_WCHAR* GetBuffer() const {
return reinterpret_cast<FX_WCHAR*>(m_pBuffer.get());
}
- CFX_WideStringC AsStringC() const;
+
+ CFX_WideStringC AsStringC() const {
+ return CFX_WideStringC(reinterpret_cast<const FX_WCHAR*>(m_pBuffer.get()),
+ m_DataSize / sizeof(FX_WCHAR));
+ }
+ CFX_WideString MakeString() const {
+ return CFX_WideString(reinterpret_cast<const FX_WCHAR*>(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 9019522..df8afb3 100644
--- a/core/fxcrt/include/fx_string.h
+++ b/core/fxcrt/include/fx_string.h
@@ -250,8 +250,7 @@
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 4b44669..deba943 100644
--- a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
+++ b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
@@ -614,18 +614,16 @@
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)
- return;
- CPDF_Dictionary* pInfoDict = m_pPDFDoc->GetInfo();
- if (pInfoDict == NULL)
+void CPDFXFA_Document::SetTitle(CXFA_FFDoc* hDoc,
+ const CFX_WideString& wsTitle) {
+ if (hDoc != m_pXFADoc || !m_pPDFDoc)
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 @@
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 5ffeb21..a67b780 100644
--- a/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h
+++ b/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h
@@ -90,7 +90,7 @@
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 2336b20..851b687 100644
--- a/xfa/fgas/localization/fgas_locale.cpp
+++ b/xfa/fgas/localization/fgas_locale.cpp
@@ -677,7 +677,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
}
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 48592a3..d1d862b 100644
--- a/xfa/fgas/localization/fgas_locale.h
+++ b/xfa/fgas/localization/fgas_locale.h
@@ -90,7 +90,7 @@
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 c828a6b..bbbdcb1 100644
--- a/xfa/fgas/localization/fgas_localeimp.h
+++ b/xfa/fgas/localization/fgas_localeimp.h
@@ -114,7 +114,8 @@
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 93e5ea0..e0ce8d9 100644
--- a/xfa/fgas/localization/fgas_localemgr.cpp
+++ b/xfa/fgas/localization/fgas_localemgr.cpp
@@ -91,7 +91,6 @@
}
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 5f26470..d0ba90c 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 083a088..a2eab8a 100644
--- a/xfa/fwl/basewidget/fwl_editimp.cpp
+++ b/xfa/fwl/basewidget/fwl_editimp.cpp
@@ -667,7 +667,7 @@
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 3bdc6c1..23cd2d1 100644
--- a/xfa/fxbarcode/cbc_codabar.cpp
+++ b/xfa/fxbarcode/cbc_codabar.cpp
@@ -118,6 +118,6 @@
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 039e372..85d7afb 100644
--- a/xfa/fxbarcode/cbc_code128.cpp
+++ b/xfa/fxbarcode/cbc_code128.cpp
@@ -53,7 +53,7 @@
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 @@
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 516b34e..5d00d77 100644
--- a/xfa/fxbarcode/cbc_code39.cpp
+++ b/xfa/fxbarcode/cbc_code39.cpp
@@ -109,7 +109,7 @@
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 63385aa..7430187 100644
--- a/xfa/fxbarcode/cbc_datamatrix.cpp
+++ b/xfa/fxbarcode/cbc_datamatrix.cpp
@@ -43,8 +43,9 @@
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 @@
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 5f33f4c..ea67c9f 100644
--- a/xfa/fxbarcode/cbc_ean13.cpp
+++ b/xfa/fxbarcode/cbc_ean13.cpp
@@ -109,6 +109,6 @@
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 e92605f..418ef87 100644
--- a/xfa/fxbarcode/cbc_ean8.cpp
+++ b/xfa/fxbarcode/cbc_ean8.cpp
@@ -108,6 +108,6 @@
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 0b7a558..228caed 100644
--- a/xfa/fxbarcode/cbc_pdf417i.cpp
+++ b/xfa/fxbarcode/cbc_pdf417i.cpp
@@ -51,8 +51,9 @@
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 @@
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 8faf5ad..6f93b44 100644
--- a/xfa/fxbarcode/cbc_qrcode.cpp
+++ b/xfa/fxbarcode/cbc_qrcode.cpp
@@ -59,10 +59,11 @@
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 @@
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 2c60c92..886525a 100644
--- a/xfa/fxbarcode/cbc_upca.cpp
+++ b/xfa/fxbarcode/cbc_upca.cpp
@@ -111,6 +111,6 @@
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 cdbc59c..efebfe5 100644
--- a/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp
@@ -341,13 +341,13 @@
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 fd3757a..11081fd 100644
--- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp
+++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
@@ -210,8 +210,7 @@
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 @@
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 @@
} else {
CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode();
ASSERT(pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element);
- static_cast<CFDE_XMLElement*>(pXMLNode)
- ->SetString(FX_WSTRC(L"href"), wsHref);
+ static_cast<CFDE_XMLElement*>(pXMLNode)->SetString(L"href", wsHref);
}
}
diff --git a/xfa/fxfa/app/xfa_ffwidgethandler.cpp b/xfa/fxfa/app/xfa_ffwidgethandler.cpp
index 314b227..13cee33 100644
--- a/xfa/fxfa/app/xfa_ffwidgethandler.cpp
+++ b/xfa/fxfa/app/xfa_ffwidgethandler.cpp
@@ -328,7 +328,7 @@
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* 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::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 608c907..bf8c1a7 100644
--- a/xfa/fxfa/app/xfa_fontmgr.cpp
+++ b/xfa/fxfa/app/xfa_fontmgr.cpp
@@ -1713,7 +1713,7 @@
}
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 @@
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 @@
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 1f34b45..884ec14 100644
--- a/xfa/fxfa/app/xfa_textlayout.cpp
+++ b/xfa/fxfa/app/xfa_textlayout.cpp
@@ -283,7 +283,7 @@
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 cecffb9..72020c3 100644
--- a/xfa/fxfa/fm2js/xfa_expression.cpp
+++ b/xfa/fxfa/fm2js/xfa_expression.cpp
@@ -122,7 +122,7 @@
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::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 852ea1b..484191f 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
+++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
@@ -1583,7 +1583,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 0a9fa81..efbf224 100644
--- a/xfa/fxfa/fm2js/xfa_fmparse.cpp
+++ b/xfa/fxfa/fm2js/xfa_fmparse.cpp
@@ -29,7 +29,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
}
}
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 @@
}
}
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 @@
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 @@
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 @@
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 @@
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 @@
}
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 @@
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 @@
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 @@
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 @@
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 @@
} 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 @@
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 @@
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 aad8f7b..e77623d 100644
--- a/xfa/fxfa/fm2js/xfa_simpleexpression.cpp
+++ b/xfa/fxfa/fm2js/xfa_simpleexpression.cpp
@@ -146,7 +146,7 @@
: 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 @@
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 672ca30..a7d1a28 100644
--- a/xfa/fxfa/include/fxfa.h
+++ b/xfa/fxfa/include/fxfa.h
@@ -414,7 +414,7 @@
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 @@
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 acd800d..3745a38 100644
--- a/xfa/fxfa/include/fxfa_widget.h
+++ b/xfa/fxfa/include/fxfa_widget.h
@@ -35,13 +35,11 @@
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 db0ffb4..17140fb 100644
--- a/xfa/fxfa/parser/cxfa_validate.cpp
+++ b/xfa/fxfa/parser/cxfa_validate.cpp
@@ -40,7 +40,7 @@
}
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::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::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 aab5de3..bdd7be9 100644
--- a/xfa/fxfa/parser/cxfa_validate.h
+++ b/xfa/fxfa/parser/cxfa_validate.h
@@ -33,9 +33,9 @@
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 7ca020f..6ef88cd 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.cpp
+++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -888,19 +888,19 @@
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 @@
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 @@
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 @@
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 @@
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::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 3cdc7cc..c0d06e3 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.h
+++ b/xfa/fxfa/parser/cxfa_widgetdata.h
@@ -168,7 +168,7 @@
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 c988902..31cf411 100644
--- a/xfa/fxfa/parser/xfa_document_datadescription_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_datadescription_imp.cpp
@@ -69,7 +69,7 @@
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 @@
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 f7c626d..47bc358 100644
--- a/xfa/fxfa/parser/xfa_document_datadescription_imp.h
+++ b/xfa/fxfa/parser/xfa_document_datadescription_imp.h
@@ -13,6 +13,6 @@
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 ccb69df..41a0acd 100644
--- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
@@ -135,7 +135,7 @@
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 @@
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 @@
} else {
CFDE_XMLNode* pXMLNode = pDataNode->GetXMLMappingNode();
ASSERT(pXMLNode->GetType() == FDE_XMLNODE_Element);
- static_cast<CFDE_XMLElement*>(pXMLNode)
- ->SetString(FX_WSTRC(L"xfa:dataNode"), FX_WSTRC(L"dataGroup"));
+ static_cast<CFDE_XMLElement*>(pXMLNode)->SetString(L"xfa:dataNode",
+ L"dataGroup");
}
} else if (!wsValue.IsEmpty()) {
pWidgetData->GetFormatDataValue(wsValue, wsFormatedValue);
@@ -297,8 +297,7 @@
}
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 @@
: 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 @@
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 @@
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 @@
}
}
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 @@
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<CXFA_Node, CXFA_TraverseStrategy_XFANode>
@@ -1350,8 +1344,8 @@
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 fce9514..ef85d0e 100644
--- a/xfa/fxfa/parser/xfa_document_serialize.cpp
+++ b/xfa/fxfa/parser/xfa_document_serialize.cpp
@@ -93,7 +93,7 @@
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 @@
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 @@
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 @@
} else {
CFDE_XMLNode* pXMLNode = pDataNode->GetXMLMappingNode();
ASSERT(pXMLNode->GetType() == FDE_XMLNODE_Element);
- static_cast<CFDE_XMLElement*>(pXMLNode)
- ->SetString(FX_WSTRC(L"xfa:dataNode"), FX_WSTRC(L"dataGroup"));
+ static_cast<CFDE_XMLElement*>(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 75bcbbe..08ce54f 100644
--- a/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp
+++ b/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp
@@ -274,7 +274,7 @@
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 ff0371b..7883856 100644
--- a/xfa/fxfa/parser/xfa_locale.cpp
+++ b/xfa/fxfa/parser/xfa_locale.cpp
@@ -226,7 +226,8 @@
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 519c481..0982537 100644
--- a/xfa/fxfa/parser/xfa_localemgr.cpp
+++ b/xfa/fxfa/parser/xfa_localemgr.cpp
@@ -1131,7 +1131,7 @@
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 @@
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 c82c47c..a3a1d4c 100644
--- a/xfa/fxfa/parser/xfa_localemgr.h
+++ b/xfa/fxfa/parser/xfa_localemgr.h
@@ -33,11 +33,13 @@
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 e3631c6..0fbde1f 100644
--- a/xfa/fxfa/parser/xfa_object_imp.cpp
+++ b/xfa/fxfa/parser/xfa_object_imp.cpp
@@ -140,7 +140,7 @@
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 @@
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 @@
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 @@
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 @@
}
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 @@
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 @@
case FDE_XMLNODE_Element:
if (IsAttributeInXML()) {
static_cast<CFDE_XMLElement*>(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 @@
case FDE_XMLNODE_Element:
if (IsAttributeInXML()) {
static_cast<CFDE_XMLElement*>(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 @@
break;
case XFA_ATTRIBUTETYPE_Boolean:
static_cast<CFDE_XMLElement*>(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<CFDE_XMLElement*>(m_pXMLNode)
@@ -4172,7 +4174,7 @@
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 @@
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 @@
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 @@
}
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 23a8dbc..01ea1d6 100644
--- a/xfa/fxfa/parser/xfa_parser_imp.cpp
+++ b/xfa/fxfa/parser/xfa_parser_imp.cpp
@@ -377,7 +377,7 @@
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<CFDE_XMLElement*>(pXMLDocumentNode);
int32_t iAttributeCount = pElement->CountAttributes();
@@ -662,7 +662,7 @@
->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 @@
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 @@
} 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 @@
}
}
if (pXMLCurValueNode) {
- CFX_WideStringC wsCurValue = wsCurValueTextBuf.AsStringC();
+ CFX_WideString wsCurValue = wsCurValueTextBuf.MakeString();
if (!wsCurValue.IsEmpty()) {
if (bMarkAsCompound) {
CXFA_Node* pXFAChild =
@@ -1289,7 +1289,7 @@
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 @@
}
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 c771000..e6de66d 100644
--- a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
@@ -163,7 +163,7 @@
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 1cd5689..893c5b7 100644
--- a/xfa/fxfa/parser/xfa_script_imp.cpp
+++ b/xfa/fxfa/parser/xfa_script_imp.cpp
@@ -291,7 +291,7 @@
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 e46b706..e48d3d5 100644
--- a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp
@@ -65,7 +65,7 @@
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<CXFA_Node*>(pArguments->GetObject(0));
diff --git a/xfa/fxfa/parser/xfa_script_nodehelper.cpp b/xfa/fxfa/parser/xfa_script_nodehelper.cpp
index 96ecc5a..93bf40e 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_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;