summaryrefslogtreecommitdiff
path: root/core/fpdftext/cpdf_textpage.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-04-07 11:42:38 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-07 19:09:24 +0000
commit1835a6fb98286817cdf656f4d1e223bd85ee378f (patch)
treee8bc07753b2c116f9dd530da41539ebac419155e /core/fpdftext/cpdf_textpage.cpp
parent6a5c20cd08748da5969cbab756c3e8a6dd27bfbc (diff)
downloadpdfium-1835a6fb98286817cdf656f4d1e223bd85ee378f.tar.xz
Tweak CFDF_Font::AppendChar()
Pass in/out argument as a pointer. Avoid pointless malloc just to copy in multibyte case. Then we can avoid special-casing the single-byte case. Change-Id: I3dd2d57e08ef6ad7b78ea38398b228fa41a9b3e6 Reviewed-on: https://pdfium-review.googlesource.com/3950 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdftext/cpdf_textpage.cpp')
-rw-r--r--core/fpdftext/cpdf_textpage.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp
index 09e086f856..c81d4fa407 100644
--- a/core/fpdftext/cpdf_textpage.cpp
+++ b/core/fpdftext/cpdf_textpage.cpp
@@ -624,7 +624,7 @@ int CPDF_TextPage::GetCharWidth(uint32_t charCode, CPDF_Font* pFont) const {
return w;
CFX_ByteString str;
- pFont->AppendChar(str, charCode);
+ pFont->AppendChar(&str, charCode);
if (int w = pFont->GetStringWidth(str.c_str(), 1))
return w;