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

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

Issue 2209153002: Use virtual function to retrieve interface pointer (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comment Created 4 years, 4 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/lightwidget/cfwl_checkbox.h ('k') | xfa/fwl/lightwidget/cfwl_combobox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/lightwidget/cfwl_checkbox.cpp
diff --git a/xfa/fwl/lightwidget/cfwl_checkbox.cpp b/xfa/fwl/lightwidget/cfwl_checkbox.cpp
index a93bc4674aaa7b1a1a2d9440a17765c3fa084aca..1f59ee148a1e84bd0f4384e0143c6c51aeb62669 100644
--- a/xfa/fwl/lightwidget/cfwl_checkbox.cpp
+++ b/xfa/fwl/lightwidget/cfwl_checkbox.cpp
@@ -10,6 +10,14 @@
#include "xfa/fwl/core/fwl_error.h"
+IFWL_CheckBox* CFWL_CheckBox::GetWidget() {
+ return static_cast<IFWL_CheckBox*>(m_pIface.get());
+}
+
+const IFWL_CheckBox* CFWL_CheckBox::GetWidget() const {
+ return static_cast<IFWL_CheckBox*>(m_pIface.get());
+}
+
CFWL_CheckBox* CFWL_CheckBox::Create() {
return new CFWL_CheckBox;
}
@@ -26,7 +34,7 @@ FWL_Error CFWL_CheckBox::Initialize(const CFWL_WidgetProperties* pProperties) {
if (ret != FWL_Error::Succeeded) {
return ret;
}
- m_pIface = pCheckBox.release();
+ m_pIface = std::move(pCheckBox);
CFWL_Widget::Initialize();
return FWL_Error::Succeeded;
}
@@ -42,11 +50,11 @@ FWL_Error CFWL_CheckBox::SetBoxSize(FX_FLOAT fHeight) {
}
int32_t CFWL_CheckBox::GetCheckState() {
- return static_cast<IFWL_CheckBox*>(m_pIface)->GetCheckState();
+ return GetWidget()->GetCheckState();
}
FWL_Error CFWL_CheckBox::SetCheckState(int32_t iCheck) {
- return static_cast<IFWL_CheckBox*>(m_pIface)->SetCheckState(iCheck);
+ return GetWidget()->SetCheckState(iCheck);
}
CFWL_CheckBox::CFWL_CheckBox() {}
« no previous file with comments | « xfa/fwl/lightwidget/cfwl_checkbox.h ('k') | xfa/fwl/lightwidget/cfwl_combobox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698