Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: fpdfsdk/cpdfsdk_pageview.cpp

Issue 2410893002: Merge CPDFSDK_Document into CPDFSDK_FormFillEnvironment (Closed)
Patch Set: Rebase to master Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: fpdfsdk/cpdfsdk_pageview.cpp
diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp
index a5c60d6f68503da2c24737e2437691b4d064848f..348f2d1fabe6709d81ba4693447125a056fddb5f 100644
--- a/fpdfsdk/cpdfsdk_pageview.cpp
+++ b/fpdfsdk/cpdfsdk_pageview.cpp
@@ -42,8 +42,7 @@ CPDFSDK_PageView::CPDFSDK_PageView(CPDFSDK_FormFillEnvironment* pFormFillEnv,
m_bValid(FALSE),
m_bLocked(FALSE),
m_bBeingDestroyed(false) {
- CPDFSDK_InterForm* pInterForm =
- pFormFillEnv->GetSDKDocument()->GetInterForm();
+ CPDFSDK_InterForm* pInterForm = pFormFillEnv->GetInterForm();
if (pInterForm) {
CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
#ifdef PDF_ENABLE_XFA
@@ -197,7 +196,7 @@ FX_BOOL CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot) {
return FALSE;
if (GetFocusAnnot() == pAnnot)
- m_pFormFillEnv->GetSDKDocument()->KillFocusAnnot(0);
+ m_pFormFillEnv->KillFocusAnnot(0);
CPDFSDK_AnnotHandlerMgr* pAnnotHandler = m_pFormFillEnv->GetAnnotHandlerMgr();
if (pAnnotHandler)
pAnnotHandler->ReleaseAnnot(pAnnot);
@@ -256,7 +255,7 @@ FX_BOOL CPDFSDK_PageView::OnLButtonDown(const CFX_FloatPoint& point,
uint32_t nFlag) {
CPDFSDK_Annot::ObservedPtr pAnnot(GetFXWidgetAtPoint(point.x, point.y));
if (!pAnnot) {
- m_pFormFillEnv->GetSDKDocument()->KillFocusAnnot(nFlag);
+ m_pFormFillEnv->KillFocusAnnot(nFlag);
return FALSE;
}
@@ -268,7 +267,7 @@ FX_BOOL CPDFSDK_PageView::OnLButtonDown(const CFX_FloatPoint& point,
if (!pAnnot)
return FALSE;
- m_pFormFillEnv->GetSDKDocument()->SetFocusAnnot(&pAnnot);
+ m_pFormFillEnv->SetFocusAnnot(&pAnnot);
return TRUE;
}
@@ -287,7 +286,7 @@ FX_BOOL CPDFSDK_PageView::OnRButtonDown(const CFX_FloatPoint& point,
return FALSE;
if (ok)
- m_pFormFillEnv->GetSDKDocument()->SetFocusAnnot(&pAnnot);
+ m_pFormFillEnv->SetFocusAnnot(&pAnnot);
return TRUE;
}
@@ -301,7 +300,7 @@ FX_BOOL CPDFSDK_PageView::OnRButtonUp(const CFX_FloatPoint& point,
return FALSE;
if (pAnnotHandlerMgr->Annot_OnRButtonUp(this, &pFXAnnot, nFlag, point))
- m_pFormFillEnv->GetSDKDocument()->SetFocusAnnot(&pFXAnnot);
+ m_pFormFillEnv->SetFocusAnnot(&pFXAnnot);
return TRUE;
}
@@ -399,8 +398,7 @@ void CPDFSDK_PageView::LoadFXAnnots() {
#ifdef PDF_ENABLE_XFA
CFX_RetainPtr<CPDFXFA_Page> protector(m_page);
- if (m_pFormFillEnv->GetSDKDocument()->GetXFADocument()->GetDocType() ==
- DOCTYPE_DYNAMIC_XFA) {
+ if (m_pFormFillEnv->GetXFADocument()->GetDocType() == DOCTYPE_DYNAMIC_XFA) {
CXFA_FFPageView* pageView = m_page->GetXFAPageView();
std::unique_ptr<IXFA_WidgetIterator> pWidgetHander(
pageView->CreateWidgetIterator(
@@ -498,13 +496,12 @@ bool CPDFSDK_PageView::IsValidSDKAnnot(const CPDFSDK_Annot* p) const {
}
CPDFSDK_Annot* CPDFSDK_PageView::GetFocusAnnot() {
- CPDFSDK_Annot* pFocusAnnot =
- m_pFormFillEnv->GetSDKDocument()->GetFocusAnnot();
+ CPDFSDK_Annot* pFocusAnnot = m_pFormFillEnv->GetFocusAnnot();
return IsValidSDKAnnot(pFocusAnnot) ? pFocusAnnot : nullptr;
}
int CPDFSDK_PageView::GetPageIndexForStaticPDF() const {
CPDF_Dictionary* pDict = GetPDFPage()->m_pFormDict;
- CPDF_Document* pDoc = m_pFormFillEnv->GetSDKDocument()->GetPDFDocument();
+ CPDF_Document* pDoc = m_pFormFillEnv->GetPDFDocument();
return (pDoc && pDict) ? pDoc->GetPageIndex(pDict->GetObjNum()) : -1;
}

Powered by Google App Engine
This is Rietveld 408576698