Chromium Code Reviews| Index: core/include/fpdfdoc/fpdf_doc.h |
| diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h |
| index 770133b7390f73da2cef21827cc1520bcead979b..fd38b7a07efc841d3a8858d8091d92560345792c 100644 |
| --- a/core/include/fpdfdoc/fpdf_doc.h |
| +++ b/core/include/fpdfdoc/fpdf_doc.h |
| @@ -394,6 +394,7 @@ class CPDF_Annot : public CFX_PrivateData { |
| void GetRect(CFX_FloatRect& rect) const; |
| + const CPDF_Dictionary* GetAnnotDict() const; |
| CPDF_Dictionary* GetAnnotDict(); |
| FX_BOOL DrawAppearance(const CPDF_Page* pPage, |
| @@ -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) { return m_AnnotList[index]; } |
|
Tom Sepez
2015/10/30 20:26:06
Is this a const method, too?
Lei Zhang
2015/10/30 22:17:50
Done.
|
| + 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; } |