summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-09 19:15:35 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-09 19:15:35 +0000
commit512adc5d1b8ad634278e659b1704fd90c358dca3 (patch)
tree552636c065497c096bec0f2783495fd64b2dcb7b /fpdfsdk
parentc1bf9988bbe2f74d227ce071171455ae99c47dbb (diff)
downloadpdfium-512adc5d1b8ad634278e659b1704fd90c358dca3.tar.xz
Mark more bits const in CPDFSDK_XFAWidget.
Change-Id: Ib262eafc73751890a95fb60a5c8d880e9c6792af Reviewed-on: https://pdfium-review.googlesource.com/c/43615 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/cpdfsdk_annot.cpp2
-rw-r--r--fpdfsdk/cpdfsdk_annot.h2
-rw-r--r--fpdfsdk/cpdfsdk_xfawidget.cpp4
-rw-r--r--fpdfsdk/cpdfsdk_xfawidget.h6
-rw-r--r--fpdfsdk/cpdfsdk_xfawidgethandler.cpp4
5 files changed, 8 insertions, 10 deletions
diff --git a/fpdfsdk/cpdfsdk_annot.cpp b/fpdfsdk/cpdfsdk_annot.cpp
index 75967a301f..4657368798 100644
--- a/fpdfsdk/cpdfsdk_annot.cpp
+++ b/fpdfsdk/cpdfsdk_annot.cpp
@@ -33,7 +33,7 @@ CPDFSDK_BAAnnot* CPDFSDK_Annot::AsBAAnnot() {
#ifdef PDF_ENABLE_XFA
-bool CPDFSDK_Annot::IsXFAField() {
+bool CPDFSDK_Annot::IsXFAField() const {
return false;
}
diff --git a/fpdfsdk/cpdfsdk_annot.h b/fpdfsdk/cpdfsdk_annot.h
index 708a223a50..5f7d2ed947 100644
--- a/fpdfsdk/cpdfsdk_annot.h
+++ b/fpdfsdk/cpdfsdk_annot.h
@@ -35,7 +35,7 @@ class CPDFSDK_Annot : public Observable<CPDFSDK_Annot> {
virtual CPDFSDK_BAAnnot* AsBAAnnot();
#ifdef PDF_ENABLE_XFA
- virtual bool IsXFAField();
+ virtual bool IsXFAField() const;
virtual CXFA_FFWidget* GetXFAWidget() const;
#endif // PDF_ENABLE_XFA
diff --git a/fpdfsdk/cpdfsdk_xfawidget.cpp b/fpdfsdk/cpdfsdk_xfawidget.cpp
index af08023ef8..7c9089a29a 100644
--- a/fpdfsdk/cpdfsdk_xfawidget.cpp
+++ b/fpdfsdk/cpdfsdk_xfawidget.cpp
@@ -16,9 +16,9 @@ CPDFSDK_XFAWidget::CPDFSDK_XFAWidget(CXFA_FFWidget* pAnnot,
m_pInterForm(pInterForm),
m_hXFAWidget(pAnnot) {}
-CPDFSDK_XFAWidget::~CPDFSDK_XFAWidget() {}
+CPDFSDK_XFAWidget::~CPDFSDK_XFAWidget() = default;
-bool CPDFSDK_XFAWidget::IsXFAField() {
+bool CPDFSDK_XFAWidget::IsXFAField() const {
return true;
}
diff --git a/fpdfsdk/cpdfsdk_xfawidget.h b/fpdfsdk/cpdfsdk_xfawidget.h
index 5878051c8d..2eaa29bb14 100644
--- a/fpdfsdk/cpdfsdk_xfawidget.h
+++ b/fpdfsdk/cpdfsdk_xfawidget.h
@@ -24,7 +24,7 @@ class CPDFSDK_XFAWidget final : public CPDFSDK_Annot {
~CPDFSDK_XFAWidget() override;
// CPDFSDK_Annot:
- bool IsXFAField() override;
+ bool IsXFAField() const override;
CXFA_FFWidget* GetXFAWidget() const override;
CPDF_Annot::Subtype GetAnnotSubtype() const override;
CFX_FloatRect GetRect() const override;
@@ -32,8 +32,8 @@ class CPDFSDK_XFAWidget final : public CPDFSDK_Annot {
CPDFSDK_InterForm* GetInterForm() const { return m_pInterForm.Get(); }
private:
- UnownedPtr<CPDFSDK_InterForm> m_pInterForm;
- UnownedPtr<CXFA_FFWidget> m_hXFAWidget;
+ UnownedPtr<CPDFSDK_InterForm> const m_pInterForm;
+ UnownedPtr<CXFA_FFWidget> const m_hXFAWidget;
};
inline CPDFSDK_XFAWidget* ToXFAWidget(CPDFSDK_Annot* pAnnot) {
diff --git a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp
index eeccf21584..75a5c12ba2 100644
--- a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp
+++ b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp
@@ -70,9 +70,7 @@ void CPDFSDK_XFAWidgetHandler::OnLoad(CPDFSDK_Annot* pAnnot) {}
void CPDFSDK_XFAWidgetHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) {
CPDFSDK_XFAWidget* pWidget = ToXFAWidget(pAnnot);
- CPDFSDK_InterForm* pInterForm = pWidget->GetInterForm();
- pInterForm->RemoveXFAMap(pWidget->GetXFAWidget());
-
+ pWidget->GetInterForm()->RemoveXFAMap(pWidget->GetXFAWidget());
delete pWidget;
}