summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-06-19 17:17:54 -0700
committerLei Zhang <thestig@chromium.org>2015-06-19 17:17:54 -0700
commitfa6eb28e08d924271d91758f945ce48a1c2dbf0c (patch)
tree6d4e627b18c5ac50cca976709ae5fb2c01b525c6 /core/src/fpdfapi/fpdf_page
parente5b0bd1a79f90b7758246655e18ef965a87bcd0b (diff)
downloadpdfium-fa6eb28e08d924271d91758f945ce48a1c2dbf0c.tar.xz
Merge to XFA: Make CPDF_PageModuleDef and CPDF_RenderModuleDef pure virtual.
Get rid of the dummy implementations, which are never used when the modules have been initialized. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1177383003. (cherry picked from commit 5fef754bc09e971f1bf1ba79da98c0a7ee1e1c8d) Review URL: https://codereview.chromium.org/1189413006.
Diffstat (limited to 'core/src/fpdfapi/fpdf_page')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp25
2 files changed, 17 insertions, 10 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
index 984baedf16..97b28574fc 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
@@ -898,7 +898,7 @@ void CPDF_Page::ParseContent(CPDF_ParseOptions* pOptions, FX_BOOL bReParse)
CPDF_Page::~CPDF_Page()
{
if (m_pPageRender) {
- CPDF_RenderModuleDef* pModule = CPDF_ModuleMgr::Get()->GetRenderModule();
+ IPDF_RenderModule* pModule = CPDF_ModuleMgr::Get()->GetRenderModule();
pModule->DestroyPageCache(m_pPageRender);
}
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
index 49c158c52f..05233a12a4 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
@@ -10,7 +10,7 @@
#include "../fpdf_font/font_int.h"
#include "pageint.h"
-class CPDF_PageModule : public CPDF_PageModuleDef
+class CPDF_PageModule : public IPDF_PageModule
{
public:
CPDF_PageModule()
@@ -26,24 +26,30 @@ private:
{
return new CPDF_DocPageData(pDoc);
}
- virtual void ReleaseDoc(CPDF_Document* pDoc);
- virtual void ClearDoc(CPDF_Document* pDoc);
- virtual CPDF_FontGlobals* GetFontGlobals()
+
+ void ReleaseDoc(CPDF_Document* pDoc) override;
+ void ClearDoc(CPDF_Document* pDoc) override;
+
+ CPDF_FontGlobals* GetFontGlobals() override
{
return &m_FontGlobals;
}
- virtual void ClearStockFont(CPDF_Document* pDoc)
+
+ void ClearStockFont(CPDF_Document* pDoc) override
{
m_FontGlobals.Clear(pDoc);
}
- virtual CPDF_ColorSpace* GetStockCS(int family);
- virtual void NotifyCJKAvailable();
+
+ CPDF_ColorSpace* GetStockCS(int family) override;
+ void NotifyCJKAvailable() override;
+
CPDF_FontGlobals m_FontGlobals;
CPDF_DeviceCS m_StockGrayCS;
CPDF_DeviceCS m_StockRGBCS;
CPDF_DeviceCS m_StockCMYKCS;
CPDF_PatternCS m_StockPatternCS;
};
+
CPDF_ColorSpace* CPDF_PageModule::GetStockCS(int family)
{
if (family == PDFCS_DEVICEGRAY) {
@@ -60,11 +66,12 @@ CPDF_ColorSpace* CPDF_PageModule::GetStockCS(int family)
}
return NULL;
}
+
void CPDF_ModuleMgr::InitPageModule()
{
- delete m_pPageModule;
- m_pPageModule = new CPDF_PageModule;
+ m_pPageModule.reset(new CPDF_PageModule);
}
+
void CPDF_PageModule::ReleaseDoc(CPDF_Document* pDoc)
{
delete pDoc->GetPageData();