CPDF_Dest CPDF_Link::GetDest(CPDF_Document* pDoc) { CPDF_Object* pDest = m_pDict->GetElementValue("Dest"); if (!pDest) return CPDF_Dest(); if (pDest->IsString() || pDest->IsName()) { CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests")); CFX_ByteStringC name = pDest->GetString(); return CPDF_Dest(name_tree.LookupNamedDest(pDoc, name)); } if (CPDF_Array* pArray = pDest->AsArray()) return CPDF_Dest(pArray); return CPDF_Dest(); }
CPDF_Dest CPDF_Action::GetDest(CPDF_Document* pDoc) const { if (!m_pDict) return CPDF_Dest(); CFX_ByteString type = m_pDict->GetStringFor("S"); if (type != "GoTo" && type != "GoToR") return CPDF_Dest(); CPDF_Object* pDest = m_pDict->GetDirectObjectFor("D"); if (!pDest) return CPDF_Dest(); if (pDest->IsString() || pDest->IsName()) { CPDF_NameTree name_tree(pDoc, "Dests"); return CPDF_Dest(name_tree.LookupNamedDest(pDoc, pDest->GetString())); } if (CPDF_Array* pArray = pDest->AsArray()) return CPDF_Dest(pArray); return CPDF_Dest(); }