summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-11-25 14:54:12 -0800
committerTom Sepez <tsepez@chromium.org>2015-11-25 14:54:12 -0800
commit3caa6537663e85ad6874c4420907d2ab885c80ea (patch)
tree0bb377fb6f8d20bcca0e3da0ed5ec07177a6cee9 /fpdfsdk
parentb210651db6a965ad50d726a4bb872580e93d2ae9 (diff)
downloadpdfium-3caa6537663e85ad6874c4420907d2ab885c80ea.tar.xz
master: more underlying types
Precursor to https://codereview.chromium.org/1477583002/ Also: merge where possible. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1481523004 .
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/src/formfiller/FFL_FormFiller.cpp6
-rw-r--r--fpdfsdk/src/formfiller/FFL_TextField.cpp4
-rw-r--r--fpdfsdk/src/fpdfformfill.cpp2
-rw-r--r--fpdfsdk/src/fpdfppo.cpp1
-rw-r--r--fpdfsdk/src/fpdfsave.cpp7
-rw-r--r--fpdfsdk/src/fpdftext.cpp8
-rw-r--r--fpdfsdk/src/fpdfview.cpp16
-rw-r--r--fpdfsdk/src/fsdk_mgr.cpp1
8 files changed, 21 insertions, 24 deletions
diff --git a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
index 0dab3076f4..31e6cd691a 100644
--- a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
+++ b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
@@ -243,7 +243,7 @@ FX_BOOL CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot,
void CFFL_FormFiller::SetFocusForAnnot(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) {
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
- CPDF_Page* pPage = pWidget->GetPDFPage();
+ UnderlyingPageType* pPage = pWidget->GetUnderlyingPage();
CPDFSDK_Document* pDoc = m_pApp->GetSDKDocument();
CPDFSDK_PageView* pPageView = pDoc->GetPageView(pPage);
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE))
@@ -461,7 +461,7 @@ CPDF_Rect CFFL_FormFiller::GetPDFWindowRect() const {
}
CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView() {
- CPDF_Page* pPage = m_pAnnot->GetPDFPage();
+ UnderlyingPageType* pPage = m_pAnnot->GetUnderlyingPage();
CPDFSDK_Document* pSDKDoc = m_pApp->GetSDKDocument();
return pSDKDoc ? pSDKDoc->GetPageView(pPage) : nullptr;
}
@@ -612,7 +612,7 @@ void CFFL_FormFiller::InvalidateRect(double left,
double top,
double right,
double bottom) {
- CPDF_Page* pPage = m_pWidget->GetPDFPage();
+ UnderlyingPageType* pPage = m_pWidget->GetUnderlyingPage();
m_pApp->FFI_Invalidate(pPage, left, top, right, bottom);
}
diff --git a/fpdfsdk/src/formfiller/FFL_TextField.cpp b/fpdfsdk/src/formfiller/FFL_TextField.cpp
index f5cde16813..2dc82a892e 100644
--- a/fpdfsdk/src/formfiller/FFL_TextField.cpp
+++ b/fpdfsdk/src/formfiller/FFL_TextField.cpp
@@ -119,8 +119,8 @@ FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot,
ASSERT(pPageView != NULL);
m_bValid = !m_bValid;
CPDF_Rect rcAnnot = pAnnot->GetRect();
- m_pApp->FFI_Invalidate(pAnnot->GetPDFPage(), rcAnnot.left, rcAnnot.top,
- rcAnnot.right, rcAnnot.bottom);
+ m_pApp->FFI_Invalidate(pAnnot->GetUnderlyingPage(), rcAnnot.left,
+ rcAnnot.top, rcAnnot.right, rcAnnot.bottom);
if (m_bValid) {
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE))
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp
index 525cb152b1..0cc681a0b0 100644
--- a/fpdfsdk/src/fpdfformfill.cpp
+++ b/fpdfsdk/src/fpdfformfill.cpp
@@ -198,7 +198,7 @@ DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle,
if (!hHandle)
return;
- CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
+ UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page);
if (!pPage)
return;
diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp
index d5b3a8be7c..507b97b184 100644
--- a/fpdfsdk/src/fpdfppo.cpp
+++ b/fpdfsdk/src/fpdfppo.cpp
@@ -300,7 +300,6 @@ FX_DWORD CPDF_PageOrganizer::GetNewObjId(CPDF_Document* pDoc,
}
dwNewObjNum = pDoc->AddIndirectObject(pClone);
(*pObjNumberMap)[dwObjnum] = dwNewObjNum;
-
if (!UpdateReference(pClone, pDoc, pObjNumberMap)) {
pClone->Release();
return 0;
diff --git a/fpdfsdk/src/fpdfsave.cpp b/fpdfsdk/src/fpdfsave.cpp
index e4baa47ba4..0573e17ba8 100644
--- a/fpdfsdk/src/fpdfsave.cpp
+++ b/fpdfsdk/src/fpdfsave.cpp
@@ -57,21 +57,22 @@ FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document,
FPDF_DWORD flags,
FPDF_BOOL bSetVersion,
int fileVerion) {
- CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
- if (!pDoc)
+ CPDF_Document* pPDFDoc = CPDFDocumentFromFPDFDocument(document);
+ if (!pPDFDoc)
return 0;
if (flags < FPDF_INCREMENTAL || flags > FPDF_REMOVE_SECURITY) {
flags = 0;
}
- CPDF_Creator FileMaker(pDoc);
+ CPDF_Creator FileMaker(pPDFDoc);
if (bSetVersion)
FileMaker.SetFileVersion(fileVerion);
if (flags == FPDF_REMOVE_SECURITY) {
flags = 0;
FileMaker.RemoveSecurity();
}
+
CFX_IFileWrite* pStreamWrite = NULL;
FX_BOOL bRet;
pStreamWrite = new CFX_IFileWrite;
diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp
index fa215d21f1..c8998aee93 100644
--- a/fpdfsdk/src/fpdftext.cpp
+++ b/fpdfsdk/src/fpdftext.cpp
@@ -15,12 +15,12 @@
#endif
DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) {
- CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
- if (!pPage)
+ CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page);
+ if (!pPDFPage)
return nullptr;
- CPDF_ViewerPreferences viewRef(pPage->m_pDocument);
+ CPDF_ViewerPreferences viewRef(pPDFPage->m_pDocument);
IPDF_TextPage* textpage =
- IPDF_TextPage::CreateTextPage(pPage, viewRef.IsDirectionR2L());
+ IPDF_TextPage::CreateTextPage(pPDFPage, viewRef.IsDirectionR2L());
textpage->ParseTextPage();
return textpage;
}
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index fcb6731563..99a3d90246 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -100,16 +100,14 @@ DLLEXPORT void STDCALL FPDF_InitLibraryWithConfig(
CFX_GEModule::Get()->SetCodecModule(g_pCodecModule);
CPDF_ModuleMgr::Create();
- CPDF_ModuleMgr::Get()->SetCodecModule(g_pCodecModule);
- CPDF_ModuleMgr::Get()->InitPageModule();
- CPDF_ModuleMgr::Get()->InitRenderModule();
CPDF_ModuleMgr* pModuleMgr = CPDF_ModuleMgr::Get();
- if (pModuleMgr) {
- pModuleMgr->LoadEmbeddedGB1CMaps();
- pModuleMgr->LoadEmbeddedJapan1CMaps();
- pModuleMgr->LoadEmbeddedCNS1CMaps();
- pModuleMgr->LoadEmbeddedKorea1CMaps();
- }
+ pModuleMgr->SetCodecModule(g_pCodecModule);
+ pModuleMgr->InitPageModule();
+ pModuleMgr->InitRenderModule();
+ pModuleMgr->LoadEmbeddedGB1CMaps();
+ pModuleMgr->LoadEmbeddedJapan1CMaps();
+ pModuleMgr->LoadEmbeddedCNS1CMaps();
+ pModuleMgr->LoadEmbeddedKorea1CMaps();
if (cfg && cfg->version >= 2)
IJS_Runtime::Initialize(cfg->m_v8EmbedderSlot, cfg->m_pIsolate);
}
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index 480dc4a51f..c85f62df22 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -625,7 +625,6 @@ void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice,
CPDF_Matrix* pUser2Device,
CPDF_RenderOptions* pOptions) {
m_curMatrix = *pUser2Device;
-
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotIterator annotIterator(this, true);
while (CPDFSDK_Annot* pSDKAnnot = annotIterator.Next()) {