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

Unified Diff: core/include/fpdfdoc/fpdf_doc.h

Issue 1430803003: Merge to XFA: Clean up CPDF_AnnotList. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: more merging Created 5 years, 2 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 | « no previous file | core/src/fpdfdoc/doc_annot.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fpdfdoc/fpdf_doc.h
diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h
index 168d9ebee0587fed1cb268ed630fdc49dd80e495..cc5cf0800573af576f6b324bf40f2fb92307f4b9 100644
--- a/core/include/fpdfdoc/fpdf_doc.h
+++ b/core/include/fpdfdoc/fpdf_doc.h
@@ -394,7 +394,8 @@ class CPDF_Annot : public CFX_PrivateData {
void GetRect(CFX_FloatRect& rect) const;
- CPDF_Dictionary* GetAnnotDict();
+ const CPDF_Dictionary* GetAnnotDict() const { return m_pAnnotDict; }
+ CPDF_Dictionary* GetAnnotDict() { return m_pAnnotDict; }
FX_BOOL DrawAppearance(const CPDF_Page* pPage,
CFX_RenderDevice* pDevice,
@@ -427,45 +428,18 @@ class CPDF_Annot : public CFX_PrivateData {
class CPDF_AnnotList {
public:
- CPDF_AnnotList(CPDF_Page* pPage);
-
+ explicit CPDF_AnnotList(CPDF_Page* pPage);
~CPDF_AnnotList();
- void GetAnnotMatrix(const CPDF_Dictionary* pAnnotDict,
- const CFX_Matrix* pUser2Device,
- CFX_Matrix& matrix) const;
-
- void GetAnnotRect(const CPDF_Dictionary* pAnnotDict,
- const CFX_Matrix* pUser2Device,
- CPDF_Rect& rtAnnot) const;
-
- void DisplayAnnots(const CPDF_Page* pPage,
- CFX_RenderDevice* pDevice,
- CFX_AffineMatrix* pMatrix,
- FX_BOOL bShowWidget,
- CPDF_RenderOptions* pOptions);
-
void DisplayAnnots(const CPDF_Page* pPage,
CPDF_RenderContext* pContext,
FX_BOOL bPrinting,
CFX_AffineMatrix* pMatrix,
FX_BOOL bShowWidget,
CPDF_RenderOptions* pOptions) {
- DisplayAnnots(pPage, NULL, pContext, bPrinting, pMatrix,
- bShowWidget ? 3 : 1, pOptions, NULL);
+ DisplayAnnots(pPage, nullptr, pContext, bPrinting, pMatrix,
+ bShowWidget ? 3 : 1, pOptions, nullptr);
}
-
- void DisplayAnnots(const CPDF_Page* pPage,
- CPDF_RenderContext* pContext,
- FX_BOOL bPrinting,
- CFX_AffineMatrix* pMatrix,
- FX_BOOL bShowWidget,
- CPDF_RenderOptions* pOptions,
- FX_RECT* pClipRect) {
- DisplayAnnots(pPage, NULL, pContext, bPrinting, pMatrix,
- bShowWidget ? 3 : 1, pOptions, pClipRect);
- }
-
void DisplayAnnots(const CPDF_Page* pPage,
CFX_RenderDevice* pDevice,
CPDF_RenderContext* pContext,
@@ -474,24 +448,12 @@ class CPDF_AnnotList {
FX_DWORD dwAnnotFlags,
CPDF_RenderOptions* pOptions,
FX_RECT* pClipRect);
-
- CPDF_Annot* GetAt(int index) { return (CPDF_Annot*)m_AnnotList.GetAt(index); }
-
- int Count() { return m_AnnotList.GetSize(); }
-
- int GetIndex(CPDF_Annot* pAnnot);
-
+ size_t Count() const { return m_AnnotList.size(); }
+ CPDF_Annot* GetAt(size_t index) const { return m_AnnotList[index]; }
+ const std::vector<CPDF_Annot*>& All() const { return m_AnnotList; }
CPDF_Document* GetDocument() const { return m_pDocument; }
protected:
- CFX_PtrArray m_AnnotList;
-
- CPDF_Dictionary* m_pPageDict;
-
- CPDF_Document* m_pDocument;
-
- CFX_PtrArray m_Borders;
-
void DisplayPass(const CPDF_Page* pPage,
CFX_RenderDevice* pDevice,
CPDF_RenderContext* pContext,
@@ -500,8 +462,11 @@ class CPDF_AnnotList {
FX_BOOL bWidget,
CPDF_RenderOptions* pOptions,
FX_RECT* clip_rect);
- friend class CPDF_Annot;
+
+ CPDF_Document* const m_pDocument;
+ std::vector<CPDF_Annot*> m_AnnotList;
};
+
#define COLORTYPE_TRANSPARENT 0
#define COLORTYPE_GRAY 1
#define COLORTYPE_RGB 2
@@ -623,7 +588,7 @@ class CPDF_InterForm : public CFX_PrivateData {
FX_FLOAT pdf_y,
int* z_order) const;
- CPDF_FormControl* GetControlByDict(CPDF_Dictionary* pWidgetDict) const;
+ CPDF_FormControl* GetControlByDict(const CPDF_Dictionary* pWidgetDict) const;
CPDF_Document* GetDocument() const { return m_pDocument; }
« no previous file with comments | « no previous file | core/src/fpdfdoc/doc_annot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698