summaryrefslogtreecommitdiff
path: root/core/src/fpdfdoc/doc_link.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-03-06 10:52:05 -0800
committerTom Sepez <tsepez@chromium.org>2015-03-06 10:52:05 -0800
commitac8d1e75645d783cc72d2cfd57554e48e3ed2999 (patch)
treef9a81ec2955e3510e2f5000951770b56abb7194a /core/src/fpdfdoc/doc_link.cpp
parent934c277e262e1402a87581ab7dcef4a7733ddf08 (diff)
downloadpdfium-ac8d1e75645d783cc72d2cfd57554e48e3ed2999.tar.xz
Merge to XFA: Make conversion between CPDF_Dest and its object explicit.
Original Review URL: https://codereview.chromium.org/984703004 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/984143002
Diffstat (limited to 'core/src/fpdfdoc/doc_link.cpp')
-rw-r--r--core/src/fpdfdoc/doc_link.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/src/fpdfdoc/doc_link.cpp b/core/src/fpdfdoc/doc_link.cpp
index e7b6be5ca4..b7c640af5e 100644
--- a/core/src/fpdfdoc/doc_link.cpp
+++ b/core/src/fpdfdoc/doc_link.cpp
@@ -90,16 +90,17 @@ CPDF_Dest CPDF_Link::GetDest(CPDF_Document* pDoc)
{
CPDF_Object* pDest = m_pDict->GetElementValue("Dest");
if (pDest == NULL) {
- return NULL;
+ 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();
}
CPDF_Action CPDF_Link::GetAction()
{