summaryrefslogtreecommitdiff
path: root/core/include/fpdfdoc
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-04-14 12:54:38 -0700
committerTom Sepez <tsepez@chromium.org>2015-04-14 12:54:38 -0700
commit4926900ab54a493d236291b5a24dfa4476792182 (patch)
treee53800a0569300516c934bfccbb036ce39d98cb3 /core/include/fpdfdoc
parenteddab4425614e49146f904f00da4a664ba4b581b (diff)
downloadpdfium-4926900ab54a493d236291b5a24dfa4476792182.tar.xz
Kill CFX_Object.
CFX_Object is a type that implements its own new operators that return NULL on error. There's no need for this given the |new (std::nothrow)| syntax; in fact, the current code can only work if there is no activity in the constructors. This may explain the pervasive lack of constructors and reliance on Init() methods throughout the codebase. The activity takes place in fx_memory.h, where FX_NEW is mapped onto the std::nothrow syntax. The rest is just cleanup. Down the road, we will simply throw and remove all the error-checking paths for new objects. Landing this patch first will at least show a simple path back to the old behaviour without having to re-introduce CFX_Object should someone want to do so in their own fork. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1088733002
Diffstat (limited to 'core/include/fpdfdoc')
-rw-r--r--core/include/fpdfdoc/fpdf_doc.h46
-rw-r--r--core/include/fpdfdoc/fpdf_tagged.h4
-rw-r--r--core/include/fpdfdoc/fpdf_vt.h4
3 files changed, 27 insertions, 27 deletions
diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h
index 002f7ea1f4..40d57236cd 100644
--- a/core/include/fpdfdoc/fpdf_doc.h
+++ b/core/include/fpdfdoc/fpdf_doc.h
@@ -42,7 +42,7 @@ class CPDF_FormControl;
class CPDF_LWinParam;
class CFieldTree;
class CPDF_ApSettings;
-class CPDF_NameTree : public CFX_Object
+class CPDF_NameTree
{
public:
@@ -73,7 +73,7 @@ protected:
CPDF_Dictionary* m_pRoot;
};
-class CPDF_BookmarkTree : public CFX_Object
+class CPDF_BookmarkTree
{
public:
CPDF_BookmarkTree(CPDF_Document* pDoc) : m_pDocument(pDoc) {}
@@ -89,7 +89,7 @@ protected:
};
#define PDFBOOKMARK_ITALIC 1
#define PDFBOOKMARK_BOLD 2
-class CPDF_Bookmark : public CFX_Object
+class CPDF_Bookmark
{
public:
@@ -121,7 +121,7 @@ public:
#define PDFZOOM_FITBBOX 6
#define PDFZOOM_FITBHORZ 7
#define PDFZOOM_FITBVERT 8
-class CPDF_Dest : public CFX_Object
+class CPDF_Dest
{
public:
CPDF_Dest() : m_pObj(nullptr) { }
@@ -139,7 +139,7 @@ public:
protected:
CPDF_Object* m_pObj;
};
-class CPDF_OCContext : public CFX_Object, public IPDF_OCContext
+class CPDF_OCContext : public IPDF_OCContext
{
public:
@@ -185,7 +185,7 @@ protected:
CFX_MapPtrTemplate<const CPDF_Dictionary*, void*> m_OCGStates;
};
-class CPDF_LWinParam : public CFX_Object
+class CPDF_LWinParam
{
public:
@@ -224,7 +224,7 @@ public:
CPDF_Dictionary* m_pDict;
};
-class CPDF_ActionFields : public CFX_Object
+class CPDF_ActionFields
{
public:
@@ -252,7 +252,7 @@ public:
#define PDFNAMED_FIRSTPAGE 3
#define PDFNAMED_LASTPAGE 4
#define PDFJS_MAXLENGTH 64
-class CPDF_Action : public CFX_Object
+class CPDF_Action
{
public:
enum ActionType {
@@ -412,7 +412,7 @@ public:
protected:
CPDF_Dictionary* m_pDict;
};
-class CPDF_AAction : public CFX_Object
+class CPDF_AAction
{
public:
@@ -460,7 +460,7 @@ public:
CPDF_Dictionary* m_pDict;
};
-class CPDF_DocJSActions : public CFX_Object
+class CPDF_DocJSActions
{
public:
CPDF_DocJSActions(CPDF_Document* pDoc);
@@ -484,7 +484,7 @@ protected:
CPDF_Document* m_pDocument;
};
-class CPDF_FileSpec : public CFX_Object
+class CPDF_FileSpec
{
public:
@@ -511,7 +511,7 @@ protected:
CPDF_Object *m_pObj;
};
-class CPDF_LinkList : public CFX_Object
+class CPDF_LinkList
{
public:
@@ -542,7 +542,7 @@ protected:
void LoadPageLinks(CPDF_Page* pPage, CFX_PtrArray* pList);
};
-class CPDF_Link : public CFX_Object
+class CPDF_Link
{
public:
CPDF_Link() : m_pDict(nullptr) { }
@@ -566,7 +566,7 @@ protected:
#define ANNOTFLAG_READONLY 0x40
#define ANNOTFLAG_LOCKED 0x80
#define ANNOTFLAG_TOGGLENOVIEW 0x100
-class CPDF_Annot : public CFX_PrivateData, public CFX_Object
+class CPDF_Annot : public CFX_PrivateData
{
public:
@@ -623,7 +623,7 @@ protected:
CPDF_Reference* NewAnnotRef();
};
-class CPDF_AnnotList : public CFX_Object
+class CPDF_AnnotList
{
public:
@@ -695,7 +695,7 @@ protected:
#define COLORTYPE_GRAY 1
#define COLORTYPE_RGB 2
#define COLORTYPE_CMYK 3
-class CPDF_DefaultAppearance : public CFX_Object
+class CPDF_DefaultAppearance
{
public:
@@ -767,7 +767,7 @@ protected:
#define FIELDTYPE_LISTBOX 5
#define FIELDTYPE_TEXTFIELD 6
#define FIELDTYPE_SIGNATURE 7
-class CPDF_InterForm : public CFX_PrivateData, public CFX_Object
+class CPDF_InterForm : public CFX_PrivateData
{
public:
@@ -1025,7 +1025,7 @@ protected:
#define FORMTEXT_COMB 0x800
#define FORMCOMBO_EDIT 0x100
#define FORMLIST_MULTISELECT 0x100
-class CPDF_FormField : public CFX_Object
+class CPDF_FormField
{
public:
@@ -1247,7 +1247,7 @@ protected:
CPDF_Font* m_pFont;
};
CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, const FX_CHAR* name, int nLevel = 0);
-class CPDF_IconFit : public CFX_Object
+class CPDF_IconFit
{
public:
@@ -1299,7 +1299,7 @@ public:
#define TEXTPOS_RIGHT 4
#define TEXTPOS_LEFT 5
#define TEXTPOS_OVERLAID 6
-class CPDF_FormControl : public CFX_Object
+class CPDF_FormControl
{
public:
@@ -1507,7 +1507,7 @@ protected:
friend class CPDF_InterForm;
friend class CPDF_FormField;
};
-class CPDF_FormNotify : public CFX_Object
+class CPDF_FormNotify
{
public:
@@ -1559,7 +1559,7 @@ public:
}
};
FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
-class CPDF_PageLabel : public CFX_Object
+class CPDF_PageLabel
{
public:
@@ -1623,7 +1623,7 @@ public:
protected:
CPDF_Document* m_pDoc;
};
-class CPDF_ApSettings : public CFX_Object
+class CPDF_ApSettings
{
public:
diff --git a/core/include/fpdfdoc/fpdf_tagged.h b/core/include/fpdfdoc/fpdf_tagged.h
index 1a2a5d4ffa..a5862e0a8f 100644
--- a/core/include/fpdfdoc/fpdf_tagged.h
+++ b/core/include/fpdfdoc/fpdf_tagged.h
@@ -13,7 +13,7 @@ class CPDF_Document;
class CPDF_Page;
class IPDF_ReflowEngine;
class IPDF_ReflowedPage;
-class CPDF_StructTree : public CFX_Object
+class CPDF_StructTree
{
public:
@@ -65,7 +65,7 @@ struct CPDF_StructKid {
} m_Object;
};
};
-class CPDF_StructElement : public CFX_Object
+class CPDF_StructElement
{
public:
virtual ~CPDF_StructElement() { }
diff --git a/core/include/fpdfdoc/fpdf_vt.h b/core/include/fpdfdoc/fpdf_vt.h
index c9a66020d8..18ea709bcf 100644
--- a/core/include/fpdfdoc/fpdf_vt.h
+++ b/core/include/fpdfdoc/fpdf_vt.h
@@ -164,7 +164,7 @@ struct CPVT_WordRange {
CPVT_WordPlace EndPos;
};
-struct CPVT_SecProps : public CFX_Object {
+struct CPVT_SecProps {
CPVT_SecProps() : fLineLeading(0.0f), fLineIndent(0.0f), nAlignment(0)
{
@@ -186,7 +186,7 @@ struct CPVT_SecProps : public CFX_Object {
FX_INT32 nAlignment;
};
-struct CPVT_WordProps : public CFX_Object {
+struct CPVT_WordProps {
CPVT_WordProps() : nFontIndex(-1), fFontSize(0.0f), dwWordColor(0), nScriptType(0), nWordStyle(0),
fCharSpace(0.0f), nHorzScale(0)