diff options
Diffstat (limited to 'fpdfsdk/src')
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/src/fpdf_ext.cpp | 4 | ||||
-rw-r--r-- | fpdfsdk/src/fpdfeditpage.cpp | 4 | ||||
-rw-r--r-- | fpdfsdk/src/fsdk_annothandler.cpp | 8 | ||||
-rw-r--r-- | fpdfsdk/src/fsdk_baseannot.cpp | 171 | ||||
-rw-r--r-- | fpdfsdk/src/fsdk_baseform.cpp | 17 | ||||
-rw-r--r-- | fpdfsdk/src/fsdk_mgr.cpp | 4 |
7 files changed, 60 insertions, 150 deletions
diff --git a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp index ad5a167f9a..41112600de 100644 --- a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp +++ b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp @@ -19,7 +19,7 @@ CBA_FontMap::CBA_FontMap(CPDFSDK_Annot* pAnnot, IFX_SystemHandler* pSystemHandle CPDF_Page* pPage = pAnnot->GetPDFPage(); m_pDocument = pPage->m_pDocument; - m_pAnnotDict = pAnnot->GetPDFAnnot()->m_pAnnotDict; + m_pAnnotDict = pAnnot->GetPDFAnnot()->GetAnnotDict(); } CBA_FontMap::CBA_FontMap(CPDF_Document* pDocument, CPDF_Dictionary* pAnnotDict, diff --git a/fpdfsdk/src/fpdf_ext.cpp b/fpdfsdk/src/fpdf_ext.cpp index 2dc8d78a29..2a2f3ae096 100644 --- a/fpdfsdk/src/fpdf_ext.cpp +++ b/fpdfsdk/src/fpdf_ext.cpp @@ -64,7 +64,7 @@ void CheckUnSupportAnnot(CPDF_Document * pDoc, CPDF_Annot* pPDFAnnot) } else if(cbSubType.Compare("Screen") ==0) { - CPDF_Dictionary* pAnnotDict = pPDFAnnot->m_pAnnotDict; + CPDF_Dictionary* pAnnotDict = pPDFAnnot->GetAnnotDict(); CFX_ByteString cbString; if(pAnnotDict->KeyExist("IT")) cbString = pAnnotDict->GetString("IT"); @@ -89,7 +89,7 @@ void CheckUnSupportAnnot(CPDF_Document * pDoc, CPDF_Annot* pPDFAnnot) } else if(cbSubType.Compare("Widget") ==0) { - CPDF_Dictionary* pAnnotDict = pPDFAnnot->m_pAnnotDict; + CPDF_Dictionary* pAnnotDict = pPDFAnnot->GetAnnotDict(); CFX_ByteString cbString; if(pAnnotDict->KeyExist("FT")) { diff --git a/fpdfsdk/src/fpdfeditpage.cpp b/fpdfsdk/src/fpdfeditpage.cpp index e13c4809cf..375062bf31 100644 --- a/fpdfsdk/src/fpdfeditpage.cpp +++ b/fpdfsdk/src/fpdfeditpage.cpp @@ -292,13 +292,13 @@ DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page, CFX_AffineMatrix matrix((FX_FLOAT)a,(FX_FLOAT)b,(FX_FLOAT)c,(FX_FLOAT)d,(FX_FLOAT)e,(FX_FLOAT)f); rect.Transform(&matrix); CPDF_Array *pRectArray = NULL; - pRectArray = pAnnot->m_pAnnotDict->GetArray("Rect"); + pRectArray = pAnnot->GetAnnotDict()->GetArray("Rect"); if (!pRectArray) pRectArray=CPDF_Array::Create(); pRectArray->SetAt(0, new CPDF_Number(rect.left)); pRectArray->SetAt(1, new CPDF_Number(rect.bottom)); pRectArray->SetAt(2, new CPDF_Number(rect.right)); pRectArray->SetAt(3, new CPDF_Number(rect.top)); - pAnnot->m_pAnnotDict->SetAt("Rect",pRectArray); + pAnnot->GetAnnotDict()->SetAt("Rect",pRectArray); //Transform AP's rectangle //To Do diff --git a/fpdfsdk/src/fsdk_annothandler.cpp b/fpdfsdk/src/fsdk_annothandler.cpp index bc0f047897..2027817497 100644 --- a/fpdfsdk/src/fsdk_annothandler.cpp +++ b/fpdfsdk/src/fsdk_annothandler.cpp @@ -91,12 +91,10 @@ void CPDFSDK_AnnotHandlerMgr::Annot_OnCreate(CPDFSDK_Annot* pAnnot) ASSERT(pAnnot != NULL); CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); - ASSERT(pPDFAnnot != NULL); - ASSERT(pPDFAnnot->m_pAnnotDict != NULL); CPDFSDK_DateTime curTime; - pPDFAnnot->m_pAnnotDict->SetAtString("M", curTime.ToPDFDateTimeString()); - pPDFAnnot->m_pAnnotDict->SetAtNumber("F", (int)0); + pPDFAnnot->GetAnnotDict()->SetAtString("M", curTime.ToPDFDateTimeString()); + pPDFAnnot->GetAnnotDict()->SetAtNumber("F", 0); if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { @@ -402,7 +400,7 @@ CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_Pag ASSERT(pInterForm != NULL); CPDFSDK_Widget* pWidget = NULL; - if (CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl(pInterForm->GetInterForm(), pAnnot->m_pAnnotDict)) + if (CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl(pInterForm->GetInterForm(), pAnnot->GetAnnotDict())) { pWidget = new CPDFSDK_Widget(pAnnot, pPage, pInterForm); pInterForm->AddMap(pCtrl, pWidget); diff --git a/fpdfsdk/src/fsdk_baseannot.cpp b/fpdfsdk/src/fsdk_baseannot.cpp index 2ac6d0d875..6febe6e2e6 100644 --- a/fpdfsdk/src/fsdk_baseannot.cpp +++ b/fpdfsdk/src/fsdk_baseannot.cpp @@ -564,17 +564,15 @@ CPDF_Dictionary* CPDFSDK_Annot::GetAnnotDict() const { ASSERT(m_pAnnot != NULL); - return m_pAnnot->m_pAnnotDict; + return m_pAnnot->GetAnnotDict(); } void CPDFSDK_Annot::SetRect(const CPDF_Rect& rect) { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); ASSERT(rect.right - rect.left >= GetMinWidth()); ASSERT(rect.top - rect.bottom >= GetMinHeight()); - m_pAnnot->m_pAnnotDict->SetAtRect("Rect", rect); + m_pAnnot->GetAnnotDict()->SetAtRect("Rect", rect); } CPDF_Rect CPDFSDK_Annot::GetRect() const @@ -610,18 +608,12 @@ void CPDFSDK_Annot::DrawAppearance(CFX_RenderDevice* pDevice, const CPDF_Matrix* FX_BOOL CPDFSDK_Annot::IsAppearanceValid() { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - return m_pAnnot->m_pAnnotDict->GetDict("AP") != NULL; + return m_pAnnot->GetAnnotDict()->GetDict("AP") != NULL; } FX_BOOL CPDFSDK_Annot::IsAppearanceValid(CPDF_Annot::AppearanceMode mode) { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - CPDF_Dictionary* pAP = m_pAnnot->m_pAnnotDict->GetDict("AP"); + CPDF_Dictionary* pAP = m_pAnnot->GetAnnotDict()->GetDict("AP"); if (pAP == NULL) return FALSE; // Choose the right sub-ap @@ -655,63 +647,45 @@ void CPDFSDK_Annot::ClearCachedAP() void CPDFSDK_Annot::SetContents(const CFX_WideString& sContents) { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - if (sContents.IsEmpty()) - m_pAnnot->m_pAnnotDict->RemoveAt("Contents"); + m_pAnnot->GetAnnotDict()->RemoveAt("Contents"); else - m_pAnnot->m_pAnnotDict->SetAtString("Contents", PDF_EncodeText(sContents)); + m_pAnnot->GetAnnotDict()->SetAtString("Contents", PDF_EncodeText(sContents)); } CFX_WideString CPDFSDK_Annot::GetContents() const { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - return m_pAnnot->m_pAnnotDict->GetUnicodeText("Contents"); + return m_pAnnot->GetAnnotDict()->GetUnicodeText("Contents"); } void CPDFSDK_Annot::SetAnnotName(const CFX_WideString& sName) { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - if (sName.IsEmpty()) - m_pAnnot->m_pAnnotDict->RemoveAt("NM"); + m_pAnnot->GetAnnotDict()->RemoveAt("NM"); else - m_pAnnot->m_pAnnotDict->SetAtString("NM", PDF_EncodeText(sName)); + m_pAnnot->GetAnnotDict()->SetAtString("NM", PDF_EncodeText(sName)); } CFX_WideString CPDFSDK_Annot::GetAnnotName() const { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - return m_pAnnot->m_pAnnotDict->GetUnicodeText("NM"); + return m_pAnnot->GetAnnotDict()->GetUnicodeText("NM"); } void CPDFSDK_Annot::SetModifiedDate(const FX_SYSTEMTIME& st) { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - CPDFSDK_DateTime dt(st); CFX_ByteString str = dt.ToPDFDateTimeString(); if (str.IsEmpty()) - m_pAnnot->m_pAnnotDict->RemoveAt("M"); + m_pAnnot->GetAnnotDict()->RemoveAt("M"); else - m_pAnnot->m_pAnnotDict->SetAtString("M", str); + m_pAnnot->GetAnnotDict()->SetAtString("M", str); } FX_SYSTEMTIME CPDFSDK_Annot::GetModifiedDate() const { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - FX_SYSTEMTIME systime; - CFX_ByteString str = m_pAnnot->m_pAnnotDict->GetString("M"); + CFX_ByteString str = m_pAnnot->GetAnnotDict()->GetString("M"); CPDFSDK_DateTime dt(str); dt.ToSystemTime(systime); @@ -721,62 +695,41 @@ FX_SYSTEMTIME CPDFSDK_Annot::GetModifiedDate() const void CPDFSDK_Annot::SetFlags(int nFlags) { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - m_pAnnot->m_pAnnotDict->SetAtInteger("F", nFlags); + m_pAnnot->GetAnnotDict()->SetAtInteger("F", nFlags); } int CPDFSDK_Annot::GetFlags() const { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - return m_pAnnot->m_pAnnotDict->GetInteger("F"); + return m_pAnnot->GetAnnotDict()->GetInteger("F"); } void CPDFSDK_Annot::SetAppState(const CFX_ByteString& str) { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - if (str.IsEmpty()) - m_pAnnot->m_pAnnotDict->RemoveAt("AS"); + m_pAnnot->GetAnnotDict()->RemoveAt("AS"); else - m_pAnnot->m_pAnnotDict->SetAtString("AS", str); + m_pAnnot->GetAnnotDict()->SetAtString("AS", str); } CFX_ByteString CPDFSDK_Annot::GetAppState() const { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - return m_pAnnot->m_pAnnotDict->GetString("AS"); + return m_pAnnot->GetAnnotDict()->GetString("AS"); } void CPDFSDK_Annot::SetStructParent(int key) { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - m_pAnnot->m_pAnnotDict->SetAtInteger("StructParent", key); + m_pAnnot->GetAnnotDict()->SetAtInteger("StructParent", key); } int CPDFSDK_Annot::GetStructParent() const { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - return m_pAnnot->m_pAnnotDict->GetInteger("StructParent"); + return m_pAnnot->GetAnnotDict()->GetInteger("StructParent"); } //border void CPDFSDK_Annot::SetBorderWidth(int nWidth) { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - CPDF_Array* pBorder = m_pAnnot->m_pAnnotDict->GetArray("Border"); + CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArray("Border"); if (pBorder) { @@ -784,12 +737,12 @@ void CPDFSDK_Annot::SetBorderWidth(int nWidth) } else { - CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS"); + CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS"); if (!pBSDict) { pBSDict = new CPDF_Dictionary; - m_pAnnot->m_pAnnotDict->SetAt("BS", pBSDict); + m_pAnnot->GetAnnotDict()->SetAt("BS", pBSDict); } pBSDict->SetAtInteger("W", nWidth); @@ -798,10 +751,7 @@ void CPDFSDK_Annot::SetBorderWidth(int nWidth) int CPDFSDK_Annot::GetBorderWidth() const { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - CPDF_Array* pBorder = m_pAnnot->m_pAnnotDict->GetArray("Border"); + CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArray("Border"); if (pBorder) { @@ -809,7 +759,7 @@ int CPDFSDK_Annot::GetBorderWidth() const } else { - CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS"); + CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS"); if (pBSDict) { @@ -821,14 +771,11 @@ int CPDFSDK_Annot::GetBorderWidth() const void CPDFSDK_Annot::SetBorderStyle(int nStyle) { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS"); + CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS"); if (!pBSDict) { pBSDict = new CPDF_Dictionary; - m_pAnnot->m_pAnnotDict->SetAt("BS", pBSDict); + m_pAnnot->GetAnnotDict()->SetAt("BS", pBSDict); } switch (nStyle) @@ -853,10 +800,7 @@ void CPDFSDK_Annot::SetBorderStyle(int nStyle) int CPDFSDK_Annot::GetBorderStyle() const { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS"); + CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS"); if (pBSDict) { CFX_ByteString sBorderStyle = pBSDict->GetString("S", "S"); @@ -867,7 +811,7 @@ int CPDFSDK_Annot::GetBorderStyle() const if (sBorderStyle == "U") return BBS_UNDERLINE; } - CPDF_Array* pBorder = m_pAnnot->m_pAnnotDict->GetArray("Border"); + CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArray("Border"); if (pBorder) { if (pBorder->GetCount() >= 4) @@ -883,14 +827,11 @@ int CPDFSDK_Annot::GetBorderStyle() const void CPDFSDK_Annot::SetBorderDash(const CFX_IntArray& array) { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS"); + CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS"); if (!pBSDict) { pBSDict = new CPDF_Dictionary; - m_pAnnot->m_pAnnotDict->SetAt("BS", pBSDict); + m_pAnnot->GetAnnotDict()->SetAt("BS", pBSDict); } CPDF_Array* pArray = new CPDF_Array; @@ -904,19 +845,16 @@ void CPDFSDK_Annot::SetBorderDash(const CFX_IntArray& array) void CPDFSDK_Annot::GetBorderDash(CFX_IntArray& array) const { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - CPDF_Array* pDash = NULL; - CPDF_Array* pBorder = m_pAnnot->m_pAnnotDict->GetArray("Border"); + CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArray("Border"); if (pBorder) { pDash = pBorder->GetArray(3); } else { - CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS"); + CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS"); if (pBSDict) { pDash = pBSDict->GetArray("D"); @@ -934,30 +872,21 @@ void CPDFSDK_Annot::GetBorderDash(CFX_IntArray& array) const void CPDFSDK_Annot::SetColor(FX_COLORREF color) { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - CPDF_Array* pArray = new CPDF_Array; pArray->AddNumber((FX_FLOAT)FXSYS_GetRValue(color) / 255.0f); pArray->AddNumber((FX_FLOAT)FXSYS_GetGValue(color) / 255.0f); pArray->AddNumber((FX_FLOAT)FXSYS_GetBValue(color) / 255.0f); - m_pAnnot->m_pAnnotDict->SetAt("C", pArray); + m_pAnnot->GetAnnotDict()->SetAt("C", pArray); } void CPDFSDK_Annot::RemoveColor() { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - m_pAnnot->m_pAnnotDict->RemoveAt("C") ; + m_pAnnot->GetAnnotDict()->RemoveAt("C"); } FX_BOOL CPDFSDK_Annot::GetColor(FX_COLORREF& color) const { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - if (CPDF_Array* pEntry = m_pAnnot->m_pAnnotDict->GetArray("C")) + if (CPDF_Array* pEntry = m_pAnnot->GetAnnotDict()->GetArray("C")) { int nCount = pEntry->GetCount(); if (nCount == 1) @@ -1003,15 +932,12 @@ void CPDFSDK_Annot::WriteAppearance(const CFX_ByteString& sAPType, const CPDF_Re const CPDF_Matrix& matrix, const CFX_ByteString& sContents, const CFX_ByteString& sAPState) { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - CPDF_Dictionary* pAPDict = m_pAnnot->m_pAnnotDict->GetDict("AP"); + CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDict("AP"); if (!pAPDict) { pAPDict = new CPDF_Dictionary; - m_pAnnot->m_pAnnotDict->SetAt("AP", pAPDict); + m_pAnnot->GetAnnotDict()->SetAt("AP", pAPDict); } CPDF_Stream* pStream = NULL; @@ -1087,49 +1013,44 @@ FX_BOOL CPDFSDK_Annot::IsVisible() const CPDF_Action CPDFSDK_Annot::GetAction() const { - return CPDF_Action(m_pAnnot->m_pAnnotDict->GetDict("A")); + return CPDF_Action(m_pAnnot->GetAnnotDict()->GetDict("A")); } void CPDFSDK_Annot::SetAction(const CPDF_Action& action) { ASSERT(action); - if ((CPDF_Action&)action != CPDF_Action(m_pAnnot->m_pAnnotDict->GetDict("A"))) + if ((CPDF_Action&)action != CPDF_Action(m_pAnnot->GetAnnotDict()->GetDict("A"))) { CPDF_Document* pDoc = m_pPageView->GetPDFDocument(); CPDF_Dictionary* pDict = action.GetDict(); if (pDict && pDict->GetObjNum() == 0) { pDoc->AddIndirectObject(pDict); } - m_pAnnot->m_pAnnotDict->SetAtReference("A", pDoc, pDict->GetObjNum()); + m_pAnnot->GetAnnotDict()->SetAtReference("A", pDoc, pDict->GetObjNum()); } } void CPDFSDK_Annot::RemoveAction() { - m_pAnnot->m_pAnnotDict->RemoveAt("A"); + m_pAnnot->GetAnnotDict()->RemoveAt("A"); } CPDF_AAction CPDFSDK_Annot::GetAAction() const { - return m_pAnnot->m_pAnnotDict->GetDict("AA"); + return m_pAnnot->GetAnnotDict()->GetDict("AA"); } void CPDFSDK_Annot::SetAAction(const CPDF_AAction& aa) { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); ASSERT(aa != NULL); - if ((CPDF_AAction&)aa != m_pAnnot->m_pAnnotDict->GetDict("AA")) - m_pAnnot->m_pAnnotDict->SetAt("AA", (CPDF_AAction&)aa); + if ((CPDF_AAction&)aa != m_pAnnot->GetAnnotDict()->GetDict("AA")) + m_pAnnot->GetAnnotDict()->SetAt("AA", (CPDF_AAction&)aa); } void CPDFSDK_Annot::RemoveAAction() { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - m_pAnnot->m_pAnnotDict->RemoveAt("AA"); + m_pAnnot->GetAnnotDict()->RemoveAt("AA"); } CPDF_Action CPDFSDK_Annot::GetAAction(CPDF_AAction::AActionType eAAT) diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp index 0cbc4baa44..8b0738a8d4 100644 --- a/fpdfsdk/src/fsdk_baseform.cpp +++ b/fpdfsdk/src/fsdk_baseform.cpp @@ -39,10 +39,7 @@ CPDFSDK_Widget::~CPDFSDK_Widget() FX_BOOL CPDFSDK_Widget::IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode) { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - CPDF_Dictionary* pAP = m_pAnnot->m_pAnnotDict->GetDict("AP"); + CPDF_Dictionary* pAP = m_pAnnot->GetAnnotDict()->GetDict("AP"); if (pAP == NULL) return FALSE; // Choose the right sub-ap @@ -96,7 +93,7 @@ int CPDFSDK_Widget::GetFieldFlags() const CPDF_InterForm* pPDFInterForm = m_pInterForm->GetInterForm(); ASSERT(pPDFInterForm != NULL); - CPDF_FormControl* pFormControl = pPDFInterForm->GetControlByDict(m_pAnnot->m_pAnnotDict); + CPDF_FormControl* pFormControl = pPDFInterForm->GetControlByDict(m_pAnnot->GetAnnotDict()); CPDF_FormField* pFormField = pFormControl->GetField(); return pFormField->GetFieldFlags(); } @@ -1538,13 +1535,10 @@ void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_St { ASSERT(pImage != NULL); - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - CPDF_Document* pDoc = m_pPageView->GetPDFDocument();//pDocument->GetDocument(); ASSERT(pDoc != NULL); - CPDF_Dictionary* pAPDict = m_pAnnot->m_pAnnotDict->GetDict("AP"); + CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDict("AP"); ASSERT(pAPDict != NULL); CPDF_Stream* pStream = pAPDict->GetStream(sAPType); @@ -1579,10 +1573,7 @@ void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_St void CPDFSDK_Widget::RemoveAppearance(const CFX_ByteString& sAPType) { - ASSERT(m_pAnnot != NULL); - ASSERT(m_pAnnot->m_pAnnotDict != NULL); - - if (CPDF_Dictionary* pAPDict = m_pAnnot->m_pAnnotDict->GetDict("AP")) + if (CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDict("AP")) { pAPDict->RemoveAt(sAPType); } diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp index e6be9bd737..7ac370ec43 100644 --- a/fpdfsdk/src/fsdk_mgr.cpp +++ b/fpdfsdk/src/fsdk_mgr.cpp @@ -751,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; @@ -831,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; |