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"); if (pBorder) { pDash = pBorder->GetArray(3); } else { CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS"); if (pBSDict) { pDash = pBSDict->GetArray("D"); } } if (pDash) { for (int i=0,sz=pDash->GetCount(); i<sz; i++) { array.Add(pDash->GetInteger(i)); } } }
void CPDFSDK_BAAnnot::SetBorderDash(const CFX_IntArray& array) { CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDictBy("BS"); if (!pBSDict) { pBSDict = new CPDF_Dictionary; m_pAnnot->GetAnnotDict()->SetAt("BS", pBSDict); } CPDF_Array* pArray = new CPDF_Array; for (int i = 0, sz = array.GetSize(); i < sz; i++) { pArray->AddInteger(array[i]); } pBSDict->SetAt("D", pArray); }
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"); if (!pBSDict) { pBSDict = FX_NEW CPDF_Dictionary; m_pAnnot->m_pAnnotDict->SetAt("BS", pBSDict); } CPDF_Array* pArray = FX_NEW CPDF_Array; for (int i=0,sz=array.GetSize(); i<sz; i++) { pArray->AddInteger(array[i]); } pBSDict->SetAt("D", pArray); }