Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1179)

Unified Diff: core/fpdftext/fpdf_text_int.cpp

Issue 1979723003: Make CFX_WideString(const CFX_WideString&) explicit. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Override Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfdoc/doc_basic.cpp ('k') | core/fxcrt/fx_basic_bstring.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdftext/fpdf_text_int.cpp
diff --git a/core/fpdftext/fpdf_text_int.cpp b/core/fpdftext/fpdf_text_int.cpp
index f843da306161e4d4835c50569f7642744d0b0367..136c44b5ed04280282354168c2e38eb3f5ae4c33 100644
--- a/core/fpdftext/fpdf_text_int.cpp
+++ b/core/fpdftext/fpdf_text_int.cpp
@@ -537,7 +537,8 @@ CFX_WideString CPDF_TextPage::GetPageText(int start, int nCount) const {
if (nCount == -1) {
nCount = pdfium::CollectionSize<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 @@ CFX_WideString CPDF_TextPage::GetPageText(int start, int nCount) const {
if (nCount <= 0) {
return L"";
}
- return m_TextBuf.AsStringC().Mid(startindex, nCount);
+ return CFX_WideString(m_TextBuf.AsStringC().Mid(startindex, nCount));
}
int CPDF_TextPage::CountRects(int start, int nCount) {
@@ -890,7 +891,7 @@ void CPDF_TextPage::CloseTempLine() {
if (m_TempCharList.empty())
return;
- CFX_WideString str = m_TempTextBuf.AsStringC();
+ CFX_WideString str = m_TempTextBuf.MakeString();
FX_BOOL bPrevSpace = FALSE;
for (int i = 0; i < str.GetLength(); i++) {
if (str.GetAt(i) != ' ') {
@@ -1299,7 +1300,7 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) {
charinfo.m_OriginY = 0;
pTextObj->GetItemInfo(i, &item);
if (item.m_CharCode == (uint32_t)-1) {
- CFX_WideString str = m_TempTextBuf.AsStringC();
+ CFX_WideString str = m_TempTextBuf.MakeString();
if (str.IsEmpty()) {
str = m_TextBuf.AsStringC();
}
@@ -1435,7 +1436,7 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) {
m_TempCharList.push_back(charinfo);
}
} else if (i == 0) {
- CFX_WideString str = m_TempTextBuf.AsStringC();
+ CFX_WideString str = m_TempTextBuf.MakeString();
if (!str.IsEmpty() &&
str.GetAt(str.GetLength() - 1) == TEXT_BLANK_CHAR) {
m_TempTextBuf.Delete(m_TempTextBuf.GetLength() - 1, 1);
@@ -1478,7 +1479,7 @@ int32_t CPDF_TextPage::GetTextObjectWritingMode(
return m_TextlineDir;
}
FX_BOOL CPDF_TextPage::IsHyphen(FX_WCHAR curChar) {
- CFX_WideString strCurText = m_TempTextBuf.AsStringC();
+ CFX_WideString strCurText = m_TempTextBuf.MakeString();
if (strCurText.GetLength() == 0) {
strCurText = m_TextBuf.AsStringC();
}
« no previous file with comments | « core/fpdfdoc/doc_basic.cpp ('k') | core/fxcrt/fx_basic_bstring.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698