summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-05-07 23:36:26 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-07 23:36:26 +0000
commit8f63763317ae1ef65d1ac2719624adeb728f2207 (patch)
treeb4d7e2c8edd8a84e0bc197f29a3ac05532077e44 /fpdfsdk
parent4c31a13a704850fdf301fb561ba966baa3c7c29c (diff)
downloadpdfium-8f63763317ae1ef65d1ac2719624adeb728f2207.tar.xz
Make more CPDF_PageObjectHolder members protected.
Change-Id: Id31b9f6ac33971c47cdb378ff7f9ca7d33f899b9 Reviewed-on: https://pdfium-review.googlesource.com/32112 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/cpdf_annotcontext.cpp2
-rw-r--r--fpdfsdk/cpdfsdk_pageview.cpp2
-rw-r--r--fpdfsdk/cpdfsdk_widgethandler.cpp2
-rw-r--r--fpdfsdk/formfiller/cba_fontmap.cpp2
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.cpp2
-rw-r--r--fpdfsdk/fpdf_annot.cpp8
-rw-r--r--fpdfsdk/fpdf_doc.cpp2
-rw-r--r--fpdfsdk/fpdf_editimg.cpp4
-rw-r--r--fpdfsdk/fpdf_flatten.cpp2
-rw-r--r--fpdfsdk/fpdf_formfill.cpp6
-rw-r--r--fpdfsdk/fpdf_structtree.cpp3
-rw-r--r--fpdfsdk/fpdf_text.cpp2
-rw-r--r--fpdfsdk/fpdf_transformpage.cpp4
-rw-r--r--fpdfsdk/fpdf_view.cpp2
14 files changed, 21 insertions, 22 deletions
diff --git a/fpdfsdk/cpdf_annotcontext.cpp b/fpdfsdk/cpdf_annotcontext.cpp
index d76d5d2f8c..20c5fc343e 100644
--- a/fpdfsdk/cpdf_annotcontext.cpp
+++ b/fpdfsdk/cpdf_annotcontext.cpp
@@ -30,6 +30,6 @@ void CPDF_AnnotContext::SetForm(CPDF_Stream* pStream) {
pStream->GetDict()->SetMatrixFor("Matrix", CFX_Matrix());
m_pAnnotForm = pdfium::MakeUnique<CPDF_Form>(
- m_pPage->m_pDocument.Get(), m_pPage->m_pResources.Get(), pStream);
+ m_pPage->GetDocument(), m_pPage->m_pResources.Get(), pStream);
m_pAnnotForm->ParseContent();
}
diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp
index 87856fb0f0..08d1b8d1f0 100644
--- a/fpdfsdk/cpdfsdk_pageview.cpp
+++ b/fpdfsdk/cpdfsdk_pageview.cpp
@@ -211,7 +211,7 @@ CPDF_Document* CPDFSDK_PageView::GetPDFDocument() {
#ifdef PDF_ENABLE_XFA
return m_page->GetDocumentExtension()->GetPDFDoc();
#else // PDF_ENABLE_XFA
- return m_page->m_pDocument.Get();
+ return m_page->GetDocument();
#endif // PDF_ENABLE_XFA
}
return nullptr;
diff --git a/fpdfsdk/cpdfsdk_widgethandler.cpp b/fpdfsdk/cpdfsdk_widgethandler.cpp
index 17d783fcbe..a21063d55e 100644
--- a/fpdfsdk/cpdfsdk_widgethandler.cpp
+++ b/fpdfsdk/cpdfsdk_widgethandler.cpp
@@ -47,7 +47,7 @@ bool CPDFSDK_WidgetHandler::CanAnswer(CPDFSDK_Annot* pAnnot) {
return true;
CPDF_Page* pPage = pWidget->GetPDFPage();
- uint32_t dwPermissions = pPage->m_pDocument->GetUserPermissions();
+ uint32_t dwPermissions = pPage->GetDocument()->GetUserPermissions();
return (dwPermissions & FPDFPERM_FILL_FORM) ||
(dwPermissions & FPDFPERM_ANNOT_FORM);
}
diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp
index 2e11fa8908..6b31de7b37 100644
--- a/fpdfsdk/formfiller/cba_fontmap.cpp
+++ b/fpdfsdk/formfiller/cba_fontmap.cpp
@@ -28,7 +28,7 @@ CBA_FontMap::CBA_FontMap(CPDFSDK_Annot* pAnnot,
m_sAPType("N") {
CPDF_Page* pPage = pAnnot->GetPDFPage();
- m_pDocument = pPage->m_pDocument.Get();
+ m_pDocument = pPage->GetDocument();
m_pAnnotDict = pAnnot->GetPDFAnnot()->GetAnnotDict();
Initialize();
}
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index 6b34ca3ae2..3db7aa9ab9 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -459,7 +459,7 @@ bool CFFL_InteractiveFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget) {
return false;
CPDF_Page* pPage = pWidget->GetPDFPage();
- uint32_t dwPermissions = pPage->m_pDocument->GetUserPermissions();
+ uint32_t dwPermissions = pPage->GetDocument()->GetUserPermissions();
return (dwPermissions & FPDFPERM_FILL_FORM) ||
(dwPermissions & FPDFPERM_ANNOT_FORM) ||
(dwPermissions & FPDFPERM_MODIFY);
diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp
index 0dbad498ce..3aca16334b 100644
--- a/fpdfsdk/fpdf_annot.cpp
+++ b/fpdfsdk/fpdf_annot.cpp
@@ -221,7 +221,7 @@ FPDFPage_CreateAnnot(FPDF_PAGE page, FPDF_ANNOTATION_SUBTYPE subtype) {
return nullptr;
auto pDict = pdfium::MakeUnique<CPDF_Dictionary>(
- pPage->m_pDocument->GetByteStringPool());
+ pPage->GetDocument()->GetByteStringPool());
pDict->SetNewFor<CPDF_Name>("Type", "Annot");
pDict->SetNewFor<CPDF_Name>("Subtype",
CPDF_Annot::AnnotSubtypeToString(
@@ -380,7 +380,7 @@ FPDFAnnot_AppendObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj) {
CPDF_Stream* pStream = FPDFDOC_GetAnnotAP(pAnnot->GetAnnotDict(),
CPDF_Annot::AppearanceMode::Normal);
if (!pStream) {
- CPVT_GenerateAP::GenerateEmptyAP(pPage->m_pDocument.Get(), pAnnotDict);
+ CPVT_GenerateAP::GenerateEmptyAP(pPage->GetDocument(), pAnnotDict);
pStream =
FPDFDOC_GetAnnotAP(pAnnotDict, CPDF_Annot::AppearanceMode::Normal);
if (!pStream)
@@ -873,7 +873,7 @@ FPDFAnnot_GetFormFieldFlags(FPDF_PAGE page, FPDF_ANNOTATION annot) {
if (!pAnnotDict)
return FPDF_FORMFLAG_NONE;
- CPDF_InterForm interform(pPage->m_pDocument.Get());
+ CPDF_InterForm interform(pPage->GetDocument());
CPDF_FormField* pFormField = interform.GetFieldByDict(pAnnotDict);
return pFormField ? pFormField->GetFieldFlags() : FPDF_FORMFLAG_NONE;
}
@@ -887,7 +887,7 @@ FPDFAnnot_GetFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
if (!hHandle || !pPage)
return nullptr;
- CPDF_InterForm interform(pPage->m_pDocument.Get());
+ CPDF_InterForm interform(pPage->GetDocument());
int annot_index = -1;
CPDF_FormControl* pFormCtrl = interform.GetControlAtPoint(
pPage, CFX_PointF(static_cast<float>(page_x), static_cast<float>(page_y)),
diff --git a/fpdfsdk/fpdf_doc.cpp b/fpdfsdk/fpdf_doc.cpp
index 17cfce0b24..3e8f436f2f 100644
--- a/fpdfsdk/fpdf_doc.cpp
+++ b/fpdfsdk/fpdf_doc.cpp
@@ -54,7 +54,7 @@ CPDF_LinkList* GetLinkList(CPDF_Page* page) {
if (!page)
return nullptr;
- CPDF_Document* pDoc = page->m_pDocument.Get();
+ CPDF_Document* pDoc = page->GetDocument();
std::unique_ptr<CPDF_LinkList>* pHolder = pDoc->LinksContext();
if (!pHolder->get())
*pHolder = pdfium::MakeUnique<CPDF_LinkList>();
diff --git a/fpdfsdk/fpdf_editimg.cpp b/fpdfsdk/fpdf_editimg.cpp
index 9485a75002..fed1581e2d 100644
--- a/fpdfsdk/fpdf_editimg.cpp
+++ b/fpdfsdk/fpdf_editimg.cpp
@@ -305,12 +305,12 @@ FPDFImageObj_GetImageMetadata(FPDF_PAGEOBJECT image_object,
metadata->colorspace = FPDF_COLORSPACE_UNKNOWN;
CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
- if (!pPage || !pPage->m_pDocument.Get() || !pImg->GetStream())
+ if (!pPage || !pPage->GetDocument() || !pImg->GetStream())
return true;
auto pSource = pdfium::MakeRetain<CPDF_DIBSource>();
CPDF_DIBSource::LoadState ret = pSource->StartLoadDIBSource(
- pPage->m_pDocument.Get(), pImg->GetStream(), false, nullptr,
+ pPage->GetDocument(), pImg->GetStream(), false, nullptr,
pPage->m_pPageResources.Get());
if (ret == CPDF_DIBSource::LoadState::kFail)
return true;
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp
index f1d95c7d7e..b8c3f2c146 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -239,7 +239,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
if (!page)
return FLATTEN_FAIL;
- CPDF_Document* pDocument = pPage->m_pDocument.Get();
+ CPDF_Document* pDocument = pPage->GetDocument();
CPDF_Dictionary* pPageDict = pPage->m_pFormDict.Get();
if (!pDocument || !pPageDict)
return FLATTEN_FAIL;
diff --git a/fpdfsdk/fpdf_formfill.cpp b/fpdfsdk/fpdf_formfill.cpp
index c92fc7b718..d604bd0eb0 100644
--- a/fpdfsdk/fpdf_formfill.cpp
+++ b/fpdfsdk/fpdf_formfill.cpp
@@ -184,7 +184,7 @@ void FFLCommon(FPDF_FORMHANDLE hHandle,
pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options, rect);
#else // PDF_ENABLE_XFA
options.SetOCContext(pdfium::MakeRetain<CPDF_OCContext>(
- pPage->m_pDocument.Get(), CPDF_OCContext::View));
+ pPage->GetDocument(), CPDF_OCContext::View));
if (CPDFSDK_PageView* pPageView =
FormHandleToPageView(hHandle, FPDFPageFromUnderlying(pPage)))
pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options);
@@ -207,7 +207,7 @@ FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
return -1;
CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
if (pPage) {
- CPDF_InterForm interform(pPage->m_pDocument.Get());
+ CPDF_InterForm interform(pPage->GetDocument());
CPDF_FormControl* pFormCtrl = interform.GetControlAtPoint(
pPage,
CFX_PointF(static_cast<float>(page_x), static_cast<float>(page_y)),
@@ -269,7 +269,7 @@ FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle,
CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
if (!pPage)
return -1;
- CPDF_InterForm interform(pPage->m_pDocument.Get());
+ CPDF_InterForm interform(pPage->GetDocument());
int z_order = -1;
(void)interform.GetControlAtPoint(
pPage, CFX_PointF(static_cast<float>(page_x), static_cast<float>(page_y)),
diff --git a/fpdfsdk/fpdf_structtree.cpp b/fpdfsdk/fpdf_structtree.cpp
index 027695e36d..99fc302490 100644
--- a/fpdfsdk/fpdf_structtree.cpp
+++ b/fpdfsdk/fpdf_structtree.cpp
@@ -37,8 +37,7 @@ FPDF_StructTree_GetForPage(FPDF_PAGE page) {
// Caller takes onwership.
return FPDFStructTreeFromCPDFStructTree(
- CPDF_StructTree::LoadPage(pPage->m_pDocument.Get(),
- pPage->m_pFormDict.Get())
+ CPDF_StructTree::LoadPage(pPage->GetDocument(), pPage->m_pFormDict.Get())
.release());
}
diff --git a/fpdfsdk/fpdf_text.cpp b/fpdfsdk/fpdf_text.cpp
index edca0669ab..a1bbbb4a7a 100644
--- a/fpdfsdk/fpdf_text.cpp
+++ b/fpdfsdk/fpdf_text.cpp
@@ -45,7 +45,7 @@ FPDF_EXPORT FPDF_TEXTPAGE FPDF_CALLCONV FPDFText_LoadPage(FPDF_PAGE page) {
auto* pContext = static_cast<CPDFXFA_Context*>(pPage->GetDocumentExtension());
CPDF_ViewerPreferences viewRef(pContext->GetPDFDoc());
#else // PDF_ENABLE_XFA
- CPDF_ViewerPreferences viewRef(pPDFPage->m_pDocument.Get());
+ CPDF_ViewerPreferences viewRef(pPDFPage->GetDocument());
#endif // PDF_ENABLE_XFA
CPDF_TextPage* textpage = new CPDF_TextPage(
diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp
index 6706a18354..5d4199c69c 100644
--- a/fpdfsdk/fpdf_transformpage.cpp
+++ b/fpdfsdk/fpdf_transformpage.cpp
@@ -126,7 +126,7 @@ FPDFPage_TransFormWithClip(FPDF_PAGE page,
if (!pContentObj)
return false;
- CPDF_Document* pDoc = pPage->m_pDocument.Get();
+ CPDF_Document* pDoc = pPage->GetDocument();
if (!pDoc)
return false;
@@ -284,7 +284,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFPage_InsertClipPath(FPDF_PAGE page,
strClip << "W* n\n";
}
}
- CPDF_Document* pDoc = pPage->m_pDocument.Get();
+ CPDF_Document* pDoc = pPage->GetDocument();
if (!pDoc)
return;
diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp
index f4a761000b..919690f9eb 100644
--- a/fpdfsdk/fpdf_view.cpp
+++ b/fpdfsdk/fpdf_view.cpp
@@ -111,7 +111,7 @@ void RenderPageImpl(CPDF_PageRenderContext* pContext,
const CPDF_OCContext::UsageType usage =
(flags & FPDF_PRINTING) ? CPDF_OCContext::Print : CPDF_OCContext::View;
pContext->m_pOptions->SetOCContext(
- pdfium::MakeRetain<CPDF_OCContext>(pPage->m_pDocument.Get(), usage));
+ pdfium::MakeRetain<CPDF_OCContext>(pPage->GetDocument(), usage));
pContext->m_pDevice->SaveState();
pContext->m_pDevice->SetClip_Rect(clipping_rect);