Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Unified Diff: fpdfsdk/src/fpdfdoc.cpp

Issue 1751753002: Remove implicit conversions and some cleanup (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_IFormFiller.cpp ('k') | fpdfsdk/src/fpdfformfill.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfdoc.cpp
diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp
index c88dccd86a71b13a9216a3cdef098e73f60d0478..50f3e2c9042595fb6413b21aeedd37deebe6798f 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();
}
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_IFormFiller.cpp ('k') | fpdfsdk/src/fpdfformfill.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698