Remove always null parameter in CPDF_AnnotContext ctor.
Change-Id: I34d2f51fec21a6dd842d642756bd6e7bc71020f3
Reviewed-on: https://pdfium-review.googlesource.com/c/50690
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/fpdfsdk/cpdf_annotcontext.cpp b/fpdfsdk/cpdf_annotcontext.cpp
index 4e01ed6..c50435e 100644
--- a/fpdfsdk/cpdf_annotcontext.cpp
+++ b/fpdfsdk/cpdf_annotcontext.cpp
@@ -13,11 +13,8 @@
#include "third_party/base/ptr_util.h"
CPDF_AnnotContext::CPDF_AnnotContext(CPDF_Dictionary* pAnnotDict,
- CPDF_Page* pPage,
- CPDF_Stream* pStream)
- : m_pAnnotDict(pAnnotDict), m_pPage(pPage) {
- SetForm(pStream);
-}
+ CPDF_Page* pPage)
+ : m_pAnnotDict(pAnnotDict), m_pPage(pPage) {}
CPDF_AnnotContext::~CPDF_AnnotContext() = default;
diff --git a/fpdfsdk/cpdf_annotcontext.h b/fpdfsdk/cpdf_annotcontext.h
index 38cc91e..5071210 100644
--- a/fpdfsdk/cpdf_annotcontext.h
+++ b/fpdfsdk/cpdf_annotcontext.h
@@ -18,9 +18,7 @@
class CPDF_AnnotContext {
public:
- CPDF_AnnotContext(CPDF_Dictionary* pAnnotDict,
- CPDF_Page* pPage,
- CPDF_Stream* pStream);
+ CPDF_AnnotContext(CPDF_Dictionary* pAnnotDict, CPDF_Page* pPage);
~CPDF_AnnotContext();
void SetForm(CPDF_Stream* pStream);
diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp
index ee3c632..9517997 100644
--- a/fpdfsdk/fpdf_annot.cpp
+++ b/fpdfsdk/fpdf_annot.cpp
@@ -231,8 +231,7 @@
pDict->SetNewFor<CPDF_Name>(pdfium::annotation::kSubtype,
CPDF_Annot::AnnotSubtypeToString(
static_cast<CPDF_Annot::Subtype>(subtype)));
- auto pNewAnnot =
- pdfium::MakeUnique<CPDF_AnnotContext>(pDict.get(), pPage, nullptr);
+ auto pNewAnnot = pdfium::MakeUnique<CPDF_AnnotContext>(pDict.get(), pPage);
CPDF_Array* pAnnotList = pPage->GetDict()->GetArrayFor("Annots");
if (!pAnnotList)
@@ -263,7 +262,7 @@
return nullptr;
CPDF_Dictionary* pDict = ToDictionary(pAnnots->GetDirectObjectAt(index));
- auto pNewAnnot = pdfium::MakeUnique<CPDF_AnnotContext>(pDict, pPage, nullptr);
+ auto pNewAnnot = pdfium::MakeUnique<CPDF_AnnotContext>(pDict, pPage);
// Caller takes ownership.
return FPDFAnnotationFromCPDFAnnotContext(pNewAnnot.release());
@@ -837,8 +836,8 @@
if (!pLinkedDict || pLinkedDict->GetStringFor("Type") != "Annot")
return nullptr;
- auto pLinkedAnnot = pdfium::MakeUnique<CPDF_AnnotContext>(
- pLinkedDict, pAnnot->GetPage(), nullptr);
+ auto pLinkedAnnot =
+ pdfium::MakeUnique<CPDF_AnnotContext>(pLinkedDict, pAnnot->GetPage());
// Caller takes ownership.
return FPDFAnnotationFromCPDFAnnotContext(pLinkedAnnot.release());