Cleanup: Make CPDF_Annot::m_pAnnotDict private.
[pdfium.git] / fpdfsdk / src / fsdk_mgr.cpp
index efb21a7..7ac370e 100644 (file)
@@ -4,9 +4,9 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+#include "../../public/fpdf_ext.h"
 #include "../include/fsdk_define.h"
 #include "../include/fsdk_mgr.h"
-#include "../include/fpdf_ext.h"
 #include "../include/formfiller/FFL_FormFiller.h"
 #include "../include/javascript/IJavaScript.h"
 
@@ -424,30 +424,32 @@ void CPDFSDK_Document:: ProcJavascriptFun()
 
 FX_BOOL CPDFSDK_Document::ProcOpenAction()
 {
-       if(!m_pDoc) return FALSE;
-       
-       CPDF_Dictionary* pRoot = m_pDoc->GetRoot();     
-       if (!pRoot)     return FALSE;
-       CPDF_Object* pOpenAction = pRoot->GetDict("OpenAction");//
-       if(!pOpenAction) pOpenAction = pRoot->GetArray("OpenAction");//
-       if(!pOpenAction) return FALSE;
-       
+       if(!m_pDoc)
+               return FALSE;
+
+       CPDF_Dictionary* pRoot = m_pDoc->GetRoot();
+       if (!pRoot)
+               return FALSE;
+
+       CPDF_Object* pOpenAction = pRoot->GetDict("OpenAction");
+       if(!pOpenAction)
+               pOpenAction = pRoot->GetArray("OpenAction");
+
+       if(!pOpenAction)
+               return FALSE;
+
        if(pOpenAction->GetType()==PDFOBJ_ARRAY)
-       {       
-       }
-       else if(pOpenAction->GetType()==PDFOBJ_DICTIONARY)
-       {       
-               CPDF_Dictionary * pDict=(CPDF_Dictionary*)pOpenAction;  
-               CPDF_Action Action = pDict;
-               
-               if(m_pEnv->GetActionHander())
-                       m_pEnv->GetActionHander()->DoAction_DocOpen(Action,this);               
-       }       
-       else
+               return TRUE;
+
+       if(pOpenAction->GetType()==PDFOBJ_DICTIONARY)
        {
-               return FALSE;                   
-       }       
-       return TRUE;
+               CPDF_Dictionary * pDict=(CPDF_Dictionary*)pOpenAction;
+               CPDF_Action action(pDict);
+               if(m_pEnv->GetActionHander())
+                       m_pEnv->GetActionHander()->DoAction_DocOpen(action, this);
+               return TRUE;
+       }
+       return FALSE;
 }
 
 CPDF_OCContext*        CPDFSDK_Document::GetOCContext()
@@ -749,7 +751,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetFXWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pag
 
 FX_BOOL CPDFSDK_PageView::Annot_HasAppearance(CPDF_Annot* pAnnot)
 {
-       CPDF_Dictionary* pAnnotDic = pAnnot->m_pAnnotDict;
+       CPDF_Dictionary* pAnnotDic = pAnnot->GetAnnotDict();
        if(pAnnotDic)
                return  pAnnotDic->KeyExist("AS");
        return FALSE;
@@ -829,7 +831,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetAnnotByDict(CPDF_Dictionary * pDict)
        for(int i=0; i<nCount; i++)
        {
                CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i);
-               if(pDict==pAnnot->GetPDFAnnot()->m_pAnnotDict) 
+               if (pDict == pAnnot->GetPDFAnnot()->GetAnnotDict())
                        return pAnnot;
        }
        return NULL;