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

Unified Diff: core/fpdfapi/fpdf_font/cpdf_type3font.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 | « core/fpdfapi/fpdf_font/cpdf_type1font.cpp ('k') | core/fpdfapi/fpdf_font/font_int.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_font/cpdf_type3font.cpp
diff --git a/core/fpdfapi/fpdf_font/cpdf_type3font.cpp b/core/fpdfapi/fpdf_font/cpdf_type3font.cpp
index 8e4ac568846fa051a42f86404b3e3f25388e80b6..849ad92298b5267a550b68f5ca0b2c34e67fcd52 100644
--- a/core/fpdfapi/fpdf_font/cpdf_type3font.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_type3font.cpp
@@ -6,6 +6,8 @@
#include "core/fpdfapi/fpdf_font/cpdf_type3font.h"
+#include <utility>
+
#include "core/fpdfapi/fpdf_font/cpdf_type3char.h"
#include "core/fpdfapi/fpdf_page/include/cpdf_form.h"
#include "core/fpdfapi/fpdf_page/pageint.h"
@@ -67,11 +69,11 @@ FX_BOOL CPDF_Type3Font::Load() {
m_pCharProcs = m_pFontDict->GetDictBy("CharProcs");
CPDF_Object* pEncoding = m_pFontDict->GetDirectObjectBy("Encoding");
if (pEncoding) {
- LoadPDFEncoding(pEncoding, m_BaseEncoding, m_pCharNames, FALSE, FALSE);
- if (m_pCharNames) {
+ LoadPDFEncoding(pEncoding, m_BaseEncoding, &m_CharNames, FALSE, FALSE);
+ if (!m_CharNames.empty()) {
for (int i = 0; i < 256; i++) {
m_Encoding.m_Unicodes[i] =
- PDF_UnicodeFromAdobeName(m_pCharNames[i].c_str());
+ PDF_UnicodeFromAdobeName(m_CharNames[i].c_str());
if (m_Encoding.m_Unicodes[i] == 0) {
m_Encoding.m_Unicodes[i] = i;
}
@@ -93,8 +95,7 @@ CPDF_Type3Char* CPDF_Type3Font::LoadChar(uint32_t charcode, int level) {
if (it != m_CacheMap.end())
return it->second.get();
- const FX_CHAR* name =
- GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
+ const FX_CHAR* name = GetAdobeCharName(m_BaseEncoding, m_CharNames, charcode);
if (!name)
return nullptr;
« no previous file with comments | « core/fpdfapi/fpdf_font/cpdf_type1font.cpp ('k') | core/fpdfapi/fpdf_font/font_int.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698