summaryrefslogtreecommitdiff
path: root/xfa/fwl/lightwidget
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-05-26 17:35:54 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-26 17:35:54 -0700
commit54ab2343c338f55735c37ed6751040791e1df1e2 (patch)
tree59851961d740cb6c913dbdd42d54a8d64bfbf5de /xfa/fwl/lightwidget
parent3bd3841291b46bd7ae31cfb8dc8035e5b4ed4e40 (diff)
downloadpdfium-54ab2343c338f55735c37ed6751040791e1df1e2.tar.xz
Add opaque "layout item" to widgets for caller's use.
This avoids another use of CFX_PrivateData. Note that in the old code, we'd be calling through a m_pImpl onto the same underlying object as we passed as the "key" argument when setting the value, which explains why the get calls, happening one object lower, pass the same argument as which they are being inovked against. Review-Url: https://codereview.chromium.org/2010923002
Diffstat (limited to 'xfa/fwl/lightwidget')
-rw-r--r--xfa/fwl/lightwidget/cfwl_widget.cpp13
-rw-r--r--xfa/fwl/lightwidget/cfwl_widget.h3
2 files changed, 13 insertions, 3 deletions
diff --git a/xfa/fwl/lightwidget/cfwl_widget.cpp b/xfa/fwl/lightwidget/cfwl_widget.cpp
index 0258c27489..239796d03a 100644
--- a/xfa/fwl/lightwidget/cfwl_widget.cpp
+++ b/xfa/fwl/lightwidget/cfwl_widget.cpp
@@ -124,9 +124,7 @@ FWL_Error CFWL_Widget::ModifyStylesEx(uint32_t dwStylesExAdded,
}
uint32_t CFWL_Widget::GetStates() {
- if (!m_pIface)
- return 0;
- return m_pIface->GetStates();
+ return m_pIface ? m_pIface->GetStates() : 0;
}
void CFWL_Widget::SetStates(uint32_t dwStates, FX_BOOL bSet) {
@@ -134,6 +132,15 @@ void CFWL_Widget::SetStates(uint32_t dwStates, FX_BOOL bSet) {
m_pIface->SetStates(dwStates, bSet);
}
+void* CFWL_Widget::GetLayoutItem() const {
+ return m_pIface ? m_pIface->GetLayoutItem() : nullptr;
+}
+
+void CFWL_Widget::SetLayoutItem(void* pItem) {
+ if (m_pIface)
+ m_pIface->SetLayoutItem(pItem);
+}
+
FWL_Error CFWL_Widget::SetPrivateData(void* module_id,
void* pData,
PD_CALLBACK_FREEDATA callback) {
diff --git a/xfa/fwl/lightwidget/cfwl_widget.h b/xfa/fwl/lightwidget/cfwl_widget.h
index 1c29b1f58e..ea17627063 100644
--- a/xfa/fwl/lightwidget/cfwl_widget.h
+++ b/xfa/fwl/lightwidget/cfwl_widget.h
@@ -41,6 +41,9 @@ class CFWL_Widget {
uint32_t dwStylesExRemoved);
uint32_t GetStates();
void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE);
+ void* GetLayoutItem() const;
+ void SetLayoutItem(void* pItem);
+
FWL_Error SetPrivateData(void* module_id,
void* pData,
PD_CALLBACK_FREEDATA callback);