summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font/cpdf_font.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-18 16:22:41 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-18 16:22:41 -0800
commit0e606b5ecd6e45f74391f110cc1fe0cce0e80c64 (patch)
tree07c55fac710b191cf5d1d6595c63b90ca52e3cbb /core/fpdfapi/font/cpdf_font.cpp
parent430ab8363e77c48b2c2435af4d289f85e2be1b96 (diff)
downloadpdfium-0e606b5ecd6e45f74391f110cc1fe0cce0e80c64.tar.xz
Make CPDF_Dictionary use unique pointers.chromium/2926
Some changes were required to match underlying ctors as invoked by the templated methods. Many release() calls go away, a few WrapUniques() are introduced to avoid going deeper into other code. Review-Url: https://codereview.chromium.org/2510223002
Diffstat (limited to 'core/fpdfapi/font/cpdf_font.cpp')
-rw-r--r--core/fpdfapi/font/cpdf_font.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/fpdfapi/font/cpdf_font.cpp b/core/fpdfapi/font/cpdf_font.cpp
index c5da4ea519..c7725c3fce 100644
--- a/core/fpdfapi/font/cpdf_font.cpp
+++ b/core/fpdfapi/font/cpdf_font.cpp
@@ -7,6 +7,7 @@
#include "core/fpdfapi/font/cpdf_font.h"
#include <memory>
+#include <utility>
#include <vector>
#include "core/fpdfapi/cpdf_modulemgr.h"
@@ -310,10 +311,10 @@ CPDF_Font* CPDF_Font::GetStockFont(CPDF_Document* pDoc,
return pFont;
CPDF_Dictionary* pDict = new CPDF_Dictionary(pDoc->GetByteStringPool());
- pDict->SetNameFor("Type", "Font");
- pDict->SetNameFor("Subtype", "Type1");
- pDict->SetNameFor("BaseFont", fontname);
- pDict->SetNameFor("Encoding", "WinAnsiEncoding");
+ pDict->SetNewFor<CPDF_Name>("Type", "Font");
+ pDict->SetNewFor<CPDF_Name>("Subtype", "Type1");
+ pDict->SetNewFor<CPDF_Name>("BaseFont", fontname);
+ pDict->SetNewFor<CPDF_Name>("Encoding", "WinAnsiEncoding");
return pFontGlobals->Set(pDoc, font_id, CPDF_Font::Create(nullptr, pDict));
}