summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-06-27 17:54:50 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-27 17:54:50 +0000
commitd78a964c31f303e828453ee189d4998558bac8e1 (patch)
treefe74133529c24a276616bbb2e34a0986da1bbe4a /xfa
parent9e12f14814722c0c0d46d4968f636b5e1a72a1e7 (diff)
downloadpdfium-d78a964c31f303e828453ee189d4998558bac8e1.tar.xz
Remove CXFA_FField::UnloadWidget().
It is only called during the destructor, and does things that the destructor would automatically do, like calling into the superclass. So just use destructors. Change-Id: I1196817798eeca99914b44ddee1f75781e682211 Reviewed-on: https://pdfium-review.googlesource.com/36231 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fxfa/cxfa_fffield.cpp8
-rw-r--r--xfa/fxfa/cxfa_fffield.h1
-rw-r--r--xfa/fxfa/cxfa_ffimage.cpp9
-rw-r--r--xfa/fxfa/cxfa_ffimage.h1
-rw-r--r--xfa/fxfa/cxfa_ffimageedit.cpp7
-rw-r--r--xfa/fxfa/cxfa_ffimageedit.h1
-rw-r--r--xfa/fxfa/cxfa_ffpushbutton.cpp13
-rw-r--r--xfa/fxfa/cxfa_ffpushbutton.h1
-rw-r--r--xfa/fxfa/cxfa_ffwidget.cpp2
-rw-r--r--xfa/fxfa/cxfa_ffwidget.h1
10 files changed, 5 insertions, 39 deletions
diff --git a/xfa/fxfa/cxfa_fffield.cpp b/xfa/fxfa/cxfa_fffield.cpp
index fe53da1a46..6f7aab899f 100644
--- a/xfa/fxfa/cxfa_fffield.cpp
+++ b/xfa/fxfa/cxfa_fffield.cpp
@@ -41,9 +41,7 @@ CXFA_FFField* ToField(CXFA_LayoutItem* widget) {
CXFA_FFField::CXFA_FFField(CXFA_Node* pNode) : CXFA_FFWidget(pNode) {}
-CXFA_FFField::~CXFA_FFField() {
- CXFA_FFField::UnloadWidget();
-}
+CXFA_FFField::~CXFA_FFField() = default;
CFX_RectF CXFA_FFField::GetBBox(uint32_t dwStatus, bool bDrawFocus) {
if (!bDrawFocus)
@@ -133,10 +131,6 @@ bool CXFA_FFField::LoadWidget() {
return true;
}
-void CXFA_FFField::UnloadWidget() {
- m_pNormalWidget.reset();
-}
-
void CXFA_FFField::SetEditScrollOffset() {
XFA_FFWidgetType eType = m_pNode->GetFFWidgetType();
if (eType != XFA_FFWidgetType::kTextEdit &&
diff --git a/xfa/fxfa/cxfa_fffield.h b/xfa/fxfa/cxfa_fffield.h
index b51234a437..5b3251145b 100644
--- a/xfa/fxfa/cxfa_fffield.h
+++ b/xfa/fxfa/cxfa_fffield.h
@@ -31,7 +31,6 @@ class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate {
uint32_t dwStatus) override;
bool IsLoaded() override;
bool LoadWidget() override;
- void UnloadWidget() override;
bool PerformLayout() override;
bool OnMouseEnter() override;
bool OnMouseExit() override;
diff --git a/xfa/fxfa/cxfa_ffimage.cpp b/xfa/fxfa/cxfa_ffimage.cpp
index cb4990eb81..cc640cef3b 100644
--- a/xfa/fxfa/cxfa_ffimage.cpp
+++ b/xfa/fxfa/cxfa_ffimage.cpp
@@ -18,7 +18,7 @@
CXFA_FFImage::CXFA_FFImage(CXFA_Node* pNode) : CXFA_FFWidget(pNode) {}
CXFA_FFImage::~CXFA_FFImage() {
- CXFA_FFImage::UnloadWidget();
+ GetNode()->SetImageImage(nullptr);
}
bool CXFA_FFImage::IsLoaded() {
@@ -29,12 +29,7 @@ bool CXFA_FFImage::LoadWidget() {
if (GetNode()->GetImageImage())
return true;
- return GetNode()->LoadImageImage(GetDoc()) ? CXFA_FFWidget::LoadWidget()
- : false;
-}
-
-void CXFA_FFImage::UnloadWidget() {
- GetNode()->SetImageImage(nullptr);
+ return GetNode()->LoadImageImage(GetDoc()) && CXFA_FFWidget::LoadWidget();
}
void CXFA_FFImage::RenderWidget(CXFA_Graphics* pGS,
diff --git a/xfa/fxfa/cxfa_ffimage.h b/xfa/fxfa/cxfa_ffimage.h
index 9f289dce64..7859f106ba 100644
--- a/xfa/fxfa/cxfa_ffimage.h
+++ b/xfa/fxfa/cxfa_ffimage.h
@@ -20,7 +20,6 @@ class CXFA_FFImage : public CXFA_FFWidget {
uint32_t dwStatus) override;
bool IsLoaded() override;
bool LoadWidget() override;
- void UnloadWidget() override;
};
#endif // XFA_FXFA_CXFA_FFIMAGE_H_
diff --git a/xfa/fxfa/cxfa_ffimageedit.cpp b/xfa/fxfa/cxfa_ffimageedit.cpp
index c1d1a09bac..c80841f647 100644
--- a/xfa/fxfa/cxfa_ffimageedit.cpp
+++ b/xfa/fxfa/cxfa_ffimageedit.cpp
@@ -28,7 +28,7 @@ CXFA_FFImageEdit::CXFA_FFImageEdit(CXFA_Node* pNode)
: CXFA_FFField(pNode), m_pOldDelegate(nullptr) {}
CXFA_FFImageEdit::~CXFA_FFImageEdit() {
- CXFA_FFImageEdit::UnloadWidget();
+ m_pNode->SetImageEditImage(nullptr);
}
bool CXFA_FFImageEdit::LoadWidget() {
@@ -51,11 +51,6 @@ bool CXFA_FFImageEdit::LoadWidget() {
return true;
}
-void CXFA_FFImageEdit::UnloadWidget() {
- m_pNode->SetImageEditImage(nullptr);
- CXFA_FFField::UnloadWidget();
-}
-
void CXFA_FFImageEdit::RenderWidget(CXFA_Graphics* pGS,
const CFX_Matrix& matrix,
uint32_t dwStatus) {
diff --git a/xfa/fxfa/cxfa_ffimageedit.h b/xfa/fxfa/cxfa_ffimageedit.h
index 3359696b42..c2fd7f7f62 100644
--- a/xfa/fxfa/cxfa_ffimageedit.h
+++ b/xfa/fxfa/cxfa_ffimageedit.h
@@ -20,7 +20,6 @@ class CXFA_FFImageEdit : public CXFA_FFField {
const CFX_Matrix& matrix,
uint32_t dwStatus) override;
bool LoadWidget() override;
- void UnloadWidget() override;
bool AcceptsFocusOnButtonDown(uint32_t dwFlags,
const CFX_PointF& point,
FWL_MouseCommand command) override;
diff --git a/xfa/fxfa/cxfa_ffpushbutton.cpp b/xfa/fxfa/cxfa_ffpushbutton.cpp
index 295422dcf3..0753a8349a 100644
--- a/xfa/fxfa/cxfa_ffpushbutton.cpp
+++ b/xfa/fxfa/cxfa_ffpushbutton.cpp
@@ -28,9 +28,7 @@
CXFA_FFPushButton::CXFA_FFPushButton(CXFA_Node* pNode, CXFA_Button* button)
: CXFA_FFField(pNode), button_(button) {}
-CXFA_FFPushButton::~CXFA_FFPushButton() {
- CXFA_FFPushButton::UnloadWidget();
-}
+CXFA_FFPushButton::~CXFA_FFPushButton() = default;
void CXFA_FFPushButton::RenderWidget(CXFA_Graphics* pGS,
const CFX_Matrix& matrix,
@@ -88,15 +86,6 @@ void CXFA_FFPushButton::UpdateWidgetProperty() {
m_pNormalWidget->ModifyStylesEx(dwStyleEx, 0xFFFFFFFF);
}
-void CXFA_FFPushButton::UnloadWidget() {
- m_pRolloverTextLayout.reset();
- m_pDownTextLayout.reset();
- m_pRollProvider.reset();
- m_pDownProvider.reset();
- m_pOldDelegate = nullptr;
- CXFA_FFField::UnloadWidget();
-}
-
bool CXFA_FFPushButton::PerformLayout() {
CXFA_FFWidget::PerformLayout();
CFX_RectF rtWidget = GetRectWithoutRotate();
diff --git a/xfa/fxfa/cxfa_ffpushbutton.h b/xfa/fxfa/cxfa_ffpushbutton.h
index 73308c0c8f..9c12daccbc 100644
--- a/xfa/fxfa/cxfa_ffpushbutton.h
+++ b/xfa/fxfa/cxfa_ffpushbutton.h
@@ -30,7 +30,6 @@ class CXFA_FFPushButton : public CXFA_FFField {
const CFX_Matrix& matrix,
uint32_t dwStatus) override;
bool LoadWidget() override;
- void UnloadWidget() override;
bool PerformLayout() override;
void UpdateWidgetProperty() override;
void OnProcessMessage(CFWL_Message* pMessage) override;
diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp
index 55ae35de27..a81063b335 100644
--- a/xfa/fxfa/cxfa_ffwidget.cpp
+++ b/xfa/fxfa/cxfa_ffwidget.cpp
@@ -318,8 +318,6 @@ bool CXFA_FFWidget::LoadWidget() {
return true;
}
-void CXFA_FFWidget::UnloadWidget() {}
-
bool CXFA_FFWidget::PerformLayout() {
RecacheWidgetRect();
return true;
diff --git a/xfa/fxfa/cxfa_ffwidget.h b/xfa/fxfa/cxfa_ffwidget.h
index 419532d58c..f8d97dc551 100644
--- a/xfa/fxfa/cxfa_ffwidget.h
+++ b/xfa/fxfa/cxfa_ffwidget.h
@@ -93,7 +93,6 @@ class CXFA_FFWidget : public CXFA_ContentLayoutItem {
uint32_t dwStatus);
virtual bool IsLoaded();
virtual bool LoadWidget();
- virtual void UnloadWidget();
virtual bool PerformLayout();
virtual bool UpdateFWLData();
virtual void UpdateWidgetProperty();