summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/cpdfsdk_annotiterator.cpp2
-rw-r--r--fpdfsdk/cpdfsdk_pageview.cpp2
-rw-r--r--fpdfsdk/fpdf_annot.cpp20
-rw-r--r--fpdfsdk/fpdf_doc.cpp4
-rw-r--r--fpdfsdk/fpdf_editpage.cpp10
-rw-r--r--fpdfsdk/fpdf_flatten.cpp2
-rw-r--r--fpdfsdk/fpdf_formfill.cpp2
-rw-r--r--fpdfsdk/fpdf_structtree.cpp2
-rw-r--r--fpdfsdk/fpdf_transformpage.cpp8
9 files changed, 28 insertions, 24 deletions
diff --git a/fpdfsdk/cpdfsdk_annotiterator.cpp b/fpdfsdk/cpdfsdk_annotiterator.cpp
index 1c168454fe..fbba3d5f01 100644
--- a/fpdfsdk/cpdfsdk_annotiterator.cpp
+++ b/fpdfsdk/cpdfsdk_annotiterator.cpp
@@ -34,7 +34,7 @@ CPDFSDK_AnnotIterator::CPDFSDK_AnnotIterator(CPDFSDK_PageView* pPageView,
m_pPageView(pPageView),
m_nAnnotSubtype(nAnnotSubtype) {
CPDF_Page* pPDFPage = m_pPageView->GetPDFPage();
- ByteString sTabs = pPDFPage->m_pFormDict->GetStringFor("Tabs");
+ ByteString sTabs = pPDFPage->GetFormDict()->GetStringFor("Tabs");
if (sTabs == "R")
m_eTabOrder = ROW;
else if (sTabs == "C")
diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp
index 08d1b8d1f0..2eab6ca32b 100644
--- a/fpdfsdk/cpdfsdk_pageview.cpp
+++ b/fpdfsdk/cpdfsdk_pageview.cpp
@@ -575,7 +575,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetFocusAnnot() {
}
int CPDFSDK_PageView::GetPageIndexForStaticPDF() const {
- CPDF_Dictionary* pDict = GetPDFPage()->m_pFormDict.Get();
+ const CPDF_Dictionary* pDict = GetPDFPage()->GetFormDict();
CPDF_Document* pDoc = m_pFormFillEnv->GetPDFDocument();
return (pDoc && pDict) ? pDoc->GetPageIndex(pDict->GetObjNum()) : -1;
}
diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp
index 3aca16334b..d3bf38d315 100644
--- a/fpdfsdk/fpdf_annot.cpp
+++ b/fpdfsdk/fpdf_annot.cpp
@@ -229,9 +229,9 @@ FPDFPage_CreateAnnot(FPDF_PAGE page, FPDF_ANNOTATION_SUBTYPE subtype) {
auto pNewAnnot =
pdfium::MakeUnique<CPDF_AnnotContext>(pDict.get(), pPage, nullptr);
- CPDF_Array* pAnnotList = pPage->m_pFormDict->GetArrayFor("Annots");
+ CPDF_Array* pAnnotList = pPage->GetFormDict()->GetArrayFor("Annots");
if (!pAnnotList)
- pAnnotList = pPage->m_pFormDict->SetNewFor<CPDF_Array>("Annots");
+ pAnnotList = pPage->GetFormDict()->SetNewFor<CPDF_Array>("Annots");
pAnnotList->Add(std::move(pDict));
// Caller takes ownership.
@@ -240,20 +240,20 @@ FPDFPage_CreateAnnot(FPDF_PAGE page, FPDF_ANNOTATION_SUBTYPE subtype) {
FPDF_EXPORT int FPDF_CALLCONV FPDFPage_GetAnnotCount(FPDF_PAGE page) {
CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
- if (!pPage || !pPage->m_pFormDict)
+ if (!pPage || !pPage->GetFormDict())
return 0;
- CPDF_Array* pAnnots = pPage->m_pFormDict->GetArrayFor("Annots");
+ CPDF_Array* pAnnots = pPage->GetFormDict()->GetArrayFor("Annots");
return pAnnots ? pAnnots->GetCount() : 0;
}
FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV FPDFPage_GetAnnot(FPDF_PAGE page,
int index) {
CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
- if (!pPage || !pPage->m_pFormDict || index < 0)
+ if (!pPage || !pPage->GetFormDict() || index < 0)
return nullptr;
- CPDF_Array* pAnnots = pPage->m_pFormDict->GetArrayFor("Annots");
+ CPDF_Array* pAnnots = pPage->GetFormDict()->GetArrayFor("Annots");
if (!pAnnots || static_cast<size_t>(index) >= pAnnots->GetCount())
return nullptr;
@@ -268,10 +268,10 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFPage_GetAnnotIndex(FPDF_PAGE page,
FPDF_ANNOTATION annot) {
CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
CPDF_AnnotContext* pAnnot = CPDFAnnotContextFromFPDFAnnotation(annot);
- if (!pPage || !pPage->m_pFormDict || !pAnnot || !pAnnot->GetAnnotDict())
+ if (!pPage || !pPage->GetFormDict() || !pAnnot || !pAnnot->GetAnnotDict())
return -1;
- CPDF_Array* pAnnots = pPage->m_pFormDict->GetArrayFor("Annots");
+ CPDF_Array* pAnnots = pPage->GetFormDict()->GetArrayFor("Annots");
if (!pAnnots)
return -1;
@@ -295,10 +295,10 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFPage_CloseAnnot(FPDF_ANNOTATION annot) {
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_RemoveAnnot(FPDF_PAGE page,
int index) {
CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
- if (!pPage || !pPage->m_pFormDict || index < 0)
+ if (!pPage || !pPage->GetFormDict() || index < 0)
return false;
- CPDF_Array* pAnnots = pPage->m_pFormDict->GetArrayFor("Annots");
+ CPDF_Array* pAnnots = pPage->GetFormDict()->GetArrayFor("Annots");
if (!pAnnots || static_cast<size_t>(index) >= pAnnots->GetCount())
return false;
diff --git a/fpdfsdk/fpdf_doc.cpp b/fpdfsdk/fpdf_doc.cpp
index 3e8f436f2f..3bb89fc48a 100644
--- a/fpdfsdk/fpdf_doc.cpp
+++ b/fpdfsdk/fpdf_doc.cpp
@@ -339,9 +339,9 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_Enumerate(FPDF_PAGE page,
if (!start_pos || !link_annot)
return false;
CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
- if (!pPage || !pPage->m_pFormDict)
+ if (!pPage || !pPage->GetFormDict())
return false;
- CPDF_Array* pAnnots = pPage->m_pFormDict->GetArrayFor("Annots");
+ CPDF_Array* pAnnots = pPage->GetFormDict()->GetArrayFor("Annots");
if (!pAnnots)
return false;
for (size_t i = *start_pos; i < pAnnots->GetCount(); i++) {
diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp
index 3f1098c371..19c301bf12 100644
--- a/fpdfsdk/fpdf_editpage.cpp
+++ b/fpdfsdk/fpdf_editpage.cpp
@@ -55,10 +55,14 @@ static_assert(FPDF_PAGEOBJ_FORM == CPDF_PageObject::FORM,
"FPDF_PAGEOBJ_FORM/CPDF_PageObject::FORM mismatch");
bool IsPageObject(CPDF_Page* pPage) {
- if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type"))
+ if (!pPage)
+ return false;
+
+ const CPDF_Dictionary* pFormDict = pPage->GetFormDict();
+ if (!pFormDict || !pFormDict->KeyExist("Type"))
return false;
- CPDF_Object* pObject = pPage->m_pFormDict->GetObjectFor("Type")->GetDirect();
+ const CPDF_Object* pObject = pFormDict->GetObjectFor("Type")->GetDirect();
return pObject && !pObject->GetString().Compare("Page");
}
@@ -479,7 +483,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetRotation(FPDF_PAGE page,
return;
rotate %= 4;
- pPage->m_pFormDict->SetNewFor<CPDF_Number>("Rotate", rotate * 90);
+ pPage->GetFormDict()->SetNewFor<CPDF_Number>("Rotate", rotate * 90);
}
FPDF_BOOL FPDFPageObj_SetFillColor(FPDF_PAGEOBJECT page_object,
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp
index b8c3f2c146..03a4f60b5c 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -240,7 +240,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
return FLATTEN_FAIL;
CPDF_Document* pDocument = pPage->GetDocument();
- CPDF_Dictionary* pPageDict = pPage->m_pFormDict.Get();
+ CPDF_Dictionary* pPageDict = pPage->GetFormDict();
if (!pDocument || !pPageDict)
return FLATTEN_FAIL;
diff --git a/fpdfsdk/fpdf_formfill.cpp b/fpdfsdk/fpdf_formfill.cpp
index d604bd0eb0..a3a471c1f8 100644
--- a/fpdfsdk/fpdf_formfill.cpp
+++ b/fpdfsdk/fpdf_formfill.cpp
@@ -649,7 +649,7 @@ FPDF_EXPORT void FPDF_CALLCONV FORM_DoPageAAction(FPDF_PAGE page,
return;
CPDFSDK_ActionHandler* pActionHandler = pFormFillEnv->GetActionHandler();
- CPDF_Dictionary* pPageDict = pPDFPage->m_pFormDict.Get();
+ CPDF_Dictionary* pPageDict = pPDFPage->GetFormDict();
if (!pPageDict)
return;
diff --git a/fpdfsdk/fpdf_structtree.cpp b/fpdfsdk/fpdf_structtree.cpp
index 99fc302490..d39f8084c2 100644
--- a/fpdfsdk/fpdf_structtree.cpp
+++ b/fpdfsdk/fpdf_structtree.cpp
@@ -37,7 +37,7 @@ FPDF_StructTree_GetForPage(FPDF_PAGE page) {
// Caller takes onwership.
return FPDFStructTreeFromCPDFStructTree(
- CPDF_StructTree::LoadPage(pPage->GetDocument(), pPage->m_pFormDict.Get())
+ CPDF_StructTree::LoadPage(pPage->GetDocument(), pPage->GetFormDict())
.release());
}
diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp
index 5d4199c69c..9d541da0cd 100644
--- a/fpdfsdk/fpdf_transformpage.cpp
+++ b/fpdfsdk/fpdf_transformpage.cpp
@@ -27,7 +27,7 @@ namespace {
void SetBoundingBox(CPDF_Page* page,
const ByteString& key,
const CFX_FloatRect& rect) {
- page->m_pFormDict->SetRectFor(key, rect);
+ page->GetFormDict()->SetRectFor(key, rect);
}
bool GetBoundingBox(CPDF_Page* page,
@@ -36,7 +36,7 @@ bool GetBoundingBox(CPDF_Page* page,
float* bottom,
float* right,
float* top) {
- CPDF_Array* pArray = page->m_pFormDict->GetArrayFor(key);
+ CPDF_Array* pArray = page->GetFormDict()->GetArrayFor(key);
if (!pArray)
return false;
@@ -121,7 +121,7 @@ FPDFPage_TransFormWithClip(FPDF_PAGE page,
matrix->c, matrix->d, matrix->e, matrix->f);
}
- CPDF_Dictionary* pPageDict = pPage->m_pFormDict.Get();
+ CPDF_Dictionary* pPageDict = pPage->GetFormDict();
CPDF_Object* pContentObj = GetPageContent(pPageDict);
if (!pContentObj)
return false;
@@ -264,7 +264,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFPage_InsertClipPath(FPDF_PAGE page,
if (!pPage)
return;
- CPDF_Dictionary* pPageDict = pPage->m_pFormDict.Get();
+ CPDF_Dictionary* pPageDict = pPage->GetFormDict();
CPDF_Object* pContentObj = GetPageContent(pPageDict);
if (!pContentObj)
return;