Index: core/include/fpdfdoc/fpdf_doc.h |
diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h |
index cffb32bc204314765e4fc6e36ce3a0038a8d06d8..8f2939688220ab871ee433bd3b687490593132d6 100644 |
--- a/core/include/fpdfdoc/fpdf_doc.h |
+++ b/core/include/fpdfdoc/fpdf_doc.h |
@@ -44,7 +44,7 @@ class CXML_Element; |
class CPDF_NameTree { |
public: |
- CPDF_NameTree(CPDF_Dictionary* pRoot) { m_pRoot = pRoot; } |
+ explicit CPDF_NameTree(CPDF_Dictionary* pRoot) { m_pRoot = pRoot; } |
Tom Sepez
2015/11/09 21:25:31
nit: prefer initialization list, can m_pRoot be co
Lei Zhang
2015/11/09 22:45:27
Noted, but this CL is plenty big as is. I'll make
|
CPDF_NameTree(CPDF_Document* pDoc, const CFX_ByteStringC& category); |
@@ -66,7 +66,7 @@ class CPDF_NameTree { |
}; |
class CPDF_BookmarkTree { |
public: |
- CPDF_BookmarkTree(CPDF_Document* pDoc) : m_pDocument(pDoc) {} |
+ explicit CPDF_BookmarkTree(CPDF_Document* pDoc) : m_pDocument(pDoc) {} |
Tom Sepez
2015/11/09 21:25:30
nitto for m_pDocument.
Lei Zhang
2015/11/09 22:45:28
Acknowledged.
|
CPDF_Bookmark GetFirstChild(const CPDF_Bookmark& parent) const; |
@@ -130,7 +130,7 @@ class CPDF_OCContext : public IPDF_OCContext { |
public: |
enum UsageType { View = 0, Design, Print, Export }; |
- CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType = View); |
+ explicit CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType = View); |
~CPDF_OCContext() override; |
CPDF_Document* GetDocument() const { return m_pDocument; } |
@@ -165,6 +165,7 @@ class CPDF_OCContext : public IPDF_OCContext { |
class CPDF_ActionFields { |
public: |
+ // TODO(thestig): Examine why this cannot be explicit. |
CPDF_ActionFields(const CPDF_Action* pAction) { |
Tom Sepez
2015/11/09 21:25:31
nit: init list, const m_pAction member?
Lei Zhang
2015/11/09 22:45:27
Acknowledged.
|
m_pAction = (CPDF_Action*)pAction; |
} |
@@ -173,7 +174,7 @@ class CPDF_ActionFields { |
FX_DWORD GetFieldsCount() const; |
- void GetAllFields(CFX_PtrArray& fieldObjects) const; |
+ std::vector<CPDF_Object*> GetAllFields() const; |
CPDF_Object* GetField(FX_DWORD iIndex) const; |
@@ -263,6 +264,7 @@ class CPDF_Action { |
}; |
class CPDF_AAction { |
public: |
+ // TODO(thestig): Examine why this cannot be explicit. |
CPDF_AAction(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } |
Tom Sepez
2015/11/09 21:25:31
nit: prefer two methods and no default param, also
Lei Zhang
2015/11/09 22:45:27
Acknowledged.
|
operator CPDF_Dictionary*() const { return m_pDict; } |
@@ -303,7 +305,7 @@ class CPDF_AAction { |
}; |
class CPDF_DocJSActions { |
public: |
- CPDF_DocJSActions(CPDF_Document* pDoc); |
+ explicit CPDF_DocJSActions(CPDF_Document* pDoc); |
int CountJSActions() const; |
@@ -322,7 +324,7 @@ class CPDF_FileSpec { |
public: |
CPDF_FileSpec(); |
- CPDF_FileSpec(CPDF_Object* pObj) { m_pObj = pObj; } |
+ explicit CPDF_FileSpec(CPDF_Object* pObj) { m_pObj = pObj; } |
Tom Sepez
2015/11/09 21:25:31
nitto.
Lei Zhang
2015/11/09 22:45:27
Acknowledged.
|
operator CPDF_Object*() const { return m_pObj; } |
@@ -473,6 +475,7 @@ class CPDF_AnnotList { |
#define COLORTYPE_CMYK 3 |
class CPDF_DefaultAppearance { |
public: |
+ // TODO(thestig): Examine why this cannot be explicit. |
CPDF_DefaultAppearance(const CFX_ByteString& csDA = "") { m_csDA = csDA; } |
Tom Sepez
2015/11/09 21:25:31
nit: two methods, no default args.
Lei Zhang
2015/11/09 22:45:27
Acknowledged.
|
CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA) { |
@@ -579,8 +582,6 @@ class CPDF_InterForm : public CFX_PrivateData { |
void GetAllFieldNames(CFX_WideStringArray& allFieldNames); |
- FX_BOOL IsValidFormField(const void* pField); |
Tom Sepez
2015/11/09 21:25:31
Is dead?
Lei Zhang
2015/11/09 22:45:27
It cannot ever return true AFAICT. Please double c
|
- |
CPDF_FormField* GetFieldByDict(CPDF_Dictionary* pFieldDict) const; |
CPDF_FormControl* GetControlAtPoint(CPDF_Page* pPage, |
@@ -644,24 +645,25 @@ class CPDF_InterForm : public CFX_PrivateData { |
int GetFormAlignment(); |
- CPDF_FormField* CheckRequiredFields(const CFX_PtrArray* fields = NULL, |
- FX_BOOL bIncludeOrExclude = TRUE) const; |
+ CPDF_FormField* CheckRequiredFields( |
+ const std::vector<CPDF_FormField*>* fields, |
Tom Sepez
2015/11/09 21:25:31
nit: const reference.
Lei Zhang
2015/11/09 22:45:27
Some callers pass in a nullptr.
|
+ FX_BOOL bIncludeOrExclude) const; |
Tom Sepez
2015/11/09 21:25:31
nit: bool.
Lei Zhang
2015/11/09 22:45:27
Done.
|
CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, |
- FX_BOOL bSimpleFileSpec = FALSE) const; |
+ bool bSimpleFileSpec = false) const; |
CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, |
- CFX_PtrArray& fields, |
- FX_BOOL bIncludeOrExclude = TRUE, |
- FX_BOOL bSimpleFileSpec = FALSE) const; |
+ const std::vector<CPDF_FormField*>& fields, |
+ bool bIncludeOrExclude = true, |
+ bool bSimpleFileSpec = false) const; |
FX_BOOL ImportFromFDF(const CFDF_Document* pFDFDoc, FX_BOOL bNotify = FALSE); |
- FX_BOOL ResetForm(const CFX_PtrArray& fields, |
- FX_BOOL bIncludeOrExclude = TRUE, |
- FX_BOOL bNotify = FALSE); |
+ bool ResetForm(const std::vector<CPDF_FormField*>& fields, |
+ bool bIncludeOrExclude = true, |
+ bool bNotify = false); |
- FX_BOOL ResetForm(FX_BOOL bNotify = FALSE); |
+ bool ResetForm(bool bNotify = false); |
CPDF_FormNotify* GetFormNotify() const { return m_pFormNotify; } |
@@ -885,6 +887,7 @@ CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, |
int nLevel = 0); |
class CPDF_IconFit { |
public: |
+ // TODO(thestig): Examine why this cannot be explicit. |
CPDF_IconFit(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } |
Tom Sepez
2015/11/09 21:25:31
nitto: two methods, const member, no default args,
Lei Zhang
2015/11/09 22:45:27
Acknowledged.
|
operator CPDF_Dictionary*() const { return m_pDict; } |
@@ -1058,7 +1061,7 @@ class CPDF_FormNotify { |
FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); |
class CPDF_PageLabel { |
public: |
- CPDF_PageLabel(CPDF_Document* pDocument) { m_pDocument = pDocument; } |
+ explicit CPDF_PageLabel(CPDF_Document* pDocument) { m_pDocument = pDocument; } |
Tom Sepez
2015/11/09 21:25:31
nitto
Lei Zhang
2015/11/09 22:45:27
Acknowledged.
|
CFX_WideString GetLabel(int nPage) const; |
@@ -1083,7 +1086,7 @@ class CPDF_Metadata { |
class CPDF_ViewerPreferences { |
public: |
- CPDF_ViewerPreferences(CPDF_Document* pDoc); |
+ explicit CPDF_ViewerPreferences(CPDF_Document* pDoc); |
~CPDF_ViewerPreferences(); |
@@ -1102,6 +1105,7 @@ class CPDF_ViewerPreferences { |
}; |
class CPDF_ApSettings { |
public: |
+ // TODO(thestig): Examine why this cannot be explicit. |
CPDF_ApSettings(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } |
Tom Sepez
2015/11/09 21:25:31
nitto
Lei Zhang
2015/11/09 22:45:27
Acknowledged.
|
operator CPDF_Dictionary*() const { return m_pDict; } |