summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfdoc.cpp
diff options
context:
space:
mode:
authorWei Li <weili@chromium.org>2016-03-01 16:29:41 -0800
committerWei Li <weili@chromium.org>2016-03-01 16:29:41 -0800
commit0fc6b25e738c311fd66aa9da8c56de50af5644d5 (patch)
treee148556274b450ae125e2821debebb472f1ba8ee /fpdfsdk/src/fpdfdoc.cpp
parent738b08ce6b9f80d93b815411b47c2b11c2f090f6 (diff)
downloadpdfium-0fc6b25e738c311fd66aa9da8c56de50af5644d5.tar.xz
Remove implicit conversions and some cleanup
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1751753002 .
Diffstat (limited to 'fpdfsdk/src/fpdfdoc.cpp')
-rw-r--r--fpdfsdk/src/fpdfdoc.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp
index c88dccd86a..50f3e2c904 100644
--- a/fpdfsdk/src/fpdfdoc.cpp
+++ b/fpdfsdk/src/fpdfdoc.cpp
@@ -15,16 +15,17 @@ int THISMODULE = 0;
CPDF_Bookmark FindBookmark(const CPDF_BookmarkTree& tree,
CPDF_Bookmark bookmark,
const CFX_WideString& title) {
- if (bookmark && bookmark.GetTitle().CompareNoCase(title.c_str()) == 0) {
+ if (bookmark.GetDict() &&
+ bookmark.GetTitle().CompareNoCase(title.c_str()) == 0) {
// First check this item
return bookmark;
}
// go into children items
CPDF_Bookmark child = tree.GetFirstChild(bookmark);
- while (child) {
+ while (child.GetDict()) {
// check if this item
CPDF_Bookmark found = FindBookmark(tree, child, title);
- if (found)
+ if (found.GetDict())
return found;
child = tree.GetNextSibling(child);
}
@@ -112,12 +113,12 @@ DLLEXPORT FPDF_DEST STDCALL FPDFBookmark_GetDest(FPDF_DOCUMENT document,
return nullptr;
CPDF_Bookmark bookmark(ToDictionary(static_cast<CPDF_Object*>(pDict)));
CPDF_Dest dest = bookmark.GetDest(pDoc);
- if (dest)
+ if (dest.GetObject())
return dest.GetObject();
// If this bookmark is not directly associated with a dest, we try to get
// action
CPDF_Action action = bookmark.GetAction();
- if (!action)
+ if (!action.GetDict())
return nullptr;
return action.GetDest(pDoc).GetObject();
}
@@ -244,7 +245,7 @@ DLLEXPORT FPDF_DEST STDCALL FPDFLink_GetDest(FPDF_DOCUMENT document,
return dest;
// If this link is not directly associated with a dest, we try to get action
CPDF_Action action = link.GetAction();
- if (!action)
+ if (!action.GetDict())
return nullptr;
return action.GetDest(pDoc).GetObject();
}