From 90fffb31e2ec6cf66fe1b85b466cd2f12ee9c87f Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 16 Oct 2017 15:34:05 -0400 Subject: Simplify CPVT_GenerateAP interface This CL moves the annotation decision inside GenerateAnnotAP and hides the individual annotation AP generation methods. The form methods are hidden inside GenerateFormAP and a general GenerateEmptyAP has been added. Change-Id: I9e761cb10ceca70681df4e546631a7859f1bfc7c Reviewed-on: https://pdfium-review.googlesource.com/16130 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- fpdfsdk/fpdfannot.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/fpdfannot.cpp b/fpdfsdk/fpdfannot.cpp index a671032b1e..09bf42af92 100644 --- a/fpdfsdk/fpdfannot.cpp +++ b/fpdfsdk/fpdfannot.cpp @@ -357,14 +357,7 @@ FPDFAnnot_AppendObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj) { CPDF_Stream* pStream = FPDFDOC_GetAnnotAP(pAnnot->GetAnnotDict(), CPDF_Annot::AppearanceMode::Normal); if (!pStream) { - auto pExtGStateDict = - CPVT_GenerateAP::GenerateExtGStateDict(*pAnnotDict, "GS", "Normal"); - auto pResourceDict = CPVT_GenerateAP::GenerateResourceDict( - pPage->m_pDocument.Get(), std::move(pExtGStateDict), nullptr); - std::ostringstream sStream; - CPVT_GenerateAP::GenerateAndSetAPDict(pPage->m_pDocument.Get(), pAnnotDict, - &sStream, std::move(pResourceDict), - false); + CPVT_GenerateAP::GenerateEmptyAP(pPage->m_pDocument.Get(), pAnnotDict); pStream = FPDFDOC_GetAnnotAP(pAnnotDict, CPDF_Annot::AppearanceMode::Normal); if (!pStream) -- cgit v1.2.3