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

Unified Diff: core/fpdfapi/fpdf_font/cpdf_cidfont.cpp

Issue 2248453002: Use a std::vector in fpdf_font code. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nits Created 4 years, 4 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 | « no previous file | core/fpdfapi/fpdf_font/cpdf_font.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_font/cpdf_cidfont.cpp
diff --git a/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp b/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp
index 8de2c98a84791bd4918a7345906bcc343e1c9746..0dcbf48be2bb81258975e99d0c0dfc16e262d34d 100644
--- a/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp
@@ -7,6 +7,7 @@
#include "core/fpdfapi/fpdf_font/cpdf_cidfont.h"
#include <algorithm>
+#include <vector>
#include "core/fpdfapi/fpdf_cmaps/cmap_int.h"
#include "core/fpdfapi/fpdf_font/font_int.h"
@@ -627,15 +628,16 @@ int CPDF_CIDFont::GlyphFromCharCode(uint32_t charcode, bool* pVertGlyph) {
return charcode ? static_cast<int>(charcode) : -1;
charcode += 31;
- FX_BOOL bMSUnicode = FT_UseTTCharmap(face, 3, 1);
- FX_BOOL bMacRoman = bMSUnicode ? FALSE : FT_UseTTCharmap(face, 1, 0);
+ bool bMSUnicode = FT_UseTTCharmap(face, 3, 1);
+ bool bMacRoman = !bMSUnicode && FT_UseTTCharmap(face, 1, 0);
int iBaseEncoding = PDFFONT_ENCODING_STANDARD;
if (bMSUnicode) {
iBaseEncoding = PDFFONT_ENCODING_WINANSI;
} else if (bMacRoman) {
iBaseEncoding = PDFFONT_ENCODING_MACROMAN;
}
- const FX_CHAR* name = GetAdobeCharName(iBaseEncoding, nullptr, charcode);
+ const FX_CHAR* name = GetAdobeCharName(
+ iBaseEncoding, std::vector<CFX_ByteString>(), charcode);
if (!name)
return charcode ? static_cast<int>(charcode) : -1;
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_font/cpdf_font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698