summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page
diff options
context:
space:
mode:
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();