| Index: core/fpdfdoc/cpdf_annotlist.cpp
|
| diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp
|
| index 91cff454e323bca5203cf33cc0a695f3987543eb..e68e08a1f6c10f03a30dbbcc1d0c7477916fc4f2 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);
|
|
|