diff options
Diffstat (limited to 'core/fpdfdoc/cpdf_annotlist.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_annotlist.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp index 91cff454e3..e68e08a1f6 100644 --- a/core/fpdfdoc/cpdf_annotlist.cpp +++ b/core/fpdfdoc/cpdf_annotlist.cpp @@ -11,7 +11,10 @@ #include "core/fpdfapi/page/cpdf_page.h" #include "core/fpdfapi/parser/cpdf_document.h" +#include "core/fpdfapi/parser/cpdf_name.h" +#include "core/fpdfapi/parser/cpdf_number.h" #include "core/fpdfapi/parser/cpdf_reference.h" +#include "core/fpdfapi/parser/cpdf_string.h" #include "core/fpdfapi/render/cpdf_renderoptions.h" #include "core/fpdfdoc/cpdf_annot.h" #include "core/fpdfdoc/cpdf_interform.h" @@ -36,10 +39,11 @@ std::unique_ptr<CPDF_Annot> CreatePopupAnnot(CPDF_Annot* pAnnot, auto pAnnotDict = pdfium::MakeUnique<CPDF_Dictionary>(pDocument->GetByteStringPool()); - pAnnotDict->SetNameFor("Type", "Annot"); - pAnnotDict->SetNameFor("Subtype", "Popup"); - pAnnotDict->SetStringFor("T", pParentDict->GetStringFor("T")); - pAnnotDict->SetStringFor("Contents", sContents.UTF8Encode()); + pAnnotDict->SetNewFor<CPDF_Name>("Type", "Annot"); + pAnnotDict->SetNewFor<CPDF_Name>("Subtype", "Popup"); + pAnnotDict->SetNewFor<CPDF_String>("T", pParentDict->GetStringFor("T"), + false); + pAnnotDict->SetNewFor<CPDF_String>("Contents", sContents.UTF8Encode(), false); CFX_FloatRect rect = pParentDict->GetRectFor("Rect"); rect.Normalize(); @@ -47,7 +51,7 @@ std::unique_ptr<CPDF_Annot> CreatePopupAnnot(CPDF_Annot* pAnnot, popupRect.Translate(rect.left, rect.bottom - popupRect.Height()); pAnnotDict->SetRectFor("Rect", popupRect); - pAnnotDict->SetIntegerFor("F", 0); + pAnnotDict->SetNewFor<CPDF_Number>("F", 0); auto pPopupAnnot = pdfium::MakeUnique<CPDF_Annot>(std::move(pAnnotDict), pDocument); |