summaryrefslogtreecommitdiff
path: root/fpdfsdk/fxedit
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 /fpdfsdk/fxedit
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 'fpdfsdk/fxedit')
-rw-r--r--fpdfsdk/fxedit/fxet_ap.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/fpdfsdk/fxedit/fxet_ap.cpp b/fpdfsdk/fxedit/fxet_ap.cpp
index 448a539581..1576efa89a 100644
--- a/fpdfsdk/fxedit/fxet_ap.cpp
+++ b/fpdfsdk/fxedit/fxet_ap.cpp
@@ -26,13 +26,11 @@ CFX_ByteString GetPDFWordString(IPVT_FontMap* pFontMap,
uint32_t dwCharCode = pPDFFont->IsUnicodeCompatible()
? pPDFFont->CharCodeFromUnicode(Word)
: pFontMap->CharCodeFromUnicode(nFontIndex, Word);
-
if (dwCharCode > 0) {
- pPDFFont->AppendChar(sWord, dwCharCode);
+ pPDFFont->AppendChar(&sWord, dwCharCode);
return sWord;
}
}
-
- pPDFFont->AppendChar(sWord, Word);
+ pPDFFont->AppendChar(&sWord, Word);
return sWord;
}