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

Unified Diff: core/fpdfdoc/cpdf_filespec.cpp

Issue 2510223002: Make CPDF_Dictionary use unique pointers. (Closed)
Patch Set: rebase Created 4 years, 1 month 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/fpdfdoc/cpdf_annotlist.cpp ('k') | core/fpdfdoc/cpdf_filespec_unittest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpdf_filespec.cpp
diff --git a/core/fpdfdoc/cpdf_filespec.cpp b/core/fpdfdoc/cpdf_filespec.cpp
index 46b7f8a4467eec4a5383942b508aa616e35bccc3..d6a66f7b73f353181cdbf3b67ab30b3b671b2912 100644
--- a/core/fpdfdoc/cpdf_filespec.cpp
+++ b/core/fpdfdoc/cpdf_filespec.cpp
@@ -7,7 +7,9 @@
#include "core/fpdfdoc/cpdf_filespec.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
+#include "core/fpdfapi/parser/cpdf_name.h"
#include "core/fpdfapi/parser/cpdf_object.h"
+#include "core/fpdfapi/parser/cpdf_string.h"
#include "core/fpdfapi/parser/fpdf_parser_decode.h"
#include "core/fxcrt/fx_system.h"
@@ -112,7 +114,7 @@ bool CPDF_FileSpec::GetFileName(CFX_WideString* csFileName) const {
CPDF_FileSpec::CPDF_FileSpec(const CFX_WeakPtr<CFX_ByteStringPool>& pPool) {
m_pObj = new CPDF_Dictionary(pPool);
- m_pObj->AsDictionary()->SetNameFor("Type", "Filespec");
+ m_pObj->AsDictionary()->SetNewFor<CPDF_Name>("Type", "Filespec");
}
CFX_WideString CPDF_FileSpec::EncodeFileName(const CFX_WideStringC& filepath) {
@@ -161,7 +163,8 @@ void CPDF_FileSpec::SetFileName(const CFX_WideStringC& wsFileName) {
if (m_pObj->IsString()) {
m_pObj->SetString(CFX_ByteString::FromUnicode(wsStr));
} else if (CPDF_Dictionary* pDict = m_pObj->AsDictionary()) {
- pDict->SetStringFor("F", CFX_ByteString::FromUnicode(wsStr));
- pDict->SetStringFor("UF", PDF_EncodeText(wsStr));
+ pDict->SetNewFor<CPDF_String>("F", CFX_ByteString::FromUnicode(wsStr),
+ false);
+ pDict->SetNewFor<CPDF_String>("UF", PDF_EncodeText(wsStr), false);
}
}
« no previous file with comments | « core/fpdfdoc/cpdf_annotlist.cpp ('k') | core/fpdfdoc/cpdf_filespec_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698