summaryrefslogtreecommitdiff
path: root/core/fpdfapi/edit
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/fpdfapi/edit
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/fpdfapi/edit')
-rw-r--r--core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
index 14e4ed32c5..e431b9bf57 100644
--- a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
+++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
@@ -279,9 +279,8 @@ void CPDF_PageContentGenerator::ProcessText(CFX_ByteTextBuf* buf,
<< " Tf ";
CFX_ByteString text;
for (uint32_t charcode : pTextObj->m_CharCodes) {
- if (charcode == CPDF_Font::kInvalidCharCode)
- continue;
- pFont->AppendChar(text, charcode);
+ if (charcode != CPDF_Font::kInvalidCharCode)
+ pFont->AppendChar(&text, charcode);
}
*buf << PDF_EncodeString(text, true) << " Tj ET\n";
}