summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_annothandlermgr.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 /fpdfsdk/cpdfsdk_annothandlermgr.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 'fpdfsdk/cpdfsdk_annothandlermgr.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_annothandlermgr.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/fpdfsdk/cpdfsdk_annothandlermgr.cpp b/fpdfsdk/cpdfsdk_annothandlermgr.cpp
index 51ce88e21f..898b9ccc0f 100644
--- a/fpdfsdk/cpdfsdk_annothandlermgr.cpp
+++ b/fpdfsdk/cpdfsdk_annothandlermgr.cpp
@@ -6,6 +6,8 @@
#include "fpdfsdk/cpdfsdk_annothandlermgr.h"
+#include "core/fpdfapi/parser/cpdf_number.h"
+#include "core/fpdfapi/parser/cpdf_string.h"
#include "core/fpdfdoc/cpdf_annot.h"
#include "fpdfsdk/cba_annotiterator.h"
#include "fpdfsdk/cpdfsdk_annot.h"
@@ -62,8 +64,9 @@ void CPDFSDK_AnnotHandlerMgr::Annot_OnCreate(CPDFSDK_Annot* pAnnot) {
CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot();
CPDFSDK_DateTime curTime;
- pPDFAnnot->GetAnnotDict()->SetStringFor("M", curTime.ToPDFDateTimeString());
- pPDFAnnot->GetAnnotDict()->SetNumberFor("F", 0);
+ pPDFAnnot->GetAnnotDict()->SetNewFor<CPDF_String>(
+ "M", curTime.ToPDFDateTimeString(), false);
+ pPDFAnnot->GetAnnotDict()->SetNewFor<CPDF_Number>("F", 0);
}
void CPDFSDK_AnnotHandlerMgr::Annot_OnLoad(CPDFSDK_Annot* pAnnot) {