Kill unused IPDF_ classes.
authorTom Sepez <tsepez@chromium.org>
Wed, 3 Jun 2015 23:09:12 +0000 (16:09 -0700)
committerTom Sepez <tsepez@chromium.org>
Wed, 3 Jun 2015 23:09:12 +0000 (16:09 -0700)
Some are simply never defined.  Some are never instantiated.  Some have
paths that are never reached.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1168503003

core/include/fpdfapi/fpdf_module.h
core/include/fpdfapi/fpdf_parser.h
core/include/fpdfapi/fpdf_render.h
core/include/fpdfdoc/fpdf_tagged.h
core/include/fpdftext/fpdf_text.h
core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp
core/src/fpdfapi/fpdf_render/fpdf_render.cpp

index 6317cd0..5be2b19 100644 (file)
@@ -9,20 +9,38 @@
 
 #include "../fxcrt/fx_ext.h"
 
+class CCodec_ModuleMgr;
+class CFX_AffineMatrix;
+class CFX_BitmapDevice;
+class CFX_DIBSource;
+class CPDF_ColorSpace;
+class CPDF_Dictionary;
+class CPDF_DocPageData;
+class CPDF_DocRenderData;
+class CPDF_Document;
+class CPDF_FontGlobals;
+class CPDF_Image;
 class CPDF_ModuleMgr;
+class CPDF_Page;
 class CPDF_PageModuleDef;
+class CPDF_PageObjects;
+class CPDF_PageRenderCache;
+class CPDF_RenderConfig;
 class CPDF_RenderModuleDef;
+class CPDF_RenderOptions;
 class CPDF_SecurityHandler;
-class CCodec_ModuleMgr;
-class CPDF_Dictionary;
-class ICodec_JpegModule;
-class ICodec_JpxModule;
+class CPDF_Stream;
 class ICodec_FaxModule;
-class ICodec_Jbig2Module;
-class ICodec_IccModule;
 class ICodec_FlateModule;
+class ICodec_IccModule;
+class ICodec_Jbig2Module;
+class ICodec_JpegModule;
+class ICodec_JpxModule;
+class IPDF_FontMapper;
+
 #define ADDIN_NAME_CJK                 "Eastern Asian Language Support"
 #define ADDIN_NAME_DECODER             "JPEG2000 and JBIG2 Image Decoders"
+
 class CPDF_ModuleMgr 
 {
 public:
@@ -117,12 +135,6 @@ protected:
 
     CFX_PrivateData                    m_privateData;
 };
-class CPDF_Document;
-class CPDF_DocPageData;
-class CPDF_FontGlobals;
-class IPDF_FontMgr;
-class IPDF_FontMapper;
-class CPDF_ColorSpace;
 class CPDF_PageModuleDef 
 {
 public:
@@ -150,17 +162,6 @@ public:
         return NULL;
     }
 };
