From 8e4c505ff6d82263183e9f812fcc7b45c1414f15 Mon Sep 17 00:00:00 2001 From: tsepez Date: Thu, 14 Apr 2016 13:42:44 -0700 Subject: Rename CFX_ByteTextBuf::GetByteString() to AsStringC(). Do the same for CFX_WideTextBuf as well. The name is confusing because these return CFX_ByteStringC, not CFX_ByteString. The AsStringC naming gives parallelism with the string types themselves, and may help to indicate that the result is only good for the lifetime of the object being operated upon. Review URL: https://codereview.chromium.org/1886263003 --- core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp | 6 ++-- core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp | 6 ++-- core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp | 4 +-- core/fpdfdoc/cpvt_generateap.cpp | 16 ++++----- core/fpdftext/fpdf_text_int.cpp | 21 ++++++------ core/fxcrt/fx_basic_buffer.cpp | 6 ++-- core/fxcrt/fx_xml_parser.cpp | 10 +++--- core/fxcrt/include/fx_basic.h | 8 ++--- core/fxge/ge/fx_ge_fontmap.cpp | 4 +-- fpdfsdk/fsdk_baseform.cpp | 6 ++-- fpdfsdk/fxedit/fxet_ap.cpp | 12 +++---- fpdfsdk/fxedit/fxet_pageobjs.cpp | 32 +++++++++--------- fpdfsdk/pdfwindow/PWL_Caret.cpp | 2 +- fpdfsdk/pdfwindow/PWL_Edit.cpp | 2 +- fpdfsdk/pdfwindow/PWL_Icon.cpp | 2 +- fpdfsdk/pdfwindow/PWL_Label.cpp | 2 +- fpdfsdk/pdfwindow/PWL_Utils.cpp | 44 ++++++++++++------------- xfa/fde/xml/fde_xml_imp.cpp | 2 +- xfa/fxfa/fm2js/xfa_fm2jscontext.cpp | 31 +++++++---------- xfa/fxfa/fm2js/xfa_simpleexpression.cpp | 10 +++--- xfa/fxfa/parser/xfa_document_serialize.cpp | 10 +++--- xfa/fxfa/parser/xfa_parser_imp.cpp | 6 ++-- 22 files changed, 116 insertions(+), 126 deletions(-) diff --git a/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp index 940881bacb..cf29aa2684 100644 --- a/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp +++ b/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp @@ -562,7 +562,7 @@ CFX_ByteString CPDF_StreamParser::ReadString() { if (buf.GetLength() > MAX_STRING_LENGTH) { return CFX_ByteString(buf.GetBuffer(), MAX_STRING_LENGTH); } - return buf.GetByteString(); + return buf.AsStringC(); } parlevel--; buf.AppendChar(')'); @@ -641,7 +641,7 @@ CFX_ByteString CPDF_StreamParser::ReadString() { if (buf.GetLength() > MAX_STRING_LENGTH) { return CFX_ByteString(buf.GetBuffer(), MAX_STRING_LENGTH); } - return buf.GetByteString(); + return buf.AsStringC(); } CFX_ByteString CPDF_StreamParser::ReadHexString() { @@ -675,7 +675,7 @@ CFX_ByteString CPDF_StreamParser::ReadHexString() { if (buf.GetLength() > MAX_STRING_LENGTH) return CFX_ByteString(buf.GetBuffer(), MAX_STRING_LENGTH); - return buf.GetByteString(); + return buf.AsStringC(); } bool CPDF_StreamParser::PositionIsInBounds() const { diff --git a/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp b/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp index 5c3398d50a..889b58e928 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp +++ b/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp @@ -218,7 +218,7 @@ CFX_ByteString CPDF_SyntaxParser::ReadString() { case 0: if (ch == ')') { if (parlevel == 0) { - return buf.GetByteString(); + return buf.AsStringC(); } parlevel--; buf.AppendChar(')'); @@ -291,7 +291,7 @@ CFX_ByteString CPDF_SyntaxParser::ReadString() { } GetNextChar(ch); - return buf.GetByteString(); + return buf.AsStringC(); } CFX_ByteString CPDF_SyntaxParser::ReadHexString() { @@ -323,7 +323,7 @@ CFX_ByteString CPDF_SyntaxParser::ReadHexString() { if (!bFirst) buf.AppendByte(code); - return buf.GetByteString(); + return buf.AsStringC(); } void CPDF_SyntaxParser::ToNextLine() { diff --git a/core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp b/core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp index 5e71002d4d..5f8d425b96 100644 --- a/core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp +++ b/core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp @@ -530,7 +530,7 @@ CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, FX_BOOL bHex) { result.AppendChar("0123456789ABCDEF"[src[i] % 16]); } result.AppendChar('>'); - return result.GetByteString(); + return result.AsStringC(); } result.AppendChar('('); for (int i = 0; i < srclen; i++) { @@ -547,7 +547,7 @@ CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, FX_BOOL bHex) { result.AppendChar(ch); } result.AppendChar(')'); - return result.GetByteString(); + return result.AsStringC(); } void FlateEncode(const uint8_t* src_buf, diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp index 06a64359e9..ec1b9fbf4e 100644 --- a/core/fpdfdoc/cpvt_generateap.cpp +++ b/core/fpdfdoc/cpvt_generateap.cpp @@ -418,7 +418,7 @@ FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, << "q\n"; sAppStream << rcBody.left << " " << rcBody.bottom << " " << rcBody.Width() << " " << rcBody.Height() << " re\nW\nn\n"; - sAppStream << sBody.GetByteString() << "Q\nEMC\n"; + sAppStream << sBody.AsStringC() << "Q\nEMC\n"; } } break; } @@ -523,7 +523,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP( if (bContinuous) { if (place.LineCmp(oldplace) != 0) { if (sWords.GetSize() > 0) { - sLineStream << GetWordRenderString(sWords.GetByteString()); + sLineStream << GetWordRenderString(sWords.AsStringC()); sEditStream << sLineStream; sLineStream.Clear(); sWords.Clear(); @@ -548,7 +548,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP( if (pIterator->GetWord(word)) { if (word.nFontIndex != nCurFontIndex) { if (sWords.GetSize() > 0) { - sLineStream << GetWordRenderString(sWords.GetByteString()); + sLineStream << GetWordRenderString(sWords.AsStringC()); sWords.Clear(); } sLineStream << GetFontSetString(pFontMap, word.nFontIndex, @@ -580,12 +580,12 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP( } } if (sWords.GetSize() > 0) { - sLineStream << GetWordRenderString(sWords.GetByteString()); + sLineStream << GetWordRenderString(sWords.AsStringC()); sEditStream << sLineStream; sWords.Clear(); } } - return sEditStream.GetByteString(); + return sEditStream.AsStringC(); } // Static. @@ -693,7 +693,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateBorderAP( break; } } - return sAppStream.GetByteString(); + return sAppStream.AsStringC(); } // Static. @@ -718,7 +718,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateColorAP(const CPVT_Color& color, case CPVT_Color::kTransparent: break; } - return sColorStream.GetByteString(); + return sColorStream.AsStringC(); } // Static. @@ -766,5 +766,5 @@ CFX_ByteString CPVT_GenerateAP::GetFontSetString(IPVT_FontMap* pFontMap, if (sFontAlias.GetLength() > 0 && fFontSize > 0) sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; } - return sRet.GetByteString(); + return sRet.AsStringC(); } diff --git a/core/fpdftext/fpdf_text_int.cpp b/core/fpdftext/fpdf_text_int.cpp index 8de65cb07a..8e8686c4a1 100644 --- a/core/fpdftext/fpdf_text_int.cpp +++ b/core/fpdftext/fpdf_text_int.cpp @@ -512,8 +512,7 @@ CFX_WideString CPDF_TextPage::GetPageText(int start, int nCount) const { if (nCount == -1) { nCount = pdfium::CollectionSize(m_CharList) - start; - return m_TextBuf.GetWideString().Mid(start, - m_TextBuf.GetWideString().GetLength()); + return m_TextBuf.AsStringC().Mid(start, m_TextBuf.AsStringC().GetLength()); } if (nCount <= 0 || m_CharList.empty()) { return L""; @@ -550,7 +549,7 @@ CFX_WideString CPDF_TextPage::GetPageText(int start, int nCount) const { if (nCount <= 0) { return L""; } - return m_TextBuf.GetWideString().Mid(startindex, nCount); + return m_TextBuf.AsStringC().Mid(startindex, nCount); } int CPDF_TextPage::CountRects(int start, int nCount) { @@ -987,7 +986,7 @@ void CPDF_TextPage::CloseTempLine() { if (m_TempCharList.empty()) return; - CFX_WideString str = m_TempTextBuf.GetWideString(); + CFX_WideString str = m_TempTextBuf.AsStringC(); FX_BOOL bPrevSpace = FALSE; for (int i = 0; i < str.GetLength(); i++) { if (str.GetAt(i) != ' ') { @@ -1353,8 +1352,8 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) { } } while (m_TempTextBuf.GetSize() > 0 && - m_TempTextBuf.GetWideString().GetAt(m_TempTextBuf.GetLength() - - 1) == 0x20) { + m_TempTextBuf.AsStringC().GetAt(m_TempTextBuf.GetLength() - 1) == + 0x20) { m_TempTextBuf.Delete(m_TempTextBuf.GetLength() - 1, 1); m_TempCharList.pop_back(); } @@ -1395,9 +1394,9 @@ 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.GetWideString(); + CFX_WideString str = m_TempTextBuf.AsStringC(); if (str.IsEmpty()) { - str = m_TextBuf.GetWideString(); + str = m_TextBuf.AsStringC(); } if (str.IsEmpty() || str.GetAt(str.GetLength() - 1) == TEXT_BLANK_CHAR) { continue; @@ -1531,7 +1530,7 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) { m_TempCharList.push_back(charinfo); } } else if (i == 0) { - CFX_WideString str = m_TempTextBuf.GetWideString(); + CFX_WideString str = m_TempTextBuf.AsStringC(); if (!str.IsEmpty() && str.GetAt(str.GetLength() - 1) == TEXT_BLANK_CHAR) { m_TempTextBuf.Delete(m_TempTextBuf.GetLength() - 1, 1); @@ -1574,9 +1573,9 @@ int32_t CPDF_TextPage::GetTextObjectWritingMode( return m_TextlineDir; } FX_BOOL CPDF_TextPage::IsHyphen(FX_WCHAR curChar) { - CFX_WideString strCurText = m_TempTextBuf.GetWideString(); + CFX_WideString strCurText = m_TempTextBuf.AsStringC(); if (strCurText.GetLength() == 0) { - strCurText = m_TextBuf.GetWideString(); + strCurText = m_TextBuf.AsStringC(); } FX_STRSIZE nCount = strCurText.GetLength(); int nIndex = nCount - 1; diff --git a/core/fxcrt/fx_basic_buffer.cpp b/core/fxcrt/fx_basic_buffer.cpp index 1e5d0554d1..338edc16c9 100644 --- a/core/fxcrt/fx_basic_buffer.cpp +++ b/core/fxcrt/fx_basic_buffer.cpp @@ -100,7 +100,7 @@ void CFX_BinaryBuf::InsertBlock(FX_STRSIZE pos, m_DataSize += size; } -CFX_ByteStringC CFX_ByteTextBuf::GetByteString() const { +CFX_ByteStringC CFX_ByteTextBuf::AsStringC() const { return CFX_ByteStringC(m_pBuffer.get(), m_DataSize); } @@ -186,8 +186,8 @@ CFX_WideTextBuf& CFX_WideTextBuf::operator<<(const CFX_WideTextBuf& buf) { return *this; } -CFX_WideStringC CFX_WideTextBuf::GetWideString() const { - return CFX_WideStringC((const FX_WCHAR*)m_pBuffer.get(), +CFX_WideStringC CFX_WideTextBuf::AsStringC() const { + return CFX_WideStringC(reinterpret_cast(m_pBuffer.get()), m_DataSize / sizeof(FX_WCHAR)); } diff --git a/core/fxcrt/fx_xml_parser.cpp b/core/fxcrt/fx_xml_parser.cpp index b4df4d0532..4b52189142 100644 --- a/core/fxcrt/fx_xml_parser.cpp +++ b/core/fxcrt/fx_xml_parser.cpp @@ -132,7 +132,7 @@ void CXML_Parser::GetName(CFX_ByteString& space, CFX_ByteString& name) { while (m_dwIndex < m_dwBufferSize) { ch = m_pBuffer[m_dwIndex]; if (ch == ':') { - space = buf.GetByteString(); + space = buf.AsStringC(); buf.Clear(); } else if (g_FXCRT_XML_IsNameChar(ch)) { buf.AppendChar(ch); @@ -146,7 +146,7 @@ void CXML_Parser::GetName(CFX_ByteString& space, CFX_ByteString& name) { break; } } while (ReadNextBlock()); - name = buf.GetByteString(); + name = buf.AsStringC(); } void CXML_Parser::SkipLiterals(const CFX_ByteStringC& str) { m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex; @@ -202,7 +202,7 @@ uint32_t CXML_Parser::GetCharRef() { case 1: m_dwIndex++; if (ch == ';') { - CFX_ByteStringC ref = buf.GetByteString(); + CFX_ByteStringC ref = buf.AsStringC(); if (ref == "gt") { code = '>'; } else if (ref == "lt") { @@ -457,7 +457,7 @@ CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, iState = 10; } else { content << decoder.GetResult(); - CFX_WideString dataStr = content.GetWideString(); + CFX_WideString dataStr = content.AsStringC(); 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.GetWideString(); + CFX_WideString dataStr = content.AsStringC(); if (!m_bSaveSpaceChars) { dataStr.TrimRight(L" \t\r\n"); } diff --git a/core/fxcrt/include/fx_basic.h b/core/fxcrt/include/fx_basic.h index 1b64a5924f..5a577c2e54 100644 --- a/core/fxcrt/include/fx_basic.h +++ b/core/fxcrt/include/fx_basic.h @@ -58,7 +58,7 @@ class CFX_ByteTextBuf : public CFX_BinaryBuf { public: void AppendChar(int ch) { AppendByte((uint8_t)ch); } FX_STRSIZE GetLength() const { return m_DataSize; } - CFX_ByteStringC GetByteString() const; + CFX_ByteStringC AsStringC() const; CFX_ByteTextBuf& operator<<(int i); CFX_ByteTextBuf& operator<<(uint32_t i); @@ -80,7 +80,7 @@ class CFX_WideTextBuf : public CFX_BinaryBuf { FX_WCHAR* GetBuffer() const { return reinterpret_cast(m_pBuffer.get()); } - CFX_WideStringC GetWideString() const; + CFX_WideStringC AsStringC() const; void Delete(int start_index, int count) { CFX_BinaryBuf::Delete(start_index * sizeof(FX_WCHAR), @@ -206,7 +206,7 @@ class CFX_UTF8Decoder { void ClearStatus() { m_PendingBytes = 0; } - CFX_WideStringC GetResult() const { return m_Buffer.GetWideString(); } + CFX_WideStringC GetResult() const { return m_Buffer.AsStringC(); } protected: int m_PendingBytes; @@ -222,7 +222,7 @@ class CFX_UTF8Encoder { void Input(FX_WCHAR unicode); void AppendStr(const CFX_ByteStringC& str) { m_Buffer << str; } - CFX_ByteStringC GetResult() const { return m_Buffer.GetByteString(); } + CFX_ByteStringC GetResult() const { return m_Buffer.AsStringC(); } protected: CFX_ByteTextBuf m_Buffer; diff --git a/core/fxge/ge/fx_ge_fontmap.cpp b/core/fxge/ge/fx_ge_fontmap.cpp index 194f91034d..8524660043 100644 --- a/core/fxge/ge/fx_ge_fontmap.cpp +++ b/core/fxge/ge/fx_ge_fontmap.cpp @@ -317,7 +317,7 @@ CFX_ByteString GetFontFamily(CFX_ByteString fontName, int nStyle) { CFX_ByteString ParseStyle(const FX_CHAR* pStyle, int iLen, int iIndex) { CFX_ByteTextBuf buf; if (!iLen || iLen <= iIndex) { - return buf.GetByteString(); + return buf.AsStringC(); } while (iIndex < iLen) { if (pStyle[iIndex] == ',') { @@ -326,7 +326,7 @@ CFX_ByteString ParseStyle(const FX_CHAR* pStyle, int iLen, int iIndex) { buf.AppendChar(pStyle[iIndex]); ++iIndex; } - return buf.GetByteString(); + return buf.AsStringC(); } int32_t GetStyleType(const CFX_ByteString& bsStyle, FX_BOOL bRevert) { diff --git a/fpdfsdk/fsdk_baseform.cpp b/fpdfsdk/fsdk_baseform.cpp index 7487cddede..86f5c5e501 100644 --- a/fpdfsdk/fsdk_baseform.cpp +++ b/fpdfsdk/fsdk_baseform.cpp @@ -1410,7 +1410,7 @@ void CPDFSDK_Widget::ResetAppearance_ComboBox(const FX_WCHAR* sValue) { sBody << CPWL_Utils::GetDropButtonAppStream(rcButton); CFX_ByteString sAP = GetBackgroundAppStream() + GetBorderAppStream() + - sLines.GetByteString() + sBody.GetByteString(); + sLines.AsStringC() + sBody.AsStringC(); WriteAppearance("N", GetRotatedRect(), GetMatrix(), sAP); } @@ -1499,7 +1499,7 @@ void CPDFSDK_Widget::ResetAppearance_ListBox() { } CFX_ByteString sAP = GetBackgroundAppStream() + GetBorderAppStream() + - sLines.GetByteString() + sBody.GetByteString(); + sLines.AsStringC() + sBody.AsStringC(); WriteAppearance("N", GetRotatedRect(), GetMatrix(), sAP); } @@ -1648,7 +1648,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue) { } CFX_ByteString sAP = GetBackgroundAppStream() + GetBorderAppStream() + - sLines.GetByteString() + sBody.GetByteString(); + sLines.AsStringC() + sBody.AsStringC(); WriteAppearance("N", GetRotatedRect(), GetMatrix(), sAP); } diff --git a/fpdfsdk/fxedit/fxet_ap.cpp b/fpdfsdk/fxedit/fxet_ap.cpp index cafce2eb04..1a36c803da 100644 --- a/fpdfsdk/fxedit/fxet_ap.cpp +++ b/fpdfsdk/fxedit/fxet_ap.cpp @@ -56,7 +56,7 @@ static CFX_ByteString GetFontSetString(IPVT_FontMap* pFontMap, sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; } - return sRet.GetByteString(); + return sRet.AsStringC(); } CFX_ByteString IFX_Edit::GetEditAppearanceStream( @@ -87,7 +87,7 @@ CFX_ByteString IFX_Edit::GetEditAppearanceStream( if (bContinuous) { if (place.LineCmp(oldplace) != 0) { if (sWords.GetSize() > 0) { - sEditStream << GetWordRenderString(sWords.GetByteString()); + sEditStream << GetWordRenderString(sWords.AsStringC()); sWords.Clear(); } @@ -114,7 +114,7 @@ CFX_ByteString IFX_Edit::GetEditAppearanceStream( if (pIterator->GetWord(word)) { if (word.nFontIndex != nCurFontIndex) { if (sWords.GetSize() > 0) { - sEditStream << GetWordRenderString(sWords.GetByteString()); + sEditStream << GetWordRenderString(sWords.AsStringC()); sWords.Clear(); } sEditStream << GetFontSetString(pEdit->GetFontMap(), @@ -152,7 +152,7 @@ CFX_ByteString IFX_Edit::GetEditAppearanceStream( } if (sWords.GetSize() > 0) { - sEditStream << GetWordRenderString(sWords.GetByteString()); + sEditStream << GetWordRenderString(sWords.AsStringC()); sWords.Clear(); } } @@ -172,7 +172,7 @@ CFX_ByteString IFX_Edit::GetEditAppearanceStream( sAppStream << sEditStream; } - return sAppStream.GetByteString(); + return sAppStream.AsStringC(); } CFX_ByteString IFX_Edit::GetSelectAppearanceStream( @@ -202,5 +202,5 @@ CFX_ByteString IFX_Edit::GetSelectAppearanceStream( } } - return sRet.GetByteString(); + return sRet.AsStringC(); } diff --git a/fpdfsdk/fxedit/fxet_pageobjs.cpp b/fpdfsdk/fxedit/fxet_pageobjs.cpp index a09b92f4d4..b3f4ad60c6 100644 --- a/fpdfsdk/fxedit/fxet_pageobjs.cpp +++ b/fpdfsdk/fxedit/fxet_pageobjs.cpp @@ -234,11 +234,11 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, if (place.LineCmp(oldplace) != 0 || word.nFontIndex != nFontIndex || crOldFill != crCurFill) { if (sTextBuf.GetLength() > 0) { - DrawTextString(pDevice, CFX_FloatPoint(ptBT.x + ptOffset.x, - ptBT.y + ptOffset.y), - pFontMap->GetPDFFont(nFontIndex), fFontSize, - pUser2Device, sTextBuf.GetByteString(), - crOldFill, crTextStroke, nHorzScale); + DrawTextString( + pDevice, + CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), + pFontMap->GetPDFFont(nFontIndex), fFontSize, pUser2Device, + sTextBuf.AsStringC(), crOldFill, crTextStroke, nHorzScale); sTextBuf.Clear(); } @@ -266,7 +266,7 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, DrawTextString( pDevice, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), pFontMap->GetPDFFont(nFontIndex), fFontSize, pUser2Device, - sTextBuf.GetByteString(), crOldFill, crTextStroke, nHorzScale); + sTextBuf.AsStringC(), crOldFill, crTextStroke, nHorzScale); } } } @@ -348,11 +348,11 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, FXSYS_memcmp(&word.WordProps, &wp, sizeof(CPVT_WordProps)) != 0 || crOld != crCurText) { if (sTextBuf.GetLength() > 0) { - DrawTextString(pDevice, CFX_FloatPoint(ptBT.x + ptOffset.x, - ptBT.y + ptOffset.y), - pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, - pUser2Device, sTextBuf.GetByteString(), crOld, 0, - wp.nHorzScale); + DrawTextString( + pDevice, + CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), + pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, + pUser2Device, sTextBuf.AsStringC(), crOld, 0, wp.nHorzScale); sTextBuf.Clear(); } @@ -393,7 +393,7 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, DrawTextString( pDevice, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, pUser2Device, - sTextBuf.GetByteString(), crOld, 0, wp.nHorzScale); + sTextBuf.AsStringC(), crOld, 0, wp.nHorzScale); } } } @@ -497,7 +497,7 @@ void IFX_Edit::GeneratePageObjects( pObjectHolder, crText, pFontMap->GetPDFFont(nOldFontIndex), fFontSize, 0.0f, 100, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), - sTextBuf.GetByteString())); + sTextBuf.AsStringC())); sTextBuf.Clear(); } @@ -517,7 +517,7 @@ void IFX_Edit::GeneratePageObjects( pObjectHolder, crText, pFontMap->GetPDFFont(nOldFontIndex), fFontSize, 0.0f, 100, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), - sTextBuf.GetByteString())); + sTextBuf.AsStringC())); } } } @@ -568,7 +568,7 @@ void IFX_Edit::GenerateRichPageObjects( pObjectHolder, crOld, pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, wp.fCharSpace, wp.nHorzScale, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), - sTextBuf.GetByteString())); + sTextBuf.AsStringC())); sTextBuf.Clear(); } @@ -611,7 +611,7 @@ void IFX_Edit::GenerateRichPageObjects( pObjectHolder, crOld, pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, wp.fCharSpace, wp.nHorzScale, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), - sTextBuf.GetByteString())); + sTextBuf.AsStringC())); } } } diff --git a/fpdfsdk/pdfwindow/PWL_Caret.cpp b/fpdfsdk/pdfwindow/PWL_Caret.cpp index e49471a0d2..88ce429c85 100644 --- a/fpdfsdk/pdfwindow/PWL_Caret.cpp +++ b/fpdfsdk/pdfwindow/PWL_Caret.cpp @@ -95,7 +95,7 @@ CFX_ByteString CPWL_Caret::GetCaretAppearanceStream( const CFX_FloatPoint& ptOffset) { CFX_ByteTextBuf sCaret; GetCaretApp(sCaret, ptOffset); - return sCaret.GetByteString(); + return sCaret.AsStringC(); } void CPWL_Caret::TimerProc() { diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp index 620838185e..4a9adfb207 100644 --- a/fpdfsdk/pdfwindow/PWL_Edit.cpp +++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp @@ -708,7 +708,7 @@ CFX_ByteString CPWL_Edit::GetTextAppearanceStream( << sEdit.AsStringC() << "ET\n"; } - return sRet.GetByteString(); + return sRet.AsStringC(); } CFX_ByteString CPWL_Edit::GetCaretAppearanceStream( diff --git a/fpdfsdk/pdfwindow/PWL_Icon.cpp b/fpdfsdk/pdfwindow/PWL_Icon.cpp index d4635f6ecd..08ba970225 100644 --- a/fpdfsdk/pdfwindow/PWL_Icon.cpp +++ b/fpdfsdk/pdfwindow/PWL_Icon.cpp @@ -46,7 +46,7 @@ CFX_ByteString CPWL_Image::GetImageAppStream() { << "Q\n"; } - return sAppStream.GetByteString(); + return sAppStream.AsStringC(); } void CPWL_Image::SetPDFStream(CPDF_Stream* pStream) { diff --git a/fpdfsdk/pdfwindow/PWL_Label.cpp b/fpdfsdk/pdfwindow/PWL_Label.cpp index 9a1dce61d8..1375678cfb 100644 --- a/fpdfsdk/pdfwindow/PWL_Label.cpp +++ b/fpdfsdk/pdfwindow/PWL_Label.cpp @@ -132,7 +132,7 @@ CFX_ByteString CPWL_Label::GetTextAppearanceStream( << sEdit.AsStringC() << "ET\n"; } - return sRet.GetByteString(); + return sRet.AsStringC(); } CFX_WideString CPWL_Label::GetText() const { diff --git a/fpdfsdk/pdfwindow/PWL_Utils.cpp b/fpdfsdk/pdfwindow/PWL_Utils.cpp index 92787b9e6c..2c52309b3f 100644 --- a/fpdfsdk/pdfwindow/PWL_Utils.cpp +++ b/fpdfsdk/pdfwindow/PWL_Utils.cpp @@ -44,7 +44,7 @@ CFX_ByteString CPWL_Utils::GetAppStreamFromArray(const CPWL_PathData* pPathData, } } - return csAP.GetByteString(); + return csAP.AsStringC(); } void CPWL_Utils::GetPathDataFromArray(CFX_PathData& path, @@ -185,7 +185,7 @@ CFX_ByteString CPWL_Utils::GetAP_Check(const CFX_FloatRect& crBBox) { << pts[nNext][0].y << " c\n"; } - return csAP.GetByteString(); + return csAP.AsStringC(); } CFX_ByteString CPWL_Utils::GetAP_Circle(const CFX_FloatRect& crBBox) { @@ -227,7 +227,7 @@ CFX_ByteString CPWL_Utils::GetAP_Circle(const CFX_FloatRect& crBBox) { csAP << pt4.x - px * FX_BEZIER << " " << pt4.y << " " << pt1.x << " " << pt1.y - py * FX_BEZIER << " " << pt1.x << " " << pt1.y << " c\n"; - return csAP.GetByteString(); + return csAP.AsStringC(); } CFX_ByteString CPWL_Utils::GetAP_Cross(const CFX_FloatRect& crBBox) { @@ -238,7 +238,7 @@ CFX_ByteString CPWL_Utils::GetAP_Cross(const CFX_FloatRect& crBBox) { csAP << crBBox.left << " " << crBBox.bottom << " m\n"; csAP << crBBox.right << " " << crBBox.top << " l\n"; - return csAP.GetByteString(); + return csAP.AsStringC(); } CFX_ByteString CPWL_Utils::GetAP_Diamond(const CFX_FloatRect& crBBox) { @@ -258,7 +258,7 @@ CFX_ByteString CPWL_Utils::GetAP_Diamond(const CFX_FloatRect& crBBox) { csAP << pt4.x << " " << pt4.y << " l\n"; csAP << pt1.x << " " << pt1.y << " l\n"; - return csAP.GetByteString(); + return csAP.AsStringC(); } CFX_ByteString CPWL_Utils::GetAP_Square(const CFX_FloatRect& crBBox) { @@ -270,7 +270,7 @@ CFX_ByteString CPWL_Utils::GetAP_Square(const CFX_FloatRect& crBBox) { csAP << crBBox.left << " " << crBBox.bottom << " l\n"; csAP << crBBox.left << " " << crBBox.top << " l\n"; - return csAP.GetByteString(); + return csAP.AsStringC(); } CFX_ByteString CPWL_Utils::GetAP_Star(const CFX_FloatRect& crBBox) { @@ -302,7 +302,7 @@ CFX_ByteString CPWL_Utils::GetAP_Star(const CFX_FloatRect& crBBox) { csAP << px[nNext] << " " << py[nNext] << " l\n"; } - return csAP.GetByteString(); + return csAP.AsStringC(); } CFX_ByteString CPWL_Utils::GetAP_HalfCircle(const CFX_FloatRect& crBBox, @@ -337,7 +337,7 @@ CFX_ByteString CPWL_Utils::GetAP_HalfCircle(const CFX_FloatRect& crBBox, csAP << pt2.x + px * FX_BEZIER << " " << pt2.y << " " << pt3.x << " " << pt3.y + py * FX_BEZIER << " " << pt3.x << " " << pt3.y << " c\n"; - return csAP.GetByteString(); + return csAP.AsStringC(); } CFX_FloatRect CPWL_Utils::InflateRect(const CFX_FloatRect& rcRect, @@ -387,7 +387,7 @@ CFX_ByteString CPWL_Utils::GetRectFillAppStream(const CFX_FloatRect& rect, << " re f\nQ\n"; } - return sAppStream.GetByteString(); + return sAppStream.AsStringC(); } CFX_ByteString CPWL_Utils::GetCircleFillAppStream(const CFX_FloatRect& rect, @@ -399,7 +399,7 @@ CFX_ByteString CPWL_Utils::GetCircleFillAppStream(const CFX_FloatRect& rect, sAppStream << "q\n" << sColor << CPWL_Utils::GetAP_Circle(rect) << "f\nQ\n"; } - return sAppStream.GetByteString(); + return sAppStream.AsStringC(); } CFX_FloatRect CPWL_Utils::GetCenterSquare(const CFX_FloatRect& rect) { @@ -465,7 +465,7 @@ CFX_ByteString CPWL_Utils::GetTextAppStream(const CFX_FloatRect& rcBBox, IFX_Edit::DelEdit(pEdit); } - return sRet.GetByteString(); + return sRet.AsStringC(); } CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox, @@ -690,7 +690,7 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox, sAppStream << sTemp << "Q\n"; } - return sAppStream.GetByteString(); + return sAppStream.AsStringC(); } return ""; @@ -717,7 +717,7 @@ CFX_ByteString CPWL_Utils::GetColorAppStream(const CPWL_Color& color, break; } - return sColorStream.GetByteString(); + return sColorStream.AsStringC(); } CFX_ByteString CPWL_Utils::GetBorderAppStream(const CFX_FloatRect& rect, @@ -833,7 +833,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CFX_FloatRect& rect, sAppStream << "Q\n"; } - return sAppStream.GetByteString(); + return sAppStream.AsStringC(); } CFX_ByteString CPWL_Utils::GetCircleBorderAppStream( @@ -932,7 +932,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream( sAppStream << "Q\n"; } - return sAppStream.GetByteString(); + return sAppStream.AsStringC(); } CPWL_Color CPWL_Utils::SubstractColor(const CPWL_Color& sColor, @@ -991,7 +991,7 @@ CFX_ByteString CPWL_Utils::GetAppStream_Check(const CFX_FloatRect& rcBBox, CFX_ByteTextBuf sAP; sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText, TRUE) << CPWL_Utils::GetAP_Check(rcBBox) << "f\nQ\n"; - return sAP.GetByteString(); + return sAP.AsStringC(); } CFX_ByteString CPWL_Utils::GetAppStream_Circle(const CFX_FloatRect& rcBBox, @@ -999,7 +999,7 @@ CFX_ByteString CPWL_Utils::GetAppStream_Circle(const CFX_FloatRect& rcBBox, CFX_ByteTextBuf sAP; sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText, TRUE) << CPWL_Utils::GetAP_Circle(rcBBox) << "f\nQ\n"; - return sAP.GetByteString(); + return sAP.AsStringC(); } CFX_ByteString CPWL_Utils::GetAppStream_Cross(const CFX_FloatRect& rcBBox, @@ -1007,7 +1007,7 @@ CFX_ByteString CPWL_Utils::GetAppStream_Cross(const CFX_FloatRect& rcBBox, CFX_ByteTextBuf sAP; sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText, FALSE) << CPWL_Utils::GetAP_Cross(rcBBox) << "S\nQ\n"; - return sAP.GetByteString(); + return sAP.AsStringC(); } CFX_ByteString CPWL_Utils::GetAppStream_Diamond(const CFX_FloatRect& rcBBox, @@ -1015,7 +1015,7 @@ CFX_ByteString CPWL_Utils::GetAppStream_Diamond(const CFX_FloatRect& rcBBox, CFX_ByteTextBuf sAP; sAP << "q\n1 w\n" << CPWL_Utils::GetColorAppStream(crText, TRUE) << CPWL_Utils::GetAP_Diamond(rcBBox) << "f\nQ\n"; - return sAP.GetByteString(); + return sAP.AsStringC(); } CFX_ByteString CPWL_Utils::GetAppStream_Square(const CFX_FloatRect& rcBBox, @@ -1023,7 +1023,7 @@ CFX_ByteString CPWL_Utils::GetAppStream_Square(const CFX_FloatRect& rcBBox, CFX_ByteTextBuf sAP; sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText, TRUE) << CPWL_Utils::GetAP_Square(rcBBox) << "f\nQ\n"; - return sAP.GetByteString(); + return sAP.AsStringC(); } CFX_ByteString CPWL_Utils::GetAppStream_Star(const CFX_FloatRect& rcBBox, @@ -1031,7 +1031,7 @@ CFX_ByteString CPWL_Utils::GetAppStream_Star(const CFX_FloatRect& rcBBox, CFX_ByteTextBuf sAP; sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText, TRUE) << CPWL_Utils::GetAP_Star(rcBBox) << "f\nQ\n"; - return sAP.GetByteString(); + return sAP.AsStringC(); } CFX_ByteString CPWL_Utils::GetCheckBoxAppStream(const CFX_FloatRect& rcBBox, @@ -1110,7 +1110,7 @@ CFX_ByteString CPWL_Utils::GetDropButtonAppStream(const CFX_FloatRect& rcBBox) { } } - return sAppStream.GetByteString(); + return sAppStream.AsStringC(); } void CPWL_Utils::ConvertCMYK2GRAY(FX_FLOAT dC, diff --git a/xfa/fde/xml/fde_xml_imp.cpp b/xfa/fde/xml/fde_xml_imp.cpp index 16fc9622a9..0badeb41dc 100644 --- a/xfa/fde/xml/fde_xml_imp.cpp +++ b/xfa/fde/xml/fde_xml_imp.cpp @@ -819,7 +819,7 @@ void CFDE_XMLElement::GetTextData(CFX_WideString& wsText) const { } pChild = pChild->m_pNext; } - wsText = buffer.GetWideString(); + wsText = buffer.AsStringC(); } void CFDE_XMLElement::SetTextData(const CFX_WideString& wsText) { if (wsText.GetLength() < 1) { diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp index cc148c72ea..351aedd669 100644 --- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp +++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp @@ -3248,7 +3248,7 @@ void CXFA_FM2JSContext::Eval(FXJSE_HOBJECT hThis, wsJavaScriptBuf, wsError); FXJSE_HCONTEXT hContext = FXJSE_Context_Create(hruntime); FXJSE_HVALUE returnValue = FXJSE_Value_Create(hruntime); - javaScript = wsJavaScriptBuf.GetWideString(); + javaScript = wsJavaScriptBuf.AsStringC(); FXJSE_ExecuteScript( hContext, FX_UTF8Encode(javaScript.c_str(), javaScript.GetLength()).c_str(), @@ -3693,8 +3693,7 @@ void CXFA_FM2JSContext::Decode(FXJSE_HOBJECT hThis, HValueToUTF8String(argOne, toDecodeString); CFX_ByteTextBuf resultBuf; DecodeURL(toDecodeString.AsStringC(), resultBuf); - FXJSE_Value_SetUTF8String(args.GetReturnValue(), - resultBuf.GetByteString()); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultBuf.AsStringC()); } FXJSE_Value_Release(argOne); } else if (argc == 2) { @@ -3715,8 +3714,7 @@ void CXFA_FM2JSContext::Decode(FXJSE_HOBJECT hThis, } else { DecodeURL(toDecodeString.AsStringC(), resultBuf); } - FXJSE_Value_SetUTF8String(args.GetReturnValue(), - resultBuf.GetByteString()); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultBuf.AsStringC()); } FXJSE_Value_Release(argOne); FXJSE_Value_Release(argTwo); @@ -3966,8 +3964,7 @@ void CXFA_FM2JSContext::Encode(FXJSE_HOBJECT hThis, HValueToUTF8String(argOne, toEncodeString); CFX_ByteTextBuf resultBuf; EncodeURL(toEncodeString.AsStringC(), resultBuf); - FXJSE_Value_SetUTF8String(args.GetReturnValue(), - resultBuf.GetByteString()); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultBuf.AsStringC()); } FXJSE_Value_Release(argOne); } else if (argc == 2) { @@ -3988,8 +3985,7 @@ void CXFA_FM2JSContext::Encode(FXJSE_HOBJECT hThis, } else { EncodeURL(toEncodeString.AsStringC(), resultBuf); } - FXJSE_Value_SetUTF8String(args.GetReturnValue(), - resultBuf.GetByteString()); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultBuf.AsStringC()); } FXJSE_Value_Release(argOne); FXJSE_Value_Release(argTwo); @@ -4773,8 +4769,7 @@ void CXFA_FM2JSContext::Replace(FXJSE_HOBJECT hThis, } } resultString.AppendChar(0); - FXJSE_Value_SetUTF8String(args.GetReturnValue(), - resultString.GetByteString()); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultString.AsStringC()); FXJSE_Value_Release(argOne); FXJSE_Value_Release(argTwo); if (argc == 3) { @@ -4860,8 +4855,7 @@ void CXFA_FM2JSContext::Space(FXJSE_HOBJECT hThis, index++; } spaceString.AppendByte(0); - FXJSE_Value_SetUTF8String(args.GetReturnValue(), - spaceString.GetByteString()); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), spaceString.AsStringC()); } FXJSE_Value_Release(argOne); } else { @@ -4977,8 +4971,7 @@ void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis, resultBuf.AppendChar(0); } } - FXJSE_Value_SetUTF8String(args.GetReturnValue(), - resultBuf.GetByteString()); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultBuf.AsStringC()); } else { FXJSE_Value_SetNull(args.GetReturnValue()); } @@ -5044,8 +5037,7 @@ void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis, ++i; } resultString.AppendChar(0); - FXJSE_Value_SetUTF8String(args.GetReturnValue(), - resultString.GetByteString()); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultString.AsStringC()); FXJSE_Value_Release(sourceValue); FXJSE_Value_Release(startValue); FXJSE_Value_Release(deleteValue); @@ -5223,8 +5215,7 @@ void CXFA_FM2JSContext::WordNum(FXJSE_HOBJECT hThis, CFX_ByteString numberString; numberString.Format("%.2f", fNumber); WordUS(numberString.AsStringC(), iIdentifier, resultBuf); - FXJSE_Value_SetUTF8String(args.GetReturnValue(), - resultBuf.GetByteString()); + FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultBuf.AsStringC()); } } else { FXJSE_Value_SetNull(args.GetReturnValue()); @@ -6388,7 +6379,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.GetWideString(); + CFX_WideString javaScript = wsJavaScriptBuf.AsStringC(); FXJSE_Value_SetUTF8String( args.GetReturnValue(), FX_UTF8Encode(javaScript.c_str(), javaScript.GetLength()) diff --git a/xfa/fxfa/fm2js/xfa_simpleexpression.cpp b/xfa/fxfa/fm2js/xfa_simpleexpression.cpp index b600b52ebd..f6c12ae64d 100644 --- a/xfa/fxfa/fm2js/xfa_simpleexpression.cpp +++ b/xfa/fxfa/fm2js/xfa_simpleexpression.cpp @@ -237,7 +237,7 @@ void CXFA_FMAssignExpression::ToJavaScript(CFX_WideTextBuf& javascript) { CFX_WideTextBuf tempExp1; m_pExp1->ToJavaScript(tempExp1); if (m_pExp1->GetOperatorToken() == TOKidentifier && - tempExp1.GetWideString() != FX_WSTRC(L"this")) { + tempExp1.AsStringC() != FX_WSTRC(L"this")) { javascript << FX_WSTRC(L"else\n{\n"); javascript << tempExp1; javascript << FX_WSTRC(L" = "); @@ -267,7 +267,7 @@ void CXFA_FMAssignExpression::ToImpliedReturnJS(CFX_WideTextBuf& javascript) { CFX_WideTextBuf tempExp1; m_pExp1->ToJavaScript(tempExp1); if (m_pExp1->GetOperatorToken() == TOKidentifier && - tempExp1.GetWideString() != FX_WSTRC(L"this")) { + tempExp1.AsStringC() != FX_WSTRC(L"this")) { javascript << FX_WSTRC(L"else\n{\n"); javascript << RUNTIMEFUNCTIONRETURNVALUE; javascript << FX_WSTRC(L" = "); @@ -530,7 +530,7 @@ void CXFA_FMCallExpression::ToJavaScript(CFX_WideTextBuf& javascript) { javascript << funcName; javascript << FX_WSTRC(L"("); if (m_pArguments) { - uint32_t methodPara = IsMethodWithObjParam(funcName.GetWideString()); + uint32_t methodPara = IsMethodWithObjParam(funcName.AsStringC()); if (methodPara > 0) { for (int i = 0; i < m_pArguments->GetSize(); ++i) { if ((methodPara & (0x01 << i)) > 0) { @@ -568,12 +568,12 @@ void CXFA_FMCallExpression::ToJavaScript(CFX_WideTextBuf& javascript) { bool isEvalFunc = false; bool isExistsFunc = false; if (IsBuildInFunc(&funcName)) { - if (funcName.GetWideString() == FX_WSTRC(L"Eval")) { + if (funcName.AsStringC() == FX_WSTRC(L"Eval")) { isEvalFunc = true; javascript << FX_WSTRC(L"eval.call(this, "); javascript << gs_lpStrExpFuncName[CALL]; javascript << FX_WSTRC(L"Translate"); - } else if (funcName.GetWideString() == FX_WSTRC(L"Exists")) { + } else if (funcName.AsStringC() == FX_WSTRC(L"Exists")) { isExistsFunc = true; javascript << gs_lpStrExpFuncName[CALL]; javascript << funcName; diff --git a/xfa/fxfa/parser/xfa_document_serialize.cpp b/xfa/fxfa/parser/xfa_document_serialize.cpp index 87707d84e6..3c06afaf4a 100644 --- a/xfa/fxfa/parser/xfa_document_serialize.cpp +++ b/xfa/fxfa/parser/xfa_document_serialize.cpp @@ -94,7 +94,7 @@ CFX_WideString XFA_ExportEncodeAttribute(const CFX_WideString& str) { textBuf.AppendChar(str[i]); } } - return textBuf.GetWideString(); + return textBuf.AsStringC(); } CFX_WideString XFA_ExportEncodeContent(const CFX_WideStringC& str) { CFX_WideTextBuf textBuf; @@ -124,7 +124,7 @@ CFX_WideString XFA_ExportEncodeContent(const CFX_WideStringC& str) { textBuf.AppendChar(str.GetAt(i)); } } - return textBuf.GetWideString(); + return textBuf.AsStringC(); } static void XFA_SaveAttribute(CXFA_Node* pNode, XFA_ATTRIBUTE eName, @@ -303,7 +303,7 @@ static void XFA_DataExporter_RegenerateFormFile_Changed( buf << FX_WSTRC(L""); - wsChildren += buf.GetWideString(); + wsChildren += buf.AsStringC(); buf.Clear(); } else { CFX_WideStringC wsValue = pRawValueNode->GetCData(XFA_ATTRIBUTE_Value); @@ -330,7 +330,7 @@ static void XFA_DataExporter_RegenerateFormFile_Changed( while (pChildNode) { XFA_DataExporter_RegenerateFormFile_Changed(pChildNode, newBuf, bSaveXML); - wsChildren += newBuf.GetWideString(); + wsChildren += newBuf.AsStringC(); newBuf.Clear(); pChildNode = pChildNode->GetNodeItem(XFA_NODEITEM_NextSibling); } @@ -342,7 +342,7 @@ static void XFA_DataExporter_RegenerateFormFile_Changed( while (pChildNode) { XFA_DataExporter_RegenerateFormFile_Changed(pChildNode, newBuf, bSaveXML); - wsChildren += newBuf.GetWideString(); + wsChildren += newBuf.AsStringC(); newBuf.Clear(); pChildNode = pChildNode->GetNodeItem(XFA_NODEITEM_NextSibling); } diff --git a/xfa/fxfa/parser/xfa_parser_imp.cpp b/xfa/fxfa/parser/xfa_parser_imp.cpp index 002197c55d..75ccb1122a 100644 --- a/xfa/fxfa/parser/xfa_parser_imp.cpp +++ b/xfa/fxfa/parser/xfa_parser_imp.cpp @@ -1248,7 +1248,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode, } else { bMarkAsCompound = TRUE; if (pXMLCurValueNode) { - CFX_WideStringC wsCurValue = wsCurValueTextBuf.GetWideString(); + CFX_WideStringC wsCurValue = wsCurValueTextBuf.AsStringC(); if (!wsCurValue.IsEmpty()) { CXFA_Node* pXFAChild = m_pFactory->CreateNode(ePacketID, XFA_ELEMENT_DataValue); @@ -1282,7 +1282,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode, } } if (pXMLCurValueNode) { - CFX_WideStringC wsCurValue = wsCurValueTextBuf.GetWideString(); + CFX_WideStringC wsCurValue = wsCurValueTextBuf.AsStringC(); if (!wsCurValue.IsEmpty()) { if (bMarkAsCompound) { CXFA_Node* pXFAChild = @@ -1301,7 +1301,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode, } pXMLCurValueNode = nullptr; } - CFX_WideStringC wsNodeValue = wsValueTextBuf.GetWideString(); + CFX_WideStringC wsNodeValue = wsValueTextBuf.AsStringC(); pXFANode->SetCData(XFA_ATTRIBUTE_Value, wsNodeValue); } -- cgit v1.2.3