summaryrefslogtreecommitdiff
path: root/core/include/fpdfdoc/fpdf_doc.h
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2015-01-05 12:39:36 -0800
committerBo Xu <bo_xu@foxitsoftware.com>2015-01-05 12:51:33 -0800
commit5d9acf8ee5dbbaad838f14f1fa173d892c4300ab (patch)
tree3cb71eab9457a4a6bb495d9ed5ad436825f9561f /core/include/fpdfdoc/fpdf_doc.h
parent5c57933509aedb46399d320da16dfcc3e5acf28d (diff)
downloadpdfium-5d9acf8ee5dbbaad838f14f1fa173d892c4300ab.tar.xz
XFA: merge patch from CL 828203002, clean up bookmark codes
Clean up bookmark related codes. Remove CPDF_Dictionary*() operator in CPDF_Bookmark class. Unify naming conventions and coding styles. Change some functions to const. Change the name of function argument to |pDict| for FPDF_xxx type variable. This makes the code more clear and gives better variable naming R=tsepez@chromium.org Review URL: https://codereview.chromium.org/828203002 Conflicts: fpdfsdk/src/fpdfdoc.cpp
Diffstat (limited to 'core/include/fpdfdoc/fpdf_doc.h')
-rw-r--r--core/include/fpdfdoc/fpdf_doc.h46
1 files changed, 13 insertions, 33 deletions
diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h
index 960e943e4a..fc34f1af4b 100644
--- a/core/include/fpdfdoc/fpdf_doc.h
+++ b/core/include/fpdfdoc/fpdf_doc.h
@@ -76,26 +76,15 @@ protected:
class CPDF_BookmarkTree : public CFX_Object
{
public:
+ CPDF_BookmarkTree(CPDF_Document* pDoc) : m_pDocument(pDoc) {}
- CPDF_BookmarkTree(CPDF_Document* pDoc)
- {
- m_pDocument = pDoc;
- }
-public:
-
-
-
- CPDF_Bookmark GetFirstChild(CPDF_Bookmark parent);
+ CPDF_Bookmark GetFirstChild(const CPDF_Bookmark& parent) const;
- CPDF_Bookmark GetNextSibling(CPDF_Bookmark bookmark);
+ CPDF_Bookmark GetNextSibling(const CPDF_Bookmark& bookmark) const;
+ CPDF_Document* GetDocument() const { return m_pDocument; }
- CPDF_Document* GetDocument() const
- {
- return m_pDocument;
- }
protected:
-
CPDF_Document* m_pDocument;
};
#define PDFBOOKMARK_ITALIC 1
@@ -104,31 +93,23 @@ class CPDF_Bookmark : public CFX_Object
{
public:
- CPDF_Bookmark(CPDF_Dictionary* pDict = NULL)
- {
- m_pDict = pDict;
- }
-
- operator CPDF_Dictionary*() const
- {
- return m_pDict;
- }
-
-
+ CPDF_Bookmark() : m_pDict(NULL) {}
- FX_DWORD GetColorRef();
+ explicit CPDF_Bookmark(CPDF_Dictionary* pDict) : m_pDict(pDict) {}
- FX_DWORD GetFontStyle();
+ CPDF_Dictionary* GetDict() const { return m_pDict; }
- CFX_WideString GetTitle();
+ operator bool() const { return m_pDict != NULL; }
+ FX_DWORD GetColorRef() const;
+ FX_DWORD GetFontStyle() const;
+ CFX_WideString GetTitle() const;
- CPDF_Dest GetDest(CPDF_Document* pDocument);
-
- CPDF_Action GetAction();
+ CPDF_Dest GetDest(CPDF_Document* pDocument) const;
+ CPDF_Action GetAction() const;
CPDF_Dictionary* m_pDict;
};
@@ -139,7 +120,6 @@ public:
#define PDFZOOM_FITRECT 5
#define PDFZOOM_FITBBOX 6
#define PDFZOOM_FITBHORZ 7
-
#define PDFZOOM_FITBVERT 8
class CPDF_Dest : public CFX_Object
{