Remove a few unused variables, functions, and member variables.
authorNico Weber <thakis@chromium.org>
Thu, 31 Jul 2014 02:00:31 +0000 (19:00 -0700)
committerNico Weber <thakis@chromium.org>
Thu, 31 Jul 2014 02:00:31 +0000 (19:00 -0700)
No intended behavior change.

BUG=pdfium:29
R=bo_xu@foxitsoftware.com

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

13 files changed:
core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
core/src/fpdfdoc/doc_vt.cpp
core/src/fxcodec/codec/fx_codec_jpeg.cpp
core/src/fxge/ge/fx_ge_fontmap.cpp
fpdfsdk/include/formfiller/FFL_Notify.h
fpdfsdk/include/formfiller/FFL_TextField.h
fpdfsdk/include/javascript/app.h
fpdfsdk/include/pdfwindow/PWL_Note.h
fpdfsdk/src/formfiller/FFL_Notify.cpp
fpdfsdk/src/formfiller/FFL_TextField.cpp
fpdfsdk/src/javascript/PublicMethods.cpp
fpdfsdk/src/javascript/app.cpp
fpdfsdk/src/pdfwindow/PWL_Note.cpp

index 2dd2911..19786f7 100644 (file)
@@ -1053,26 +1053,6 @@ CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert)
     pFontDict->SetAtReference("FontDescriptor", this, pFontDesc);
     return LoadFont(pBaseDict);
 }
