From 9fff1c76c1083a5cc0543911811e36007a38aa3a Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 22 Jun 2018 17:46:05 +0000 Subject: Avoid some duplicate const/non-const getters. Getters should nearly always be const when they return a non-const pointer to an unowned object. Saves a bit of code along the way. Grep for similar occurrences and add "const". Change-Id: I492bf962a7d62452fa40310146226dc0c8ebb753 Reviewed-on: https://pdfium-review.googlesource.com/35890 Commit-Queue: Tom Sepez Reviewed-by: Lei Zhang --- xfa/fxfa/cxfa_ffdocview.h | 2 +- xfa/fxfa/cxfa_ffnotify.h | 2 +- xfa/fxfa/cxfa_ffwidget.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'xfa') diff --git a/xfa/fxfa/cxfa_ffdocview.h b/xfa/fxfa/cxfa_ffdocview.h index efa504ecd3..c0011c6f01 100644 --- a/xfa/fxfa/cxfa_ffdocview.h +++ b/xfa/fxfa/cxfa_ffdocview.h @@ -47,7 +47,7 @@ class CXFA_FFDocView { explicit CXFA_FFDocView(CXFA_FFDoc* pDoc); ~CXFA_FFDocView(); - CXFA_FFDoc* GetDoc() { return m_pDoc.Get(); } + CXFA_FFDoc* GetDoc() const { return m_pDoc.Get(); } int32_t StartLayout(); int32_t DoLayout(); void StopLayout(); diff --git a/xfa/fxfa/cxfa_ffnotify.h b/xfa/fxfa/cxfa_ffnotify.h index cdb43b71d2..6715f825ff 100644 --- a/xfa/fxfa/cxfa_ffnotify.h +++ b/xfa/fxfa/cxfa_ffnotify.h @@ -58,7 +58,7 @@ class CXFA_FFNotify { bool bIsFormReady, bool bRecursive); void AddCalcValidate(CXFA_Node* pNode); - CXFA_FFDoc* GetHDOC() { return m_pDoc.Get(); } + CXFA_FFDoc* GetHDOC() const { return m_pDoc.Get(); } IXFA_AppProvider* GetAppProvider(); CXFA_FFWidgetHandler* GetWidgetHandler(); void OpenDropDownList(CXFA_FFWidget* hWidget); diff --git a/xfa/fxfa/cxfa_ffwidget.h b/xfa/fxfa/cxfa_ffwidget.h index 9b8402c343..419532d58c 100644 --- a/xfa/fxfa/cxfa_ffwidget.h +++ b/xfa/fxfa/cxfa_ffwidget.h @@ -148,7 +148,7 @@ class CXFA_FFWidget : public CXFA_ContentLayoutItem { uint32_t GetStatus(); void ModifyStatus(uint32_t dwAdded, uint32_t dwRemoved); - CXFA_Node* GetNode() { return m_pNode.Get(); } + CXFA_Node* GetNode() const { return m_pNode.Get(); } CXFA_FFDocView* GetDocView(); void SetDocView(CXFA_FFDocView* pDocView); -- cgit v1.2.3