From 0e606b5ecd6e45f74391f110cc1fe0cce0e80c64 Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 18 Nov 2016 16:22:41 -0800 Subject: Make CPDF_Dictionary use unique pointers. 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 --- fpdfsdk/cpdfsdk_annothandlermgr.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'fpdfsdk/cpdfsdk_annothandlermgr.cpp') 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( + "M", curTime.ToPDFDateTimeString(), false); + pPDFAnnot->GetAnnotDict()->SetNewFor("F", 0); } void CPDFSDK_AnnotHandlerMgr::Annot_OnLoad(CPDFSDK_Annot* pAnnot) { -- cgit v1.2.3