Index: core/src/fpdfdoc/doc_action.cpp |
diff --git a/core/src/fpdfdoc/doc_action.cpp b/core/src/fpdfdoc/doc_action.cpp |
index 324153563a19d4f6d22cd4610fa3e502b36a45de..ac40335a4ca10311e0fd907a48df9bdb4b9ab879 100644 |
--- a/core/src/fpdfdoc/doc_action.cpp |
+++ b/core/src/fpdfdoc/doc_action.cpp |
@@ -7,25 +7,26 @@ |
#include "../../include/fpdfdoc/fpdf_doc.h" |
CPDF_Dest CPDF_Action::GetDest(CPDF_Document* pDoc) const |
{ |
- if (m_pDict == NULL) { |
- return NULL; |
+ if (!m_pDict) { |
+ return CPDF_Dest(); |
} |
CFX_ByteString type = m_pDict->GetString("S"); |
if (type != "GoTo" && type != "GoToR") { |
- return NULL; |
+ return CPDF_Dest(); |
} |
CPDF_Object* pDest = m_pDict->GetElementValue("D"); |
- if (pDest == NULL) { |
- return NULL; |
+ if (!pDest) { |
+ return CPDF_Dest(); |
} |
if (pDest->GetType() == PDFOBJ_STRING || pDest->GetType() == PDFOBJ_NAME) { |
CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests")); |
CFX_ByteStringC name = pDest->GetString(); |
- return name_tree.LookupNamedDest(pDoc, name); |
- } else if (pDest->GetType() == PDFOBJ_ARRAY) { |
- return (CPDF_Array*)pDest; |
+ return CPDF_Dest(name_tree.LookupNamedDest(pDoc, name)); |
} |
- return NULL; |
+ if (pDest->GetType() == PDFOBJ_ARRAY) { |
+ return CPDF_Dest((CPDF_Array*)pDest); |
+ } |
+ return CPDF_Dest(); |
} |
const FX_CHAR* g_sATypes[] = {"Unknown", "GoTo", "GoToR", "GoToE", "Launch", "Thread", "URI", "Sound", "Movie", |
"Hide", "Named", "SubmitForm", "ResetForm", "ImportData", "JavaScript", "SetOCGState", |