summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_page
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-13 15:41:21 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-13 15:41:21 -0700
commitb4c9f3f04673753da30011e9f1282cd5d1fa0f40 (patch)
tree9890d43409c8d60b1041de921c961067907419fb /core/fpdfapi/fpdf_page
parentcdce75706de7e76e73550a0582e1fd28af324fd0 (diff)
downloadpdfium-b4c9f3f04673753da30011e9f1282cd5d1fa0f40.tar.xz
Remove implicit cast from CFX_ByteString to (const char*).
BUG= Review URL: https://codereview.chromium.org/1885973002
Diffstat (limited to 'core/fpdfapi/fpdf_page')
-rw-r--r--core/fpdfapi/fpdf_page/cpdf_textobject.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/fpdfapi/fpdf_page/cpdf_textobject.cpp b/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
index 444101fb9e..a3fbbad8b0 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);
}
}