diff options
author | tsepez <tsepez@chromium.org> | 2016-05-27 11:13:09 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-27 11:13:09 -0700 |
commit | a54bc400fa69491ad72ad97f74742ec28cbe849a (patch) | |
tree | 3e3897a7b0014a54a70f4c1d992a76566a2ceb99 /xfa/fwl/lightwidget | |
parent | 816ff7b92ff0f94e4ffaafc975b08d2c4c1a6417 (diff) | |
download | pdfium-a54bc400fa69491ad72ad97f74742ec28cbe849a.tar.xz |
Add back-pointer to "Associated widget" to CFWL_WidgetImp.
This is the last use of CFX_PrivateData, which is now removed.
Review-Url: https://codereview.chromium.org/2016743002
Diffstat (limited to 'xfa/fwl/lightwidget')
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_widget.cpp | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/xfa/fwl/lightwidget/cfwl_widget.cpp b/xfa/fwl/lightwidget/cfwl_widget.cpp index 239796d03a..8022f0afb0 100644 --- a/xfa/fwl/lightwidget/cfwl_widget.cpp +++ b/xfa/fwl/lightwidget/cfwl_widget.cpp @@ -41,12 +41,11 @@ FX_BOOL CFWL_Widget::IsInstance(const CFX_WideStringC& wsClass) const { return m_pIface->IsInstance(wsClass); } -static void* gs_pFWLWidget = (void*)FXBSTR_ID('l', 'i', 'g', 't'); - FWL_Error CFWL_Widget::Initialize(const CFWL_WidgetProperties* pProperties) { if (!m_pIface) return FWL_Error::Indefinite; - return m_pIface->SetPrivateData(gs_pFWLWidget, this, nullptr); + m_pIface->SetAssociateWidget(this); + return FWL_Error::Succeeded; } FWL_Error CFWL_Widget::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { @@ -78,9 +77,10 @@ CFWL_Widget* CFWL_Widget::GetParent() { return nullptr; IFWL_Widget* parent = m_pIface->GetParent(); - if (parent) - return static_cast<CFWL_Widget*>(parent->GetPrivateData(gs_pFWLWidget)); - return nullptr; + if (!parent) + return nullptr; + + return static_cast<CFWL_Widget*>(parent->GetAssociateWidget()); } FWL_Error CFWL_Widget::SetParent(CFWL_Widget* pParent) { @@ -141,20 +141,6 @@ void CFWL_Widget::SetLayoutItem(void* pItem) { m_pIface->SetLayoutItem(pItem); } -FWL_Error CFWL_Widget::SetPrivateData(void* module_id, - void* pData, - PD_CALLBACK_FREEDATA callback) { - if (!m_pIface) - return FWL_Error::Indefinite; - return m_pIface->SetPrivateData(module_id, pData, callback); -} - -void* CFWL_Widget::GetPrivateData(void* module_id) { - if (!m_pIface) - return nullptr; - return m_pIface->GetPrivateData(module_id); -} - FWL_Error CFWL_Widget::Update() { if (!m_pIface) return FWL_Error::Indefinite; |