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

Unified Diff: core/fpdfapi/fpdf_page/cpdf_textobject.cpp

Issue 1885973002: Remove implicit cast from CFX_ByteString to (const char*). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Typo Created 4 years, 8 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/fpdfapi/fpdf_font/fpdf_font_cid.cpp ('k') | core/fpdfapi/fpdf_parser/cfdf_document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_page/cpdf_textobject.cpp
diff --git a/core/fpdfapi/fpdf_page/cpdf_textobject.cpp b/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
index 444101fb9e0b373137a00816b0964a203b68981c..a3fbbad8b0011d2860e05f430df54e7bfb1fc342 100644
--- a/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
@@ -142,7 +142,7 @@ void CPDF_TextObject::SetSegments(const CFX_ByteString* pStrs,
CPDF_Font* pFont = m_TextState.GetFont();
m_nChars = 0;
for (int i = 0; i < nsegs; ++i) {
- m_nChars += pFont->CountChar(pStrs[i], pStrs[i].GetLength());
+ m_nChars += pFont->CountChar(pStrs[i].c_str(), pStrs[i].GetLength());
}
m_nChars += nsegs - 1;
if (m_nChars > 1) {
@@ -150,8 +150,9 @@ void CPDF_TextObject::SetSegments(const CFX_ByteString* pStrs,
m_pCharPos = FX_Alloc(FX_FLOAT, m_nChars - 1);
int index = 0;
for (int i = 0; i < nsegs; ++i) {
- const FX_CHAR* segment = pStrs[i];
- int offset = 0, len = pStrs[i].GetLength();
+ const FX_CHAR* segment = pStrs[i].c_str();
+ int len = pStrs[i].GetLength();
+ int offset = 0;
while (offset < len) {
m_pCharCodes[index++] = pFont->GetNextChar(segment, len, offset);
}
@@ -163,7 +164,7 @@ void CPDF_TextObject::SetSegments(const CFX_ByteString* pStrs,
} else {
int offset = 0;
m_pCharCodes = (uint32_t*)(uintptr_t)pFont->GetNextChar(
- pStrs[0], pStrs[0].GetLength(), offset);
+ pStrs[0].c_str(), pStrs[0].GetLength(), offset);
}
}
« no previous file with comments | « core/fpdfapi/fpdf_font/fpdf_font_cid.cpp ('k') | core/fpdfapi/fpdf_parser/cfdf_document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698