summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-05-18 08:34:03 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-18 15:56:06 +0000
commit45b9ae18668e996f90780880dd691d69fa13cbe1 (patch)
treede3f9ab81d0be99efb2698130a0eeb705f421656 /fpdfsdk/pdfwindow
parent2034b941dfa07d30c286bfcceffd6904740ac446 (diff)
downloadpdfium-45b9ae18668e996f90780880dd691d69fa13cbe1.tar.xz
Revert "Smells like a leak in PWL_ComboBox.cpp"
This reverts commit b084c1f615e9b5d82a36aeedcff2339b7ac91265. Reason for revert: new crashes. BUG=723415 TBR=dsinclair@chromium.org Change-Id: I5194170f74a5781dad213d08a28e574eb6d56156 Reviewed-on: https://pdfium-review.googlesource.com/5655 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/pdfwindow')
-rw-r--r--fpdfsdk/pdfwindow/PWL_ComboBox.cpp15
-rw-r--r--fpdfsdk/pdfwindow/PWL_ComboBox.h8
2 files changed, 13 insertions, 10 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
index 9f5ab97858..b6c8d2f921 100644
--- a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
@@ -181,7 +181,10 @@ bool CPWL_CBButton::OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) {
}
CPWL_ComboBox::CPWL_ComboBox()
- : m_bPopup(false),
+ : m_pEdit(nullptr),
+ m_pButton(nullptr),
+ m_pList(nullptr),
+ m_bPopup(false),
m_nPopupWhere(0),
m_nSelectItem(-1),
m_pFillerNotify(nullptr) {}
@@ -264,7 +267,7 @@ void CPWL_ComboBox::CreateEdit(const PWL_CREATEPARAM& cp) {
if (m_pEdit)
return;
- m_pEdit = pdfium::MakeUnique<CPWL_CBEdit>();
+ m_pEdit = new CPWL_CBEdit();
m_pEdit->AttachFFLData(m_pFormFiller.Get());
PWL_CREATEPARAM ecp = cp;
@@ -288,7 +291,7 @@ void CPWL_ComboBox::CreateButton(const PWL_CREATEPARAM& cp) {
if (m_pButton)
return;
- m_pButton = pdfium::MakeUnique<CPWL_CBButton>();
+ m_pButton = new CPWL_CBButton;
PWL_CREATEPARAM bcp = cp;
bcp.pParentWnd = this;
@@ -305,7 +308,7 @@ void CPWL_ComboBox::CreateListBox(const PWL_CREATEPARAM& cp) {
if (m_pList)
return;
- m_pList = pdfium::MakeUnique<CPWL_CBListBox>();
+ m_pList = new CPWL_CBListBox();
m_pList->AttachFFLData(m_pFormFiller.Get());
PWL_CREATEPARAM lcp = cp;
@@ -585,14 +588,14 @@ void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd,
intptr_t lParam) {
switch (msg) {
case PNM_LBUTTONDOWN:
- if (pWnd == m_pButton.get()) {
+ if (pWnd == m_pButton) {
SetPopup(!m_bPopup);
return;
}
break;
case PNM_LBUTTONUP:
if (m_pEdit && m_pList) {
- if (pWnd == m_pList.get()) {
+ if (pWnd == m_pList) {
SetSelectText();
SelectAll();
m_pEdit->SetFocus();
diff --git a/fpdfsdk/pdfwindow/PWL_ComboBox.h b/fpdfsdk/pdfwindow/PWL_ComboBox.h
index 19d9ab2a04..0dfb3bd86b 100644
--- a/fpdfsdk/pdfwindow/PWL_ComboBox.h
+++ b/fpdfsdk/pdfwindow/PWL_ComboBox.h
@@ -52,7 +52,7 @@ class CPWL_ComboBox : public CPWL_Wnd {
CPWL_ComboBox();
~CPWL_ComboBox() override;
- CPWL_Edit* GetEdit() const { return m_pEdit.get(); }
+ CPWL_Edit* GetEdit() const { return m_pEdit; }
// CPWL_Wnd:
CFX_ByteString GetClassName() const override;
@@ -93,9 +93,9 @@ class CPWL_ComboBox : public CPWL_Wnd {
void CreateListBox(const PWL_CREATEPARAM& cp);
void SetPopup(bool bPopup);
- std::unique_ptr<CPWL_CBEdit> m_pEdit;
- std::unique_ptr<CPWL_CBButton> m_pButton;
- std::unique_ptr<CPWL_CBListBox> m_pList;
+ CPWL_CBEdit* m_pEdit;
+ CPWL_CBButton* m_pButton;
+ CPWL_CBListBox* m_pList;
bool m_bPopup;
CFX_FloatRect m_rcOldWindow;
int32_t m_nPopupWhere;