Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1948)

Unified Diff: xfa/fwl/lightwidget/cfwl_widget.cpp

Issue 2016743002: Add back-pointer to "Associated widget" to CFWL_WidgetImp. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@opaque_layout_item
Patch Set: Initialize m_pAssociate. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/core/ifwl_widget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/lightwidget/cfwl_widget.cpp
diff --git a/xfa/fwl/lightwidget/cfwl_widget.cpp b/xfa/fwl/lightwidget/cfwl_widget.cpp
index 239796d03ae628a94d4726c1b59142ddf3fad94f..8022f0afb046dcc4ebca545dbbb2f86572c462ca 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;
« no previous file with comments | « xfa/fwl/core/ifwl_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698