-static CPDF_Stream* GetFormStream(CPDF_Document* pDoc, CPDF_Object* pResObj)
-{
-    if (pResObj->GetType() != PDFOBJ_REFERENCE) {
-        return NULL;
-    }
-    CPDF_Reference* pRef = (CPDF_Reference*)pResObj;
-    FX_BOOL bForm;
-    if (pDoc->IsFormStream(pRef->GetRefObjNum(), bForm) && !bForm) {
-        return NULL;
-    }
-    pResObj = pRef->GetDirect();
-    if (pResObj->GetType() != PDFOBJ_STREAM) {
-        return NULL;
-    }
-    CPDF_Stream* pXObject = (CPDF_Stream*)pResObj;
-    if (pXObject->GetDict()->GetString(FX_BSTRC("Subtype")) != FX_BSTRC("Form")) {
-        return NULL;
-    }
-    return pXObject;
-}
 static int InsertDeletePDFPage(CPDF_Document* pDoc, CPDF_Dictionary* pPages,
                                int nPagesToGo, CPDF_Dictionary* pPage, FX_BOOL bInsert, CFX_PtrArray& stackList)
 {
index 09fa2bf..f3b9bbb 100644 (file)
@@ -1741,7 +1741,7 @@ FX_BOOL   CPDF_VariableText_Iterator::NextLine()
 FX_BOOL        CPDF_VariableText_Iterator::PrevLine()
 {
     ASSERT(m_pVT != NULL);
-    if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
+    if (m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
         if (m_CurPos.nLineIndex > 0) {
             m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex, m_CurPos.nLineIndex - 1, -1);
             return TRUE;
@@ -1779,7 +1779,7 @@ FX_BOOL   CPDF_VariableText_Iterator::GetWord(CPVT_Word & word) const
     ASSERT(m_pVT != NULL);
     word.WordPlace = m_CurPos;
     if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
-        if (CLine * pLine = pSection->m_LineArray.GetAt(m_CurPos.nLineIndex)) {
+        if (pSection->m_LineArray.GetAt(m_CurPos.nLineIndex)) {
             if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(m_CurPos.nWordIndex)) {
                 word.Word = pWord->Word;
                 word.nCharset = pWord->nCharset;
index ac4be23..489f099 100644 (file)
@@ -73,15 +73,6 @@ extern "C" {
 #define        JPEG_MARKER_AUTHORTIME  (JPEG_APP0 + 3)
 #define        JPEG_MARKER_MAXSIZE     0xFFFF
 #define        JPEG_OVERHEAD_LEN       14
-static FX_BOOL _JpegIsIccMarker(jpeg_saved_marker_ptr marker)
-{
-    if (marker->marker == JPEG_MARKER_ICC &&
-            marker->data_length >= JPEG_OVERHEAD_LEN &&
-            (FXSYS_memcmp32(marker->data, "\x49\x43\x43\x5f\x50\x52\x4f\x46\x49\x4c\x45\x00", 12) == 0)) {
-        return TRUE;
-    }
-    return FALSE;
-}
 static FX_BOOL _JpegEmbedIccProfile(j_compress_ptr cinfo, FX_LPCBYTE icc_buf_ptr, FX_DWORD icc_length)
 {
     if(icc_buf_ptr == NULL || icc_length == 0) {
index 4c99765..a5fa644 100644 (file)
@@ -534,15 +534,6 @@ static CFX_ByteString _FPDF_ReadStringFromFile(FXSYS_FILE* pFile, FX_DWORD size)
     buffer.ReleaseBuffer(size);
     return buffer;
 }
-static CFX_ByteString _FPDF_ReadStringFromStreamFile(IFX_FileStream* pFile, FX_DWORD size)
-{
-    CFX_ByteString buffer;
-    if (!pFile->ReadBlock(buffer.GetBuffer(size), size)) {
-        return CFX_ByteString();
-    }
-    buffer.ReleaseBuffer(size);
-    return buffer;
-}
 CFX_ByteString _FPDF_LoadTableFromTT(FXSYS_FILE* pFile, FX_LPCBYTE pTables, FX_DWORD nTables, FX_DWORD tag)
 {
     for (FX_DWORD i = 0; i < nTables; i ++) {
index c729b74..cabc1aa 100644 (file)
@@ -45,7 +45,6 @@ private:
        FX_BOOL                                                                 ExecuteActionTree(CPDF_AAction::AActionType eAAT, CPDF_Action & action, FX_BOOL& bExit);
        FX_BOOL                                                                 ExecuteAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action,FX_BOOL& bExit);
 
-       CFFL_FormFiller *                                               m_pFormFiller;
        FX_BOOL                                                                 m_bDoActioning;
        FX_INT32                                                                m_nNotifyFlag;
 };
index d2808e9..3a5fd68 100644 (file)
@@ -25,9 +25,6 @@ public:
        virtual void                                    Redo();
        virtual CFX_WideString                  GetDescr();
        virtual void                                    Release();
-       
-private:
-       CPWL_Edit*                                              m_pEdit;
 };
 
 struct FFL_TextFieldState
index 6273a7d..671b358 100644 (file)
@@ -167,7 +167,6 @@ public:
 private:
 
        bool                                            m_bCalculate;   
-       CJS_Runtime*                            m_pRuntime;
        bool                                            m_bRuntimeHighLight;
 
        CFX_ArrayTemplate<CJS_Timer*>   m_aTimer;
index 7cc9e04..b3f7358 100644 (file)
@@ -347,7 +347,6 @@ private:
        CPDF_Rect                                                       m_rcCaption;
        FX_BOOL                                                         m_bEnalbleNotify;
        IPopup_Note*                                            m_pPopupNote;
-       IPWL_NoteHandler*                                       m_pNoteHandler;
        CFX_WideString                                          m_sReplyString;
 };
 
index f6a2feb..73ab5db 100644 (file)
 //#pragma warning(disable: 4800)
 
 CFFL_Notify::CFFL_Notify(CFFL_FormFiller * pFormFiller) : 
-       m_pFormFiller(pFormFiller),
        m_bDoActioning(FALSE),
        m_nNotifyFlag(0)
 {
-       ASSERT(m_pFormFiller != NULL);
+       ASSERT(pFormFiller != NULL);
 }
 
 CFFL_Notify::~CFFL_Notify()
index 8cd62fa..45c7162 100644 (file)
@@ -10,7 +10,7 @@
 #include "../../include/formfiller/FFL_CBA_Fontmap.h"
 //#include "../include/FFL_Notify.h"
 
-CFFL_EditUndoItem::CFFL_EditUndoItem(CPWL_Edit* pEdit) : m_pEdit(pEdit)
+CFFL_EditUndoItem::CFFL_EditUndoItem(CPWL_Edit* pEdit)
 {
 }
 
index e307f43..1bd980a 100644 (file)
@@ -1074,7 +1074,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(OBJ_METHOD_PARAMS)
        int iDec = params[0];
        int iSepStyle = params[1];
        int iNegStyle = params[2];
-       int icurrStyle = params[3]; //it's no use!
+       // params[3] is iCurrStyle, it's not used.
        std::wstring wstrCurrency(params[4].operator CFX_WideString());
        FX_BOOL bCurrencyPrepend = params[5];
        
index 0546be8..c9a9ef7 100644 (file)
@@ -120,7 +120,6 @@ IMPLEMENT_JS_CLASS(CJS_App,app)
 
 app::app(CJS_Object * pJSObject) : CJS_EmbedObj(pJSObject) ,
        m_bCalculate(true),
-       m_pRuntime(NULL),
        m_bRuntimeHighLight(false)
 //     m_pMenuHead(NULL)
 {
index 5929a35..b04b0f5 100644 (file)
@@ -1213,8 +1213,7 @@ CPWL_Note::CPWL_Note(IPopup_Note* pPopupNote, IPWL_NoteNotify* pNoteNotify, IPWL
        m_rcCaption(0,0,0,0),
        m_pNoteNotify(pNoteNotify),
        m_bEnalbleNotify(TRUE),
-       m_pPopupNote(pPopupNote),
-       m_pNoteHandler(pNoteHandler)
+       m_pPopupNote(pPopupNote)
 {
 }