Remove unused CFWL_WidgetProperties::m_pOwner.
It is never non-null.
Initialize in header while we're at it.
Change-Id: Ie4663bd4ca99aae2f3c4db8da2b253229955435d
Reviewed-on: https://pdfium-review.googlesource.com/c/49410
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/xfa/fwl/cfwl_widget.cpp b/xfa/fwl/cfwl_widget.cpp
index 027dfc4..8e7ba77 100644
--- a/xfa/fwl/cfwl_widget.cpp
+++ b/xfa/fwl/cfwl_widget.cpp
@@ -39,22 +39,10 @@
: m_pOwnerApp(app),
m_pWidgetMgr(app->GetWidgetMgr()),
m_pProperties(std::move(properties)),
- m_pOuter(pOuter),
- m_iLock(0),
- m_pLayoutItem(nullptr),
- m_nEventKey(0),
- m_pDelegate(nullptr) {
+ m_pOuter(pOuter) {
ASSERT(m_pWidgetMgr);
ASSERT(m_pProperties);
-
- CFWL_Widget* pParent = m_pProperties->m_pParent;
- m_pWidgetMgr->InsertWidget(pParent, this);
- if (IsChild())
- return;
-
- CFWL_Widget* pOwner = m_pProperties->m_pOwner;
- if (pOwner)
- m_pWidgetMgr->SetOwner(pOwner, this);
+ m_pWidgetMgr->InsertWidget(m_pProperties->m_pParent, this);
}
CFWL_Widget::~CFWL_Widget() {
diff --git a/xfa/fwl/cfwl_widget.h b/xfa/fwl/cfwl_widget.h
index 6585adc..92491a0 100644
--- a/xfa/fwl/cfwl_widget.h
+++ b/xfa/fwl/cfwl_widget.h
@@ -154,7 +154,7 @@
UnownedPtr<CFWL_WidgetMgr> const m_pWidgetMgr;
std::unique_ptr<CFWL_WidgetProperties> m_pProperties;
CFWL_Widget* m_pOuter;
- int32_t m_iLock;
+ int32_t m_iLock = 0;
private:
CFWL_Widget* GetParent() const { return m_pWidgetMgr->GetParentWidget(this); }
@@ -166,8 +166,8 @@
void NotifyDriver();
bool IsParent(CFWL_Widget* pParent);
- CXFA_FFWidget* m_pLayoutItem;
- uint32_t m_nEventKey;
+ uint32_t m_nEventKey = 0;
+ CXFA_FFWidget* m_pLayoutItem = nullptr;
UnownedPtr<IFWL_WidgetDelegate> m_pDelegate;
};
diff --git a/xfa/fwl/cfwl_widgetproperties.h b/xfa/fwl/cfwl_widgetproperties.h
index 797b8da..5e9cf24 100644
--- a/xfa/fwl/cfwl_widgetproperties.h
+++ b/xfa/fwl/cfwl_widgetproperties.h
@@ -26,7 +26,6 @@
uint32_t m_dwStates = 0;
UnownedPtr<IFWL_ThemeProvider> m_pThemeProvider;
CFWL_Widget* m_pParent = nullptr; // Raw, this class owned by node in tree.
- CFWL_Widget* m_pOwner = nullptr; // Raw, this class owned by node in tree.
};
#endif // XFA_FWL_CFWL_WIDGETPROPERTIES_H_