-class CPDF_PageObjects;
-class CFX_AffineMatrix;
-class CPDF_RenderOptions;
-class CPDF_Page;
-class CPDF_DocRenderData;
-class CPDF_PageRenderCache;
-class CFX_BitmapDevice;
-class CPDF_Stream;
-class CFX_DIBSource;
-class CPDF_RenderConfig;
-class CPDF_Image;
 class CPDF_RenderModuleDef 
 {
 public:
index 34568e7..d18d362 100644 (file)
@@ -51,12 +51,6 @@ class CFX_PrivateData;
 //   'R' - otherwise.
 extern const char PDF_CharType[256];
 
-class IPDF_EnumPageHandler
-{
-public:
-    virtual ~IPDF_EnumPageHandler() { }
-    virtual FX_BOOL EnumPage(CPDF_Dictionary* pPageDict) = 0;
-};
 class CPDF_Document : public CFX_PrivateData, public CPDF_IndirectObjects
 {
 public:
@@ -92,8 +86,6 @@ public:
 
     int                                                GetPageIndex(FX_DWORD objnum);
 
-    void                                       EnumPages(IPDF_EnumPageHandler* pHandler);
-
     FX_DWORD                           GetUserPermissions(FX_BOOL bCheckRevision = FALSE) const;
 
     FX_BOOL                                    IsOwner() const;
index 714fffb..47d1b19 100644 (file)
@@ -96,8 +96,6 @@ public:
 
     void                       AppendObjectList(CPDF_PageObjects* pObjs, const CFX_AffineMatrix* pObject2Device);
 
-    void                       SetBackground(class IPDF_BackgroundDraw* pBackground);
-
     void                       Render(CFX_RenderDevice* pDevice, const CPDF_RenderOptions* pOptions = NULL,
                            const CFX_AffineMatrix* pFinalMatrix = NULL);
 
@@ -124,8 +122,6 @@ protected:
 
     CFX_ArrayTemplate<struct _PDF_RenderItem>  m_ContentList;
 
-    IPDF_BackgroundDraw*       m_pBackgroundDraw;
-
     FX_BOOL                                    m_bFirstLayer;
 
     void                       Render(CFX_RenderDevice* pDevice, const CPDF_PageObject* pStopObj,
@@ -133,15 +129,6 @@ protected:
     friend class CPDF_RenderStatus;
     friend class CPDF_ProgressiveRenderer;
 };
-class IPDF_BackgroundDraw
-{
-public:
-    virtual ~IPDF_BackgroundDraw() { }
-    virtual    void    OnDrawBackground(
-        CFX_RenderDevice* pBitmapDevice,
-        const CFX_AffineMatrix* pOriginal2Bitmap
-    ) = 0;
-};
 class CPDF_ProgressiveRenderer 
 {
 public:
@@ -234,19 +221,6 @@ public:
                                   CPDF_Font* pFont, FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device,
                                   FX_ARGB fill_argb);
 };
-class IPDF_PageImageCache
-{
-public:
-
-    static IPDF_PageImageCache* Create();
-
-    virtual ~IPDF_PageImageCache() {}
-
-    virtual void               OutputPage(CFX_RenderDevice* pDevice, CPDF_Page* pPage,
-                                   int pos_x, int pos_y, int size_x, int size_y, int rotate) = 0;
-
-    virtual void               SetCacheLimit(FX_DWORD limit) = 0;
-};
 class CPDF_PageRenderCache 
 {
 public:
index 2c40ac1..4943ad0 100644 (file)
@@ -7,13 +7,13 @@
 #ifndef CORE_INCLUDE_FPDFDOC_FPDF_TAGGED_H_
 #define CORE_INCLUDE_FPDFDOC_FPDF_TAGGED_H_
 
-class CPDF_StructTree;
-class CPDF_StructElement;
-struct CPDF_StructKid;
 class CPDF_Document;
 class CPDF_Page;
-class IPDF_ReflowEngine;
+class CPDF_StructElement;
+class CPDF_StructTree;
 class IPDF_ReflowedPage;
+struct CPDF_StructKid;
+
 class CPDF_StructTree 
 {
 public:
index 936e0f1..d18a769 100644 (file)
 #include "../fpdfapi/fpdf_parser.h"
 
 class CPDF_PageObjects;
+class IPDF_LinkExtract;
+class IPDF_ReflowedPage;
+class IPDF_TextPage;
+class IPDF_TextPageFind;
+
 #define PDF2TXT_AUTO_ROTATE            1
 #define PDF2TXT_AUTO_WIDTH             2
 #define PDF2TXT_KEEP_COLUMN            4
@@ -24,9 +29,6 @@ void PDF_GetPageText_Unicode(CFX_WideStringArray& lines, CPDF_Document* pDoc, CP
 void PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_Document* pDoc, CPDF_Dictionary* pPage,
                                FX_DWORD flags);
 CFX_WideString PDF_GetFirstTextLine_Unicode(CPDF_Document* pDoc, CPDF_Dictionary* pPage);
-class IPDF_TextPage;
-class IPDF_LinkExtract;
-class IPDF_TextPageFind;
 #define CHAR_ERROR                     -1
 #define CHAR_NORMAL                    0
 #define CHAR_GENERATED         1
@@ -50,7 +52,6 @@ typedef       CFX_ArrayTemplate<CFX_FloatRect> CFX_RectArray;
 #define FPDFTEXT_RIGHT                 1
 #define FPDFTEXT_UP                            -2
 #define FPDFTEXT_DOWN                  2
-class IPDF_ReflowedPage;
 #define FPDFTEXT_WRITINGMODE_UNKNOW    0
 #define FPDFTEXT_WRITINGMODE_LRTB      1
 #define FPDFTEXT_WRITINGMODE_RLTB      2
index fb43c64..b11c7ee 100644 (file)
@@ -297,39 +297,6 @@ int CPDF_Document::_GetPageCount() const
     }
     return _CountPages(pPages, 0);
 }
-static FX_BOOL _EnumPages(CPDF_Dictionary* pPages, IPDF_EnumPageHandler* pHandler)
-{
-    CPDF_Array* pKidList = pPages->GetArray(FX_BSTRC("Kids"));
-    if (pKidList == NULL) {
-        return pHandler->EnumPage(pPages);
-    }
-    for (FX_DWORD i = 0; i < pKidList->GetCount(); i ++) {
-        CPDF_Dictionary* pKid = pKidList->GetDict(i);
-        if (pKid == NULL) {
-            continue;
-        }
-        if (!pKid->KeyExist(FX_BSTRC("Kids"))) {
-            if (!pHandler->EnumPage(pKid)) {
-                return FALSE;
-            }
-        } else {
-            return _EnumPages(pKid, pHandler);
-        }
-    }
-    return TRUE;
-}
-void CPDF_Document::EnumPages(IPDF_EnumPageHandler* pHandler)
-{
-    CPDF_Dictionary* pRoot = GetRoot();
-    if (pRoot == NULL) {
-        return;
-    }
-    CPDF_Dictionary* pPages = pRoot->GetDict(FX_BSTRC("Pages"));
-    if (pPages == NULL) {
-        return;
-    }
-    _EnumPages(pPages, pHandler);
-}
 FX_BOOL CPDF_Document::IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* pThisPageDict)
 {
     for (int i = 0; i < m_PageList.GetSize(); i ++) {
index f8c4a41..a921252 100644 (file)
@@ -915,12 +915,9 @@ void CPDF_RenderContext::GetBackground(CFX_DIBitmap* pBuffer, const CPDF_PageObj
 {
     CFX_FxgeDevice device;
     device.Attach(pBuffer);
-    if (m_pBackgroundDraw) {
-        m_pBackgroundDraw->OnDrawBackground(&device, pFinalMatrix);
-    } else {
-        FX_RECT rect(0, 0, device.GetWidth(), device.GetHeight());
-        device.FillRect(&rect, 0xffffffff);
-    }
+
+    FX_RECT rect(0, 0, device.GetWidth(), device.GetHeight());
+    device.FillRect(&rect, 0xffffffff);
     Render(&device, pObj, pOptions, pFinalMatrix);
 }
 CPDF_GraphicStates* CPDF_RenderStatus::CloneObjStates(const CPDF_GraphicStates* pSrcStates, FX_BOOL bStroke)
@@ -946,7 +943,6 @@ CPDF_RenderContext::CPDF_RenderContext()
 void CPDF_RenderContext::Create(CPDF_Document* pDoc, CPDF_PageRenderCache* pPageCache,
                                 CPDF_Dictionary* pPageResources, FX_BOOL bFirstLayer)
 {
-    m_pBackgroundDraw = NULL;
     m_pDocument = pDoc;
     m_pPageResources = pPageResources;
     m_pPageCache = pPageCache;
@@ -954,7 +950,6 @@ void CPDF_RenderContext::Create(CPDF_Document* pDoc, CPDF_PageRenderCache* pPage
 }
 void CPDF_RenderContext::Create(CPDF_Page* pPage, FX_BOOL bFirstLayer)
 {
-    m_pBackgroundDraw = NULL;
     m_pDocument = pPage->m_pDocument;
     m_pPageResources = pPage->m_pPageResources;
     m_pPageCache = pPage->GetRenderCache();
@@ -968,7 +963,6 @@ void CPDF_RenderContext::Clear()
     m_pDocument = NULL;
     m_pPageResources = NULL;
     m_pPageCache = NULL;
-    m_pBackgroundDraw = NULL;
     m_bFirstLayer = TRUE;
     m_ContentList.RemoveAll();
 }