summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/pdfwindow')
-rw-r--r--fpdfsdk/pdfwindow/cpwl_combo_box.cpp20
-rw-r--r--fpdfsdk/pdfwindow/cpwl_combo_box.h7
-rw-r--r--fpdfsdk/pdfwindow/cpwl_edit.cpp2
-rw-r--r--fpdfsdk/pdfwindow/cpwl_edit.h1
-rw-r--r--fpdfsdk/pdfwindow/cpwl_wnd.cpp2
-rw-r--r--fpdfsdk/pdfwindow/cpwl_wnd.h21
6 files changed, 26 insertions, 27 deletions
diff --git a/fpdfsdk/pdfwindow/cpwl_combo_box.cpp b/fpdfsdk/pdfwindow/cpwl_combo_box.cpp
index 42786806d0..b69f98906e 100644
--- a/fpdfsdk/pdfwindow/cpwl_combo_box.cpp
+++ b/fpdfsdk/pdfwindow/cpwl_combo_box.cpp
@@ -182,14 +182,7 @@ bool CPWL_CBButton::OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) {
return true;
}
-CPWL_ComboBox::CPWL_ComboBox()
- : m_pEdit(nullptr),
- m_pButton(nullptr),
- m_pList(nullptr),
- m_bPopup(false),
- m_bBottom(true),
- m_nSelectItem(-1),
- m_pFillerNotify(nullptr) {}
+CPWL_ComboBox::CPWL_ComboBox() {}
CPWL_ComboBox::~CPWL_ComboBox() {}
@@ -202,6 +195,17 @@ void CPWL_ComboBox::OnCreate(PWL_CREATEPARAM& cp) {
cp.dwFlags &= ~PWS_VSCROLL;
}
+void CPWL_ComboBox::OnDestroy() {
+ // Until cleanup takes place in the virtual destructor for CPWL_Wnd
+ // subclasses, implement the virtual OnDestroy method that does the
+ // cleanup first, then invokes the superclass OnDestroy ... gee,
+ // like a dtor would.
+ m_pList.Release();
+ m_pButton.Release();
+ m_pEdit.Release();
+ CPWL_Wnd::OnDestroy();
+}
+
void CPWL_ComboBox::SetFocus() {
if (m_pEdit)
m_pEdit->SetFocus();
diff --git a/fpdfsdk/pdfwindow/cpwl_combo_box.h b/fpdfsdk/pdfwindow/cpwl_combo_box.h
index 71bd1a9e1c..e814ca5d40 100644
--- a/fpdfsdk/pdfwindow/cpwl_combo_box.h
+++ b/fpdfsdk/pdfwindow/cpwl_combo_box.h
@@ -57,6 +57,7 @@ class CPWL_ComboBox : public CPWL_Wnd {
// CPWL_Wnd:
CFX_ByteString GetClassName() const override;
void OnCreate(PWL_CREATEPARAM& cp) override;
+ void OnDestroy() override;
bool OnKeyDown(uint16_t nChar, uint32_t nFlag) override;
bool OnChar(uint16_t nChar, uint32_t nFlag) override;
void OnNotify(CPWL_Wnd* pWnd,
@@ -97,9 +98,9 @@ class CPWL_ComboBox : public CPWL_Wnd {
CFX_UnownedPtr<CPWL_CBButton> m_pButton;
CFX_UnownedPtr<CPWL_CBListBox> m_pList;
CFX_FloatRect m_rcOldWindow;
- bool m_bPopup;
- bool m_bBottom;
- int32_t m_nSelectItem;
+ bool m_bPopup = false;
+ bool m_bBottom = true;
+ int32_t m_nSelectItem = -1;
CFX_UnownedPtr<IPWL_Filler_Notify> m_pFillerNotify;
CFX_UnownedPtr<CFFL_FormFiller> m_pFormFiller;
};
diff --git a/fpdfsdk/pdfwindow/cpwl_edit.cpp b/fpdfsdk/pdfwindow/cpwl_edit.cpp
index fd785e0603..d807f32c34 100644
--- a/fpdfsdk/pdfwindow/cpwl_edit.cpp
+++ b/fpdfsdk/pdfwindow/cpwl_edit.cpp
@@ -39,8 +39,6 @@ CFX_ByteString CPWL_Edit::GetClassName() const {
return PWL_CLASSNAME_EDIT;
}
-void CPWL_Edit::OnDestroy() {}
-
void CPWL_Edit::SetText(const CFX_WideString& csText) {
CFX_WideString swText = csText;
if (!HasFlag(PES_RICH)) {
diff --git a/fpdfsdk/pdfwindow/cpwl_edit.h b/fpdfsdk/pdfwindow/cpwl_edit.h
index 1ed01b9657..5e82a5746b 100644
--- a/fpdfsdk/pdfwindow/cpwl_edit.h
+++ b/fpdfsdk/pdfwindow/cpwl_edit.h
@@ -48,7 +48,6 @@ class CPWL_Edit : public CPWL_EditCtrl {
// CPWL_EditCtrl
CFX_ByteString GetClassName() const override;
- void OnDestroy() override;
void OnCreated() override;
void RePosChildWnd() override;
CFX_FloatRect GetClientRect() const override;
diff --git a/fpdfsdk/pdfwindow/cpwl_wnd.cpp b/fpdfsdk/pdfwindow/cpwl_wnd.cpp
index 57e2643220..90a79305eb 100644
--- a/fpdfsdk/pdfwindow/cpwl_wnd.cpp
+++ b/fpdfsdk/pdfwindow/cpwl_wnd.cpp
@@ -186,6 +186,7 @@ void CPWL_Wnd::Destroy() {
KillFocus();
OnDestroy();
if (m_bCreated) {
+ m_pVScrollBar = nullptr;
for (auto it = m_Children.rbegin(); it != m_Children.rend(); ++it) {
if (CPWL_Wnd* pChild = *it) {
*it = nullptr;
@@ -201,7 +202,6 @@ void CPWL_Wnd::Destroy() {
DestroyMsgControl();
m_sPrivateParam.Reset();
m_Children.clear();
- m_pVScrollBar = nullptr;
}
void CPWL_Wnd::Move(const CFX_FloatRect& rcNew, bool bReset, bool bRefresh) {
diff --git a/fpdfsdk/pdfwindow/cpwl_wnd.h b/fpdfsdk/pdfwindow/cpwl_wnd.h
index 86b0c66272..e7a4e23c38 100644
--- a/fpdfsdk/pdfwindow/cpwl_wnd.h
+++ b/fpdfsdk/pdfwindow/cpwl_wnd.h
@@ -73,18 +73,15 @@ class IPWL_Provider;
#define PRES_TEXTOVERFLOW 0x0400L
// notification messages
-#define PNM_ADDCHILD 0x00000000L
-#define PNM_REMOVECHILD 0x00000001L
-#define PNM_SETSCROLLINFO 0x00000002L
-#define PNM_SETSCROLLPOS 0x00000003L
-#define PNM_SCROLLWINDOW 0x00000004L
-#define PNM_LBUTTONDOWN 0x00000005L
-#define PNM_LBUTTONUP 0x00000006L
-#define PNM_MOUSEMOVE 0x00000007L
-#define PNM_NOTERESET 0x00000008L
-#define PNM_SETCARETINFO 0x00000009L
-#define PNM_SELCHANGED 0x0000000AL
-#define PNM_NOTEEDITCHANGED 0x0000000BL
+#define PNM_ADDCHILD 0
+#define PNM_REMOVECHILD 1
+#define PNM_SETSCROLLINFO 2
+#define PNM_SETSCROLLPOS 3
+#define PNM_SCROLLWINDOW 4
+#define PNM_LBUTTONDOWN 5
+#define PNM_LBUTTONUP 6
+#define PNM_MOUSEMOVE 7
+#define PNM_SETCARETINFO 8
#define PWL_CLASSNAME_EDIT "CPWL_Edit"