summaryrefslogtreecommitdiff
path: root/xfa/src/fwl
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src/fwl')
-rw-r--r--xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp25
-rw-r--r--xfa/src/fwl/src/basewidget/fwl_caretimp.cpp29
-rw-r--r--xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp46
-rw-r--r--xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp84
-rw-r--r--xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp92
-rw-r--r--xfa/src/fwl/src/basewidget/fwl_editimp.cpp101
-rw-r--r--xfa/src/fwl/src/basewidget/fwl_listboximp.cpp35
-rw-r--r--xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp29
-rw-r--r--xfa/src/fwl/src/basewidget/fwl_pictureboximp.cpp22
-rw-r--r--xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp22
-rw-r--r--xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp45
-rw-r--r--xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp26
-rw-r--r--xfa/src/fwl/src/basewidget/fwl_tooltipctrlimp.cpp27
-rw-r--r--xfa/src/fwl/src/core/fwl_contentimp.cpp28
-rw-r--r--xfa/src/fwl/src/core/fwl_formimp.cpp42
-rw-r--r--xfa/src/fwl/src/core/fwl_gridimp.cpp76
-rw-r--r--xfa/src/fwl/src/core/fwl_panelimp.cpp53
-rw-r--r--xfa/src/fwl/src/core/fwl_targetimp.cpp22
-rw-r--r--xfa/src/fwl/src/core/fwl_widgetimp.cpp92
-rw-r--r--xfa/src/fwl/src/core/include/fwl_targetimp.h3
20 files changed, 419 insertions, 480 deletions
diff --git a/xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp b/xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp
index 342118e0a1..b0addafe13 100644
--- a/xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp
@@ -14,30 +14,25 @@ IFWL_Barcode* IFWL_Barcode::Create() {
return new IFWL_Barcode;
}
IFWL_Barcode::IFWL_Barcode() {
- m_pImpl = NULL;
-}
-IFWL_Barcode::~IFWL_Barcode() {
- if (m_pImpl) {
- delete (CFWL_BarcodeImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_Barcode::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_BarcodeImp(pOuter);
- ((CFWL_BarcodeImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_BarcodeImp*)m_pImpl)->Initialize();
+ CFWL_BarcodeImp* pBarcodeImpl = new CFWL_BarcodeImp(pOuter);
+ SetImpl(pBarcodeImpl);
+ pBarcodeImpl->SetInterface(this);
+ return pBarcodeImpl->Initialize();
}
FWL_ERR IFWL_Barcode::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_BarcodeImp(properties, pOuter);
- ((CFWL_BarcodeImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_BarcodeImp*)m_pImpl)->Initialize();
+ CFWL_BarcodeImp* pBarcodeImpl = new CFWL_BarcodeImp(properties, pOuter);
+ SetImpl(pBarcodeImpl);
+ pBarcodeImpl->SetInterface(this);
+ return pBarcodeImpl->Initialize();
}
void IFWL_Barcode::SetType(BC_TYPE type) {
- ((CFWL_BarcodeImp*)m_pImpl)->SetType(type);
+ static_cast<CFWL_BarcodeImp*>(GetImpl())->SetType(type);
}
FX_BOOL IFWL_Barcode::IsProtectedType() {
- return ((CFWL_BarcodeImp*)m_pImpl)->IsProtectedType();
+ return static_cast<CFWL_BarcodeImp*>(GetImpl())->IsProtectedType();
}
CFWL_BarcodeImp::CFWL_BarcodeImp(IFWL_Widget* pOuter)
: CFWL_EditImp(pOuter),
diff --git a/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp b/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp
index c0cc74b1bc..856ca02621 100644
--- a/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp
@@ -13,36 +13,31 @@ IFWL_Caret* IFWL_Caret::Create() {
return new IFWL_Caret;
}
IFWL_Caret::IFWL_Caret() {
- m_pImpl = NULL;
-}
-IFWL_Caret::~IFWL_Caret() {
- if (m_pImpl) {
- delete (CFWL_CaretImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_Caret::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_CaretImp(pOuter);
- ((CFWL_CaretImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_CaretImp*)m_pImpl)->Initialize();
+ CFWL_CaretImp* pCaretImpl = new CFWL_CaretImp(pOuter);
+ SetImpl(pCaretImpl);
+ pCaretImpl->SetInterface(this);
+ return pCaretImpl->Initialize();
}
FWL_ERR IFWL_Caret::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_CaretImp(properties, pOuter);
- ((CFWL_CaretImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_CaretImp*)m_pImpl)->Initialize();
+ CFWL_CaretImp* pCaretImpl = new CFWL_CaretImp(properties, pOuter);
+ SetImpl(pCaretImpl);
+ pCaretImpl->SetInterface(this);
+ return pCaretImpl->Initialize();
}
FWL_ERR IFWL_Caret::ShowCaret(FX_BOOL bFlag) {
- return ((CFWL_CaretImp*)m_pImpl)->ShowCaret(bFlag);
+ return static_cast<CFWL_CaretImp*>(GetImpl())->ShowCaret(bFlag);
}
FWL_ERR IFWL_Caret::GetFrequency(FX_DWORD& elapse) {
- return ((CFWL_CaretImp*)m_pImpl)->GetFrequency(elapse);
+ return static_cast<CFWL_CaretImp*>(GetImpl())->GetFrequency(elapse);
}
FWL_ERR IFWL_Caret::SetFrequency(FX_DWORD elapse) {
- return ((CFWL_CaretImp*)m_pImpl)->SetFrequency(elapse);
+ return static_cast<CFWL_CaretImp*>(GetImpl())->SetFrequency(elapse);
}
FWL_ERR IFWL_Caret::SetColor(CFX_Color crFill) {
- return ((CFWL_CaretImp*)m_pImpl)->SetColor(crFill);
+ return static_cast<CFWL_CaretImp*>(GetImpl())->SetColor(crFill);
}
CFWL_CaretImp::CFWL_CaretImp(IFWL_Widget* pOuter) : m_hTimer(NULL) {
m_dwElapse = 400;
diff --git a/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp
index e63d87c97c..b18df4e13f 100644
--- a/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp
@@ -15,53 +15,43 @@ IFWL_CheckBox* IFWL_CheckBox::Create() {
return new IFWL_CheckBox;
}
IFWL_CheckBox::IFWL_CheckBox() {
- m_pImpl = NULL;
-}
-IFWL_CheckBox::~IFWL_CheckBox() {
- if (m_pImpl) {
- delete (CFWL_CheckBoxImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_CheckBox::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_CheckBoxImp(pOuter);
- ((CFWL_CheckBoxImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_CheckBoxImp*)m_pImpl)->Initialize();
+ CFWL_CheckBoxImp* pCheckBoxImpl = new CFWL_CheckBoxImp(pOuter);
+ SetImpl(pCheckBoxImpl);
+ pCheckBoxImpl->SetInterface(this);
+ return pCheckBoxImpl->Initialize();
}
FWL_ERR IFWL_CheckBox::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_CheckBoxImp(properties, pOuter);
- ((CFWL_CheckBoxImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_CheckBoxImp*)m_pImpl)->Initialize();
+ CFWL_CheckBoxImp* pCheckBoxImpl = new CFWL_CheckBoxImp(properties, pOuter);
+ SetImpl(pCheckBoxImpl);
+ pCheckBoxImpl->SetInterface(this);
+ return pCheckBoxImpl->Initialize();
}
int32_t IFWL_CheckBox::GetCheckState() {
- return ((CFWL_CheckBoxImp*)m_pImpl)->GetCheckState();
+ return static_cast<CFWL_CheckBoxImp*>(GetImpl())->GetCheckState();
}
FWL_ERR IFWL_CheckBox::SetCheckState(int32_t iCheck) {
- return ((CFWL_CheckBoxImp*)m_pImpl)->SetCheckState(iCheck);
+ return static_cast<CFWL_CheckBoxImp*>(GetImpl())->SetCheckState(iCheck);
}
IFWL_RadioButton* IFWL_RadioButton::Create() {
return new IFWL_RadioButton;
}
IFWL_RadioButton::IFWL_RadioButton() {
- m_pImpl = NULL;
-}
-IFWL_RadioButton::~IFWL_RadioButton() {
- if (m_pImpl) {
- delete (CFWL_CheckBoxImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_RadioButton::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_CheckBoxImp(pOuter);
- ((CFWL_CheckBoxImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_CheckBoxImp*)m_pImpl)->Initialize();
+ CFWL_CheckBoxImp* pCheckBoxImpl = new CFWL_CheckBoxImp(pOuter);
+ SetImpl(pCheckBoxImpl);
+ pCheckBoxImpl->SetInterface(this);
+ return pCheckBoxImpl->Initialize();
}
FWL_ERR IFWL_RadioButton::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_CheckBoxImp(properties, pOuter);
- ((CFWL_CheckBoxImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_CheckBoxImp*)m_pImpl)->Initialize();
+ CFWL_CheckBoxImp* pCheckBoxImpl = new CFWL_CheckBoxImp(properties, pOuter);
+ SetImpl(pCheckBoxImpl);
+ pCheckBoxImpl->SetInterface(this);
+ return pCheckBoxImpl->Initialize();
}
CFWL_CheckBoxImp::CFWL_CheckBoxImp(IFWL_Widget* pOuter)
: CFWL_WidgetImp(pOuter),
diff --git a/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp
index 74a9da43e4..75a240b104 100644
--- a/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp
@@ -22,117 +22,115 @@ IFWL_ComboBox* IFWL_ComboBox::Create() {
return new IFWL_ComboBox;
}
IFWL_ComboBox::IFWL_ComboBox() {
- m_pImpl = NULL;
-}
-IFWL_ComboBox::~IFWL_ComboBox() {
- if (m_pImpl) {
- delete (CFWL_ComboBoxImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_ComboBox::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_ComboBoxImp(pOuter);
- ((CFWL_ComboBoxImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_ComboBoxImp*)m_pImpl)->Initialize();
+ CFWL_ComboBoxImp* pComboBoxImpl = new CFWL_ComboBoxImp(pOuter);
+ SetImpl(pComboBoxImpl);
+ pComboBoxImpl->SetInterface(this);
+ return pComboBoxImpl->Initialize();
}
FWL_ERR IFWL_ComboBox::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_ComboBoxImp(properties, pOuter);
- ((CFWL_ComboBoxImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_ComboBoxImp*)m_pImpl)->Initialize();
+ CFWL_ComboBoxImp* pComboBoxImpl = new CFWL_ComboBoxImp(properties, pOuter);
+ SetImpl(pComboBoxImpl);
+ pComboBoxImpl->SetInterface(this);
+ return pComboBoxImpl->Initialize();
}
int32_t IFWL_ComboBox::GetCurSel() {
- return ((CFWL_ComboBoxImp*)m_pImpl)->GetCurSel();
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->GetCurSel();
}
FWL_ERR IFWL_ComboBox::SetCurSel(int32_t iSel) {
- return ((CFWL_ComboBoxImp*)m_pImpl)->SetCurSel(iSel);
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->SetCurSel(iSel);
}
FWL_ERR IFWL_ComboBox::SetEditText(const CFX_WideString& wsText) {
- return ((CFWL_ComboBoxImp*)m_pImpl)->SetEditText(wsText);
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->SetEditText(wsText);
}
int32_t IFWL_ComboBox::GetEditTextLength() const {
- return ((CFWL_ComboBoxImp*)m_pImpl)->GetEditTextLength();
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->GetEditTextLength();
}
FWL_ERR IFWL_ComboBox::GetEditText(CFX_WideString& wsText,
int32_t nStart,
int32_t nCount) const {
- return ((CFWL_ComboBoxImp*)m_pImpl)->GetEditText(wsText, nStart, nCount);
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())
+ ->GetEditText(wsText, nStart, nCount);
}
FWL_ERR IFWL_ComboBox::SetEditSelRange(int32_t nStart, int32_t nCount) {
- return ((CFWL_ComboBoxImp*)m_pImpl)->SetEditSelRange(nStart, nCount);
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())
+ ->SetEditSelRange(nStart, nCount);
}
int32_t IFWL_ComboBox::GetEditSelRange(int32_t nIndex, int32_t& nStart) {
- return ((CFWL_ComboBoxImp*)m_pImpl)->GetEditSelRange(nIndex, nStart);
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())
+ ->GetEditSelRange(nIndex, nStart);
}
int32_t IFWL_ComboBox::GetEditLimit() {
- return ((CFWL_ComboBoxImp*)m_pImpl)->GetEditLimit();
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->GetEditLimit();
}
FWL_ERR IFWL_ComboBox::SetEditLimit(int32_t nLimit) {
- return ((CFWL_ComboBoxImp*)m_pImpl)->SetEditLimit(nLimit);
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->SetEditLimit(nLimit);
}
FWL_ERR IFWL_ComboBox::EditDoClipboard(int32_t iCmd) {
- return ((CFWL_ComboBoxImp*)m_pImpl)->EditDoClipboard(iCmd);
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditDoClipboard(iCmd);
}
FX_BOOL IFWL_ComboBox::EditRedo(const CFX_ByteStringC& bsRecord) {
- return ((CFWL_ComboBoxImp*)m_pImpl)->EditRedo(bsRecord);
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditRedo(bsRecord);
}
FX_BOOL IFWL_ComboBox::EditUndo(const CFX_ByteStringC& bsRecord) {
- return ((CFWL_ComboBoxImp*)m_pImpl)->EditUndo(bsRecord);
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditUndo(bsRecord);
}
IFWL_ListBox* IFWL_ComboBox::GetListBoxt() {
- return ((CFWL_ComboBoxImp*)m_pImpl)->GetListBoxt();
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->GetListBoxt();
}
FX_BOOL IFWL_ComboBox::AfterFocusShowDropList() {
- return ((CFWL_ComboBoxImp*)m_pImpl)->AfterFocusShowDropList();
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->AfterFocusShowDropList();
}
FX_ERR IFWL_ComboBox::OpenDropDownList(FX_BOOL bActivate) {
- return ((CFWL_ComboBoxImp*)m_pImpl)->OpenDropDownList(bActivate);
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->OpenDropDownList(bActivate);
}
FX_BOOL IFWL_ComboBox::EditCanUndo() {
- return ((CFWL_ComboBoxImp*)m_pImpl)->EditCanUndo();
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditCanUndo();
}
FX_BOOL IFWL_ComboBox::EditCanRedo() {
- return ((CFWL_ComboBoxImp*)m_pImpl)->EditCanRedo();
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditCanRedo();
}
FX_BOOL IFWL_ComboBox::EditUndo() {
- return ((CFWL_ComboBoxImp*)m_pImpl)->EditUndo();
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditUndo();
}
FX_BOOL IFWL_ComboBox::EditRedo() {
- return ((CFWL_ComboBoxImp*)m_pImpl)->EditRedo();
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditRedo();
}
FX_BOOL IFWL_ComboBox::EditCanCopy() {
- return ((CFWL_ComboBoxImp*)m_pImpl)->EditCanCopy();
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditCanCopy();
}
FX_BOOL IFWL_ComboBox::EditCanCut() {
- return ((CFWL_ComboBoxImp*)m_pImpl)->EditCanCut();
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditCanCut();
}
FX_BOOL IFWL_ComboBox::EditCanSelectAll() {
- return ((CFWL_ComboBoxImp*)m_pImpl)->EditCanSelectAll();
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditCanSelectAll();
}
FX_BOOL IFWL_ComboBox::EditCopy(CFX_WideString& wsCopy) {
- return ((CFWL_ComboBoxImp*)m_pImpl)->EditCopy(wsCopy);
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditCopy(wsCopy);
}
FX_BOOL IFWL_ComboBox::EditCut(CFX_WideString& wsCut) {
- return ((CFWL_ComboBoxImp*)m_pImpl)->EditCut(wsCut);
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditCut(wsCut);
}
FX_BOOL IFWL_ComboBox::EditPaste(const CFX_WideString& wsPaste) {
- return ((CFWL_ComboBoxImp*)m_pImpl)->EditPaste(wsPaste);
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditPaste(wsPaste);
}
FX_BOOL IFWL_ComboBox::EditSelectAll() {
- return ((CFWL_ComboBoxImp*)m_pImpl)->EditSelectAll();
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditSelectAll();
}
FX_BOOL IFWL_ComboBox::EditDelete() {
- return ((CFWL_ComboBoxImp*)m_pImpl)->EditDelete();
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditDelete();
}
FX_BOOL IFWL_ComboBox::EditDeSelect() {
- return ((CFWL_ComboBoxImp*)m_pImpl)->EditDeSelect();
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditDeSelect();
}
FWL_ERR IFWL_ComboBox::GetBBox(CFX_RectF& rect) {
- return ((CFWL_ComboBoxImp*)m_pImpl)->GetBBox(rect);
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())->GetBBox(rect);
}
FWL_ERR IFWL_ComboBox::EditModifyStylesEx(FX_DWORD dwStylesExAdded,
FX_DWORD dwStylesExRemoved) {
- return ((CFWL_ComboBoxImp*)m_pImpl)
+ return static_cast<CFWL_ComboBoxImp*>(GetImpl())
->EditModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
}
CFWL_ComboEditImp::CFWL_ComboEditImp(IFWL_Widget* pOuter)
diff --git a/xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp b/xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp
index 27c370dd88..55f86cf770 100644
--- a/xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp
@@ -23,122 +23,126 @@ IFWL_DateTimePicker* IFWL_DateTimePicker::Create() {
FWL_ERR IFWL_DateTimeForm::Initialize(
const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_FormProxyImp(properties, pOuter);
- ((CFWL_FormProxyImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_FormProxyImp*)m_pImpl)->Initialize();
+ CFWL_FormProxyImp* pFormProxyImpl = new CFWL_FormProxyImp(properties, pOuter);
+ SetImpl(pFormProxyImpl);
+ pFormProxyImpl->SetInterface(this);
+ return pFormProxyImpl->Initialize();
}
FWL_ERR IFWL_DateTimeCalender::Initialize(
const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_DateTimeCalendar(properties, pOuter);
- ((CFWL_DateTimeCalendar*)m_pImpl)->SetInterface(this);
- return ((CFWL_DateTimeCalendar*)m_pImpl)->Initialize();
+ CFWL_DateTimeCalendar* pDateTimeCalendarImpl =
+ new CFWL_DateTimeCalendar(properties, pOuter);
+ SetImpl(pDateTimeCalendarImpl);
+ pDateTimeCalendarImpl->SetInterface(this);
+ return pDateTimeCalendarImpl->Initialize();
}
FWL_ERR IFWL_DateTimeEdit::Initialize(
const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_DateTimeEdit(properties, pOuter);
- ((CFWL_DateTimeEdit*)m_pImpl)->SetInterface(this);
- return ((CFWL_DateTimeEdit*)m_pImpl)->Initialize();
+ CFWL_DateTimeEdit* pDateTimeEditImpl =
+ new CFWL_DateTimeEdit(properties, pOuter);
+ SetImpl(pDateTimeEditImpl);
+ pDateTimeEditImpl->SetInterface(this);
+ return pDateTimeEditImpl->Initialize();
}
IFWL_DateTimePicker::IFWL_DateTimePicker() {
- m_pImpl = NULL;
-}
-IFWL_DateTimePicker::~IFWL_DateTimePicker() {
- if (m_pImpl) {
- delete (CFWL_DateTimePickerImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_DateTimePicker::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_DateTimePickerImp(pOuter);
- ((CFWL_DateTimePickerImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_DateTimePickerImp*)m_pImpl)->Initialize();
+ CFWL_DateTimePickerImp* pDateTimePickerImpl =
+ new CFWL_DateTimePickerImp(pOuter);
+ SetImpl(pDateTimePickerImpl);
+ pDateTimePickerImpl->SetInterface(this);
+ return pDateTimePickerImpl->Initialize();
}
FWL_ERR IFWL_DateTimePicker::Initialize(
const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_DateTimePickerImp(properties, pOuter);
- ((CFWL_DateTimePickerImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_DateTimePickerImp*)m_pImpl)->Initialize();
+ CFWL_DateTimePickerImp* pDateTimePickerImpl =
+ new CFWL_DateTimePickerImp(properties, pOuter);
+ SetImpl(pDateTimePickerImpl);
+ pDateTimePickerImpl->SetInterface(this);
+ return pDateTimePickerImpl->Initialize();
}
int32_t IFWL_DateTimePicker::CountSelRanges() {
- return ((CFWL_DateTimePickerImp*)m_pImpl)
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())
->GetDataTimeEdit()
->CountSelRanges();
}
int32_t IFWL_DateTimePicker::GetSelRange(int32_t nIndex, int32_t& nStart) {
- return ((CFWL_DateTimePickerImp*)m_pImpl)
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())
->GetDataTimeEdit()
->GetSelRange(nIndex, nStart);
}
FWL_ERR IFWL_DateTimePicker::GetCurSel(int32_t& iYear,
int32_t& iMonth,
int32_t& iDay) {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->GetCurSel(iYear, iMonth, iDay);
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())
+ ->GetCurSel(iYear, iMonth, iDay);
}
FWL_ERR IFWL_DateTimePicker::SetCurSel(int32_t iYear,
int32_t iMonth,
int32_t iDay) {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->SetCurSel(iYear, iMonth, iDay);
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())
+ ->SetCurSel(iYear, iMonth, iDay);
}
FWL_ERR IFWL_DateTimePicker::SetEditText(const CFX_WideString& wsText) {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->SetEditText(wsText);
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->SetEditText(wsText);
}
FWL_ERR IFWL_DateTimePicker::GetEditText(CFX_WideString& wsText,
int32_t nStart,
int32_t nCount) const {
- return ((CFWL_DateTimePickerImp*)m_pImpl)
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())
->GetEditText(wsText, nStart, nCount);
}
FX_BOOL IFWL_DateTimePicker::CanUndo() {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->CanUndo();
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->CanUndo();
}
FX_BOOL IFWL_DateTimePicker::CanRedo() {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->CanRedo();
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->CanRedo();
}
FX_BOOL IFWL_DateTimePicker::Undo() {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->Undo();
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->Undo();
}
FX_BOOL IFWL_DateTimePicker::Redo() {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->Redo();
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->Redo();
}
FX_BOOL IFWL_DateTimePicker::CanCopy() {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->CanCopy();
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->CanCopy();
}
FX_BOOL IFWL_DateTimePicker::CanCut() {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->CanCut();
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->CanCut();
}
FX_BOOL IFWL_DateTimePicker::CanSelectAll() {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->CanSelectAll();
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->CanSelectAll();
}
FX_BOOL IFWL_DateTimePicker::Copy(CFX_WideString& wsCopy) {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->Copy(wsCopy);
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->Copy(wsCopy);
}
FX_BOOL IFWL_DateTimePicker::Cut(CFX_WideString& wsCut) {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->Cut(wsCut);
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->Cut(wsCut);
}
FX_BOOL IFWL_DateTimePicker::Paste(const CFX_WideString& wsPaste) {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->Paste(wsPaste);
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->Paste(wsPaste);
}
FX_BOOL IFWL_DateTimePicker::SelectAll() {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->SelectAll();
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->SelectAll();
}
FX_BOOL IFWL_DateTimePicker::Delete() {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->Delete();
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->Delete();
}
FX_BOOL IFWL_DateTimePicker::DeSelect() {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->DeSelect();
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->DeSelect();
}
FWL_ERR IFWL_DateTimePicker::GetBBox(CFX_RectF& rect) {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->GetBBox(rect);
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->GetBBox(rect);
}
FWL_ERR IFWL_DateTimePicker::SetEditLimit(int32_t nLimit) {
- return ((CFWL_DateTimePickerImp*)m_pImpl)->SetEditLimit(nLimit);
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->SetEditLimit(nLimit);
}
FWL_ERR IFWL_DateTimePicker::ModifyEditStylesEx(FX_DWORD dwStylesExAdded,
FX_DWORD dwStylesExRemoved) {
- return ((CFWL_DateTimePickerImp*)m_pImpl)
+ return static_cast<CFWL_DateTimePickerImp*>(GetImpl())
->ModifyEditStylesEx(dwStylesExAdded, dwStylesExRemoved);
}
CFWL_DateTimeEdit::CFWL_DateTimeEdit(const CFWL_WidgetImpProperties& properties,
diff --git a/xfa/src/fwl/src/basewidget/fwl_editimp.cpp b/xfa/src/fwl/src/basewidget/fwl_editimp.cpp
index d70a85aca6..f8f1f59039 100644
--- a/xfa/src/fwl/src/basewidget/fwl_editimp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_editimp.cpp
@@ -18,146 +18,145 @@ IFWL_Edit* IFWL_Edit::Create() {
return new IFWL_Edit;
}
IFWL_Edit::IFWL_Edit() {
- m_pImpl = NULL;
-}
-IFWL_Edit::~IFWL_Edit() {
- if (m_pImpl) {
- delete (CFWL_EditImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_Edit::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_EditImp(pOuter);
- ((CFWL_EditImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_EditImp*)m_pImpl)->Initialize();
+ CFWL_EditImp* pEditImpl = new CFWL_EditImp(pOuter);
+ SetImpl(pEditImpl);
+ pEditImpl->SetInterface(this);
+ return pEditImpl->Initialize();
}
FWL_ERR IFWL_Edit::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_EditImp(properties, pOuter);
- ((CFWL_EditImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_EditImp*)m_pImpl)->Initialize();
+ CFWL_EditImp* pEditImpl = new CFWL_EditImp(properties, pOuter);
+ SetImpl(pEditImpl);
+ pEditImpl->SetInterface(this);
+ return pEditImpl->Initialize();
}
FWL_ERR IFWL_Edit::SetText(const CFX_WideString& wsText) {
- return ((CFWL_EditImp*)m_pImpl)->SetText(wsText);
+ return static_cast<CFWL_EditImp*>(GetImpl())->SetText(wsText);
}
int32_t IFWL_Edit::GetTextLength() const {
- return ((CFWL_EditImp*)m_pImpl)->GetTextLength();
+ return static_cast<CFWL_EditImp*>(GetImpl())->GetTextLength();
}
FWL_ERR IFWL_Edit::GetText(CFX_WideString& wsText,
int32_t nStart,
int32_t nCount) const {
- return ((CFWL_EditImp*)m_pImpl)->GetText(wsText, nStart, nCount);
+ return static_cast<CFWL_EditImp*>(GetImpl())->GetText(wsText, nStart, nCount);
}
FWL_ERR IFWL_Edit::ClearText() {
- return ((CFWL_EditImp*)m_pImpl)->ClearText();
+ return static_cast<CFWL_EditImp*>(GetImpl())->ClearText();
}
int32_t IFWL_Edit::GetCaretPos() const {
- return ((CFWL_EditImp*)m_pImpl)->GetCaretPos();
+ return static_cast<CFWL_EditImp*>(GetImpl())->GetCaretPos();
}
int32_t IFWL_Edit::SetCaretPos(int32_t nIndex, FX_BOOL bBefore) {
- return ((CFWL_EditImp*)m_pImpl)->SetCaretPos(nIndex, bBefore);
+ return static_cast<CFWL_EditImp*>(GetImpl())->SetCaretPos(nIndex, bBefore);
}
FWL_ERR IFWL_Edit::AddSelRange(int32_t nStart, int32_t nCount) {
- return ((CFWL_EditImp*)m_pImpl)->AddSelRange(nStart, nCount);
+ return static_cast<CFWL_EditImp*>(GetImpl())->AddSelRange(nStart, nCount);
}
int32_t IFWL_Edit::CountSelRanges() {
- return ((CFWL_EditImp*)m_pImpl)->CountSelRanges();
+ return static_cast<CFWL_EditImp*>(GetImpl())->CountSelRanges();
}
int32_t IFWL_Edit::GetSelRange(int32_t nIndex, int32_t& nStart) {
- return ((CFWL_EditImp*)m_pImpl)->GetSelRange(nIndex, nStart);
+ return static_cast<CFWL_EditImp*>(GetImpl())->GetSelRange(nIndex, nStart);
}
FWL_ERR IFWL_Edit::ClearSelections() {
- return ((CFWL_EditImp*)m_pImpl)->ClearSelections();
+ return static_cast<CFWL_EditImp*>(GetImpl())->ClearSelections();
}
int32_t IFWL_Edit::GetLimit() {
- return ((CFWL_EditImp*)m_pImpl)->GetLimit();
+ return static_cast<CFWL_EditImp*>(GetImpl())->GetLimit();
}
FWL_ERR IFWL_Edit::SetLimit(int32_t nLimit) {
- return ((CFWL_EditImp*)m_pImpl)->SetLimit(nLimit);
+ return static_cast<CFWL_EditImp*>(GetImpl())->SetLimit(nLimit);
}
FWL_ERR IFWL_Edit::SetAliasChar(FX_WCHAR wAlias) {
- return ((CFWL_EditImp*)m_pImpl)->SetAliasChar(wAlias);
+ return static_cast<CFWL_EditImp*>(GetImpl())->SetAliasChar(wAlias);
}
FWL_ERR IFWL_Edit::SetFormatString(const CFX_WideString& wsFormat) {
- return ((CFWL_EditImp*)m_pImpl)->SetFormatString(wsFormat);
+ return static_cast<CFWL_EditImp*>(GetImpl())->SetFormatString(wsFormat);
}
FWL_ERR IFWL_Edit::Insert(int32_t nStart,
const FX_WCHAR* lpText,
int32_t nLen) {
- return ((CFWL_EditImp*)m_pImpl)->Insert(nStart, lpText, nLen);
+ return static_cast<CFWL_EditImp*>(GetImpl())->Insert(nStart, lpText, nLen);
}
FWL_ERR IFWL_Edit::DeleteSelections() {
- return ((CFWL_EditImp*)m_pImpl)->DeleteSelections();
+ return static_cast<CFWL_EditImp*>(GetImpl())->DeleteSelections();
}
FWL_ERR IFWL_Edit::DeleteRange(int32_t nStart, int32_t nCount) {
- return ((CFWL_EditImp*)m_pImpl)->DeleteRange(nStart, nCount);
+ return static_cast<CFWL_EditImp*>(GetImpl())->DeleteRange(nStart, nCount);
}
FWL_ERR IFWL_Edit::ReplaceSelections(const CFX_WideStringC& wsReplace) {
- return ((CFWL_EditImp*)m_pImpl)->ReplaceSelections(wsReplace);
+ return static_cast<CFWL_EditImp*>(GetImpl())->ReplaceSelections(wsReplace);
}
FWL_ERR IFWL_Edit::Replace(int32_t nStart,
int32_t nLen,
const CFX_WideStringC& wsReplace) {
- return ((CFWL_EditImp*)m_pImpl)->Replace(nStart, nLen, wsReplace);
+ return static_cast<CFWL_EditImp*>(GetImpl())
+ ->Replace(nStart, nLen, wsReplace);
}
FWL_ERR IFWL_Edit::DoClipboard(int32_t iCmd) {
- return ((CFWL_EditImp*)m_pImpl)->DoClipboard(iCmd);
+ return static_cast<CFWL_EditImp*>(GetImpl())->DoClipboard(iCmd);
}
FX_BOOL IFWL_Edit::Copy(CFX_WideString& wsCopy) {
- return ((CFWL_EditImp*)m_pImpl)->Copy(wsCopy);
+ return static_cast<CFWL_EditImp*>(GetImpl())->Copy(wsCopy);
}
FX_BOOL IFWL_Edit::Cut(CFX_WideString& wsCut) {
- return ((CFWL_EditImp*)m_pImpl)->Cut(wsCut);
+ return static_cast<CFWL_EditImp*>(GetImpl())->Cut(wsCut);
}
FX_BOOL IFWL_Edit::Paste(const CFX_WideString& wsPaste) {
- return ((CFWL_EditImp*)m_pImpl)->Paste(wsPaste);
+ return static_cast<CFWL_EditImp*>(GetImpl())->Paste(wsPaste);
}
FX_BOOL IFWL_Edit::Delete() {
- return ((CFWL_EditImp*)m_pImpl)->Delete();
+ return static_cast<CFWL_EditImp*>(GetImpl())->Delete();
}
FX_BOOL IFWL_Edit::Redo(const CFX_ByteStringC& bsRecord) {
- return ((CFWL_EditImp*)m_pImpl)->Redo(bsRecord);
+ return static_cast<CFWL_EditImp*>(GetImpl())->Redo(bsRecord);
}
FX_BOOL IFWL_Edit::Undo(const CFX_ByteStringC& bsRecord) {
- return ((CFWL_EditImp*)m_pImpl)->Undo(bsRecord);
+ return static_cast<CFWL_EditImp*>(GetImpl())->Undo(bsRecord);
}
FX_BOOL IFWL_Edit::Undo() {
- return ((CFWL_EditImp*)m_pImpl)->Undo();
+ return static_cast<CFWL_EditImp*>(GetImpl())->Undo();
}
FX_BOOL IFWL_Edit::Redo() {
- return ((CFWL_EditImp*)m_pImpl)->Redo();
+ return static_cast<CFWL_EditImp*>(GetImpl())->Redo();
}
FX_BOOL IFWL_Edit::CanUndo() {
- return ((CFWL_EditImp*)m_pImpl)->CanUndo();
+ return static_cast<CFWL_EditImp*>(GetImpl())->CanUndo();
}
FX_BOOL IFWL_Edit::CanRedo() {
- return ((CFWL_EditImp*)m_pImpl)->CanRedo();
+ return static_cast<CFWL_EditImp*>(GetImpl())->CanRedo();
}
FWL_ERR IFWL_Edit::SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant) {
- return ((CFWL_EditImp*)m_pImpl)->SetTabWidth(fTabWidth, bEquidistant);
+ return static_cast<CFWL_EditImp*>(GetImpl())
+ ->SetTabWidth(fTabWidth, bEquidistant);
}
FWL_ERR IFWL_Edit::SetOuter(IFWL_Widget* pOuter) {
- return ((CFWL_EditImp*)m_pImpl)->SetOuter(pOuter);
+ return static_cast<CFWL_EditImp*>(GetImpl())->SetOuter(pOuter);
}
FWL_ERR IFWL_Edit::SetNumberRange(int32_t iMin, int32_t iMax) {
- return ((CFWL_EditImp*)m_pImpl)->SetNumberRange(iMin, iMax);
+ return static_cast<CFWL_EditImp*>(GetImpl())->SetNumberRange(iMin, iMax);
}
FWL_ERR IFWL_Edit::SetBackColor(FX_DWORD dwColor) {
- return ((CFWL_EditImp*)m_pImpl)->SetBackgroundColor(dwColor);
+ return static_cast<CFWL_EditImp*>(GetImpl())->SetBackgroundColor(dwColor);
}
FWL_ERR IFWL_Edit::SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize) {
- return ((CFWL_EditImp*)m_pImpl)->SetFont(wsFont, fSize);
+ return static_cast<CFWL_EditImp*>(GetImpl())->SetFont(wsFont, fSize);
}
void IFWL_Edit::SetScrollOffset(FX_FLOAT fScrollOffset) {
- return ((CFWL_EditImp*)m_pImpl)->SetScrollOffset(fScrollOffset);
+ return static_cast<CFWL_EditImp*>(GetImpl())->SetScrollOffset(fScrollOffset);
}
FX_BOOL IFWL_Edit::GetSuggestWords(CFX_PointF pointf,
CFX_ByteStringArray& sSuggest) {
- return ((CFWL_EditImp*)m_pImpl)->GetSuggestWords(pointf, sSuggest);
+ return static_cast<CFWL_EditImp*>(GetImpl())
+ ->GetSuggestWords(pointf, sSuggest);
}
FX_BOOL IFWL_Edit::ReplaceSpellCheckWord(CFX_PointF pointf,
const CFX_ByteStringC& bsReplace) {
- return ((CFWL_EditImp*)m_pImpl)->ReplaceSpellCheckWord(pointf, bsReplace);
+ return static_cast<CFWL_EditImp*>(GetImpl())
+ ->ReplaceSpellCheckWord(pointf, bsReplace);
}
#define FWL_EDIT_Margin 3
CFWL_EditImp::CFWL_EditImp(IFWL_Widget* pOuter)
diff --git a/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp
index 09ef4cd0ae..0b96555b03 100644
--- a/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp
@@ -15,45 +15,40 @@ IFWL_ListBox* IFWL_ListBox::Create() {
return new IFWL_ListBox;
}
IFWL_ListBox::IFWL_ListBox() {
- m_pImpl = NULL;
-}
-IFWL_ListBox::~IFWL_ListBox() {
- if (m_pImpl) {
- delete (CFWL_ListBoxImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_ListBox::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_ListBoxImp(pOuter);
- ((CFWL_ListBoxImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_ListBoxImp*)m_pImpl)->Initialize();
+ CFWL_ListBoxImp* pListBoxImpl = new CFWL_ListBoxImp(pOuter);
+ SetImpl(pListBoxImpl);
+ pListBoxImpl->SetInterface(this);
+ return pListBoxImpl->Initialize();
}
FWL_ERR IFWL_ListBox::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_ListBoxImp(properties, pOuter);
- ((CFWL_ListBoxImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_ListBoxImp*)m_pImpl)->Initialize();
+ CFWL_ListBoxImp* pListBoxImpl = new CFWL_ListBoxImp(properties, pOuter);
+ SetImpl(pListBoxImpl);
+ pListBoxImpl->SetInterface(this);
+ return pListBoxImpl->Initialize();
}
int32_t IFWL_ListBox::CountSelItems() {
- return ((CFWL_ListBoxImp*)m_pImpl)->CountSelItems();
+ return static_cast<CFWL_ListBoxImp*>(GetImpl())->CountSelItems();
}
FWL_HLISTITEM IFWL_ListBox::GetSelItem(int32_t nIndexSel) {
- return ((CFWL_ListBoxImp*)m_pImpl)->GetSelItem(nIndexSel);
+ return static_cast<CFWL_ListBoxImp*>(GetImpl())->GetSelItem(nIndexSel);
}
int32_t IFWL_ListBox::GetSelIndex(int32_t nIndex) {
- return ((CFWL_ListBoxImp*)m_pImpl)->GetSelIndex(nIndex);
+ return static_cast<CFWL_ListBoxImp*>(GetImpl())->GetSelIndex(nIndex);
}
FWL_ERR IFWL_ListBox::SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect) {
- return ((CFWL_ListBoxImp*)m_pImpl)->SetSelItem(hItem, bSelect);
+ return static_cast<CFWL_ListBoxImp*>(GetImpl())->SetSelItem(hItem, bSelect);
}
FWL_ERR IFWL_ListBox::GetItemText(FWL_HLISTITEM hItem, CFX_WideString& wsText) {
- return ((CFWL_ListBoxImp*)m_pImpl)->GetItemText(hItem, wsText);
+ return static_cast<CFWL_ListBoxImp*>(GetImpl())->GetItemText(hItem, wsText);
}
FWL_ERR IFWL_ListBox::GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert) {
- return ((CFWL_ListBoxImp*)m_pImpl)->GetScrollPos(fPos, bVert);
+ return static_cast<CFWL_ListBoxImp*>(GetImpl())->GetScrollPos(fPos, bVert);
}
FWL_ERR* IFWL_ListBox::Sort(IFWL_ListBoxCompare* pCom) {
- return ((CFWL_ListBoxImp*)m_pImpl)->Sort(pCom);
+ return static_cast<CFWL_ListBoxImp*>(GetImpl())->Sort(pCom);
}
CFWL_ListBoxImp::CFWL_ListBoxImp(IFWL_Widget* pOuter)
: CFWL_WidgetImp(pOuter),
diff --git a/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp b/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp
index 6928349106..730c244fe1 100644
--- a/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp
@@ -21,40 +21,37 @@ IFWL_MonthCalendar* IFWL_MonthCalendar::Create() {
return new IFWL_MonthCalendar;
}
IFWL_MonthCalendar::IFWL_MonthCalendar() {
- m_pImpl = NULL;
-}
-IFWL_MonthCalendar::~IFWL_MonthCalendar() {
- if (m_pImpl) {
- delete (CFWL_MonthCalendarImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_MonthCalendar::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_MonthCalendarImp(pOuter);
- ((CFWL_MonthCalendarImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_MonthCalendarImp*)m_pImpl)->Initialize();
+ CFWL_MonthCalendarImp* pMonthCalendarImpl = new CFWL_MonthCalendarImp(pOuter);
+ SetImpl(pMonthCalendarImpl);
+ pMonthCalendarImpl->SetInterface(this);
+ return pMonthCalendarImpl->Initialize();
}
FWL_ERR IFWL_MonthCalendar::Initialize(
const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_MonthCalendarImp(properties, pOuter);
- ((CFWL_MonthCalendarImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_MonthCalendarImp*)m_pImpl)->Initialize();
+ CFWL_MonthCalendarImp* pMonthCalendarImpl =
+ new CFWL_MonthCalendarImp(properties, pOuter);
+ SetImpl(pMonthCalendarImpl);
+ pMonthCalendarImpl->SetInterface(this);
+ return pMonthCalendarImpl->Initialize();
}
int32_t IFWL_MonthCalendar::CountSelect() {
- return ((CFWL_MonthCalendarImp*)m_pImpl)->CountSelect();
+ return static_cast<CFWL_MonthCalendarImp*>(GetImpl())->CountSelect();
}
FX_BOOL IFWL_MonthCalendar::GetSelect(int32_t& iYear,
int32_t& iMonth,
int32_t& iDay,
int32_t nIndex) {
- return ((CFWL_MonthCalendarImp*)m_pImpl)
+ return static_cast<CFWL_MonthCalendarImp*>(GetImpl())
->GetSelect(iYear, iMonth, iDay, nIndex);
}
FX_BOOL IFWL_MonthCalendar::SetSelect(int32_t iYear,
int32_t iMonth,
int32_t iDay) {
- return ((CFWL_MonthCalendarImp*)m_pImpl)->SetSelect(iYear, iMonth, iDay);
+ return static_cast<CFWL_MonthCalendarImp*>(GetImpl())
+ ->SetSelect(iYear, iMonth, iDay);
}
CFWL_MonthCalendarImp::CFWL_MonthCalendarImp(IFWL_Widget* pOuter)
: CFWL_WidgetImp(pOuter),
diff --git a/xfa/src/fwl/src/basewidget/fwl_pictureboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_pictureboximp.cpp
index f8cfa107ea..c1b8d3e07d 100644
--- a/xfa/src/fwl/src/basewidget/fwl_pictureboximp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_pictureboximp.cpp
@@ -13,24 +13,20 @@ IFWL_PictureBox* IFWL_PictureBox::Create() {
return new IFWL_PictureBox;
}
IFWL_PictureBox::IFWL_PictureBox() {
- m_pImpl = NULL;
-}
-IFWL_PictureBox::~IFWL_PictureBox() {
- if (m_pImpl) {
- delete (CFWL_PictureBoxImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_PictureBox::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_PictureBoxImp(pOuter);
- ((CFWL_PictureBoxImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_PictureBoxImp*)m_pImpl)->Initialize();
+ CFWL_PictureBoxImp* pPictureBoxImpl = new CFWL_PictureBoxImp(pOuter);
+ SetImpl(pPictureBoxImpl);
+ pPictureBoxImpl->SetInterface(this);
+ return pPictureBoxImpl->Initialize();
}
FWL_ERR IFWL_PictureBox::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_PictureBoxImp(properties, pOuter);
- ((CFWL_PictureBoxImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_PictureBoxImp*)m_pImpl)->Initialize();
+ CFWL_PictureBoxImp* pPictureBoxImpl =
+ new CFWL_PictureBoxImp(properties, pOuter);
+ SetImpl(pPictureBoxImpl);
+ pPictureBoxImpl->SetInterface(this);
+ return pPictureBoxImpl->Initialize();
}
CFWL_PictureBoxImp::CFWL_PictureBoxImp(IFWL_Widget* pOuter)
: CFWL_WidgetImp(pOuter),
diff --git a/xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp b/xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp
index 6ae0a334c3..c8f986d4f8 100644
--- a/xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp
@@ -13,24 +13,20 @@ IFWL_PushButton* IFWL_PushButton::Create() {
return new IFWL_PushButton;
}
FWL_ERR IFWL_PushButton::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_PushButtonImp(pOuter);
- ((CFWL_PushButtonImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_PushButtonImp*)m_pImpl)->Initialize();
+ CFWL_PushButtonImp* pPushButtonImpl = new CFWL_PushButtonImp(pOuter);
+ SetImpl(pPushButtonImpl);
+ pPushButtonImpl->SetInterface(this);
+ return pPushButtonImpl->Initialize();
}
FWL_ERR IFWL_PushButton::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_PushButtonImp(properties, pOuter);
- ((CFWL_PushButtonImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_PushButtonImp*)m_pImpl)->Initialize();
+ CFWL_PushButtonImp* pPushButtonImpl =
+ new CFWL_PushButtonImp(properties, pOuter);
+ SetImpl(pPushButtonImpl);
+ pPushButtonImpl->SetInterface(this);
+ return pPushButtonImpl->Initialize();
}
IFWL_PushButton::IFWL_PushButton() {
- m_pImpl = NULL;
-}
-IFWL_PushButton::~IFWL_PushButton() {
- if (m_pImpl) {
- delete (CFWL_PushButtonImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
CFWL_PushButtonImp::CFWL_PushButtonImp(IFWL_Widget* pOuter)
: CFWL_WidgetImp(pOuter),
diff --git a/xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp b/xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp
index 02eae32fc0..a3fc2b17e0 100644
--- a/xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp
@@ -15,60 +15,55 @@ IFWL_ScrollBar* IFWL_ScrollBar::Create() {
return new IFWL_ScrollBar;
}
IFWL_ScrollBar::IFWL_ScrollBar() {
- m_pImpl = NULL;
-}
-IFWL_ScrollBar::~IFWL_ScrollBar() {
- if (m_pImpl) {
- delete (CFWL_ScrollBarImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_ScrollBar::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_ScrollBarImp(pOuter);
- ((CFWL_ScrollBarImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_ScrollBarImp*)m_pImpl)->Initialize();
+ CFWL_ScrollBarImp* pScrollBarImpl = new CFWL_ScrollBarImp(pOuter);
+ SetImpl(pScrollBarImpl);
+ pScrollBarImpl->SetInterface(this);
+ return pScrollBarImpl->Initialize();
}
FWL_ERR IFWL_ScrollBar::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_ScrollBarImp(properties, pOuter);
- ((CFWL_ScrollBarImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_ScrollBarImp*)m_pImpl)->Initialize();
+ CFWL_ScrollBarImp* pScrollBarImpl = new CFWL_ScrollBarImp(properties, pOuter);
+ SetImpl(pScrollBarImpl);
+ pScrollBarImpl->SetInterface(this);
+ return pScrollBarImpl->Initialize();
}
FX_BOOL IFWL_ScrollBar::IsVertical() {
- return ((CFWL_ScrollBarImp*)m_pImpl)->IsVertical();
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->IsVertical();
}
FWL_ERR IFWL_ScrollBar::GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax) {
- return ((CFWL_ScrollBarImp*)m_pImpl)->GetRange(fMin, fMax);
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->GetRange(fMin, fMax);
}
FWL_ERR IFWL_ScrollBar::SetRange(FX_FLOAT fMin, FX_FLOAT fMax) {
- return ((CFWL_ScrollBarImp*)m_pImpl)->SetRange(fMin, fMax);
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->SetRange(fMin, fMax);
}
FX_FLOAT IFWL_ScrollBar::GetPageSize() {
- return ((CFWL_ScrollBarImp*)m_pImpl)->GetPageSize();
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->GetPageSize();
}
FWL_ERR IFWL_ScrollBar::SetPageSize(FX_FLOAT fPageSize) {
- return ((CFWL_ScrollBarImp*)m_pImpl)->SetPageSize(fPageSize);
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->SetPageSize(fPageSize);
}
FX_FLOAT IFWL_ScrollBar::GetStepSize() {
- return ((CFWL_ScrollBarImp*)m_pImpl)->GetStepSize();
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->GetStepSize();
}
FWL_ERR IFWL_ScrollBar::SetStepSize(FX_FLOAT fStepSize) {
- return ((CFWL_ScrollBarImp*)m_pImpl)->SetStepSize(fStepSize);
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->SetStepSize(fStepSize);
}
FX_FLOAT IFWL_ScrollBar::GetPos() {
- return ((CFWL_ScrollBarImp*)m_pImpl)->GetPos();
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->GetPos();
}
FWL_ERR IFWL_ScrollBar::SetPos(FX_FLOAT fPos) {
- return ((CFWL_ScrollBarImp*)m_pImpl)->SetPos(fPos);
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->SetPos(fPos);
}
FX_FLOAT IFWL_ScrollBar::GetTrackPos() {
- return ((CFWL_ScrollBarImp*)m_pImpl)->GetTrackPos();
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->GetTrackPos();
}
FWL_ERR IFWL_ScrollBar::SetTrackPos(FX_FLOAT fTrackPos) {
- return ((CFWL_ScrollBarImp*)m_pImpl)->SetTrackPos(fTrackPos);
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->SetTrackPos(fTrackPos);
}
FX_BOOL IFWL_ScrollBar::DoScroll(FX_DWORD dwCode, FX_FLOAT fPos) {
- return ((CFWL_ScrollBarImp*)m_pImpl)->DoScroll(dwCode, fPos);
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->DoScroll(dwCode, fPos);
}
CFWL_ScrollBarImp::CFWL_ScrollBarImp(IFWL_Widget* pOuter)
: CFWL_WidgetImp(pOuter),
diff --git a/xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp b/xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp
index 60614e79f9..382118fd43 100644
--- a/xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp
@@ -16,30 +16,26 @@ IFWL_SpinButton* IFWL_SpinButton::Create() {
return new IFWL_SpinButton;
}
IFWL_SpinButton::IFWL_SpinButton() {
- m_pImpl = NULL;
-}
-IFWL_SpinButton::~IFWL_SpinButton() {
- if (m_pImpl) {
- delete (CFWL_SpinButtonImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_SpinButton::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_SpinButtonImp;
- ((CFWL_SpinButtonImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_SpinButtonImp*)m_pImpl)->Initialize();
+ CFWL_SpinButtonImp* pSpinButtonImpl = new CFWL_SpinButtonImp;
+ SetImpl(pSpinButtonImpl);
+ pSpinButtonImpl->SetInterface(this);
+ return pSpinButtonImpl->Initialize();
}
FWL_ERR IFWL_SpinButton::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_SpinButtonImp(properties);
- ((CFWL_SpinButtonImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_SpinButtonImp*)m_pImpl)->Initialize();
+ CFWL_SpinButtonImp* pSpinButtonImpl = new CFWL_SpinButtonImp(properties);
+ SetImpl(pSpinButtonImpl);
+ pSpinButtonImpl->SetInterface(this);
+ return pSpinButtonImpl->Initialize();
}
FWL_ERR IFWL_SpinButton::EnableButton(FX_BOOL bEnable, FX_BOOL bUp) {
- return ((CFWL_SpinButtonImp*)m_pImpl)->EnableButton(bEnable, bUp);
+ return static_cast<CFWL_SpinButtonImp*>(GetImpl())
+ ->EnableButton(bEnable, bUp);
}
FX_BOOL IFWL_SpinButton::IsButtonEnable(FX_BOOL bUp) {
- return ((CFWL_SpinButtonImp*)m_pImpl)->IsButtonEnable(bUp);
+ return static_cast<CFWL_SpinButtonImp*>(GetImpl())->IsButtonEnable(bUp);
}
CFWL_SpinButtonImp::CFWL_SpinButtonImp(IFWL_Widget* pOuter)
: CFWL_WidgetImp(pOuter),
diff --git a/xfa/src/fwl/src/basewidget/fwl_tooltipctrlimp.cpp b/xfa/src/fwl/src/basewidget/fwl_tooltipctrlimp.cpp
index 6c680f9059..f9ae30fe7d 100644
--- a/xfa/src/fwl/src/basewidget/fwl_tooltipctrlimp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_tooltipctrlimp.cpp
@@ -15,33 +15,28 @@ IFWL_ToolTip* IFWL_ToolTip::Create() {
return new IFWL_ToolTip;
}
FWL_ERR IFWL_ToolTip::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_ToolTipImp(pOuter);
- ((CFWL_ToolTipImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_ToolTipImp*)m_pImpl)->Initialize();
+ CFWL_ToolTipImp* pToolTipImpl = new CFWL_ToolTipImp(pOuter);
+ SetImpl(pToolTipImpl);
+ pToolTipImpl->SetInterface(this);
+ return pToolTipImpl->Initialize();
}
FWL_ERR IFWL_ToolTip::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_ToolTipImp(properties, pOuter);
- ((CFWL_ToolTipImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_ToolTipImp*)m_pImpl)->Initialize();
+ CFWL_ToolTipImp* pToolTipImpl = new CFWL_ToolTipImp(properties, pOuter);
+ SetImpl(pToolTipImpl);
+ pToolTipImpl->SetInterface(this);
+ return pToolTipImpl->Initialize();
}
FWL_ERR IFWL_ToolTip::SetAnchor(const CFX_RectF& rtAnchor) {
- return ((CFWL_ToolTipImp*)m_pImpl)->SetAnchor(rtAnchor);
+ return static_cast<CFWL_ToolTipImp*>(GetImpl())->SetAnchor(rtAnchor);
}
FWL_ERR IFWL_ToolTip::Show() {
- return ((CFWL_ToolTipImp*)m_pImpl)->Show();
+ return static_cast<CFWL_ToolTipImp*>(GetImpl())->Show();
}
FWL_ERR IFWL_ToolTip::Hide() {
- return ((CFWL_ToolTipImp*)m_pImpl)->Hide();
+ return static_cast<CFWL_ToolTipImp*>(GetImpl())->Hide();
}
IFWL_ToolTip::IFWL_ToolTip() {
- m_pImpl = NULL;
-}
-IFWL_ToolTip::~IFWL_ToolTip() {
- if (m_pImpl) {
- delete (CFWL_ToolTipImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
CFWL_ToolTipImp::CFWL_ToolTipImp(IFWL_Widget* pOuter)
: CFWL_FormImp(pOuter),
diff --git a/xfa/src/fwl/src/core/fwl_contentimp.cpp b/xfa/src/fwl/src/core/fwl_contentimp.cpp
index 2fcfbb89de..97d736e087 100644
--- a/xfa/src/fwl/src/core/fwl_contentimp.cpp
+++ b/xfa/src/fwl/src/core/fwl_contentimp.cpp
@@ -15,39 +15,33 @@ IFWL_Content* IFWL_Content::Create() {
return new IFWL_Content;
}
FWL_ERR IFWL_Content::Initialize() {
- m_pImpl = new CFWL_ContentImp;
- ((CFWL_ContentImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_ContentImp*)m_pImpl)->Initialize();
+ CFWL_ContentImp* pContentImpl = new CFWL_ContentImp;
+ SetImpl(pContentImpl);
+ pContentImpl->SetInterface(this);
+ return pContentImpl->Initialize();
}
FWL_ERR IFWL_Content::InsertWidget(IFWL_Widget* pChild, int32_t nIndex) {
- return ((CFWL_ContentImp*)m_pImpl)->InsertWidget(pChild, nIndex);
+ return static_cast<CFWL_ContentImp*>(GetImpl())->InsertWidget(pChild, nIndex);
}
FWL_ERR IFWL_Content::RemoveWidget(IFWL_Widget* pWidget) {
- return ((CFWL_ContentImp*)m_pImpl)->RemoveWidget(pWidget);
+ return static_cast<CFWL_ContentImp*>(GetImpl())->RemoveWidget(pWidget);
}
FWL_ERR IFWL_Content::RemoveAllWidgets() {
- return ((CFWL_ContentImp*)m_pImpl)->RemoveAllWidgets();
+ return static_cast<CFWL_ContentImp*>(GetImpl())->RemoveAllWidgets();
}
FWL_ERR IFWL_Content::GetMinSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight) {
- return ((CFWL_ContentImp*)m_pImpl)->GetMinSize(fWidth, fHeight);
+ return static_cast<CFWL_ContentImp*>(GetImpl())->GetMinSize(fWidth, fHeight);
}
FWL_ERR IFWL_Content::SetMinSize(FX_FLOAT fWidth, FX_FLOAT fHeight) {
- return ((CFWL_ContentImp*)m_pImpl)->SetMinSize(fWidth, fHeight);
+ return static_cast<CFWL_ContentImp*>(GetImpl())->SetMinSize(fWidth, fHeight);
}
FWL_ERR IFWL_Content::GetMaxSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight) {
- return ((CFWL_ContentImp*)m_pImpl)->GetMaxSize(fWidth, fHeight);
+ return static_cast<CFWL_ContentImp*>(GetImpl())->GetMaxSize(fWidth, fHeight);
}
FWL_ERR IFWL_Content::SetMaxSize(FX_FLOAT fWidth, FX_FLOAT fHeight) {
- return ((CFWL_ContentImp*)m_pImpl)->SetMaxSize(fWidth, fHeight);
+ return static_cast<CFWL_ContentImp*>(GetImpl())->SetMaxSize(fWidth, fHeight);
}
IFWL_Content::IFWL_Content() {
- m_pImpl = NULL;
-}
-IFWL_Content::~IFWL_Content() {
- if (m_pImpl) {
- delete (CFWL_ContentImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
CFWL_ContentImp::CFWL_ContentImp() {
m_fWidthMin = 0;
diff --git a/xfa/src/fwl/src/core/fwl_formimp.cpp b/xfa/src/fwl/src/core/fwl_formimp.cpp
index 6dbd03dab3..2e215c4080 100644
--- a/xfa/src/fwl/src/core/fwl_formimp.cpp
+++ b/xfa/src/fwl/src/core/fwl_formimp.cpp
@@ -21,50 +21,46 @@ IFWL_Form* IFWL_Form::Create() {
return new IFWL_Form;
}
FWL_ERR IFWL_Form::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_FormImp(pOuter);
- ((CFWL_FormImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_FormImp*)m_pImpl)->Initialize();
+ CFWL_FormImp* pFormImpl = new CFWL_FormImp(pOuter);
+ SetImpl(pFormImpl);
+ pFormImpl->SetInterface(this);
+ return pFormImpl->Initialize();
}
FWL_ERR IFWL_Form::Initialize(CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_FormImp(properties, pOuter);
- ((CFWL_FormImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_FormImp*)m_pImpl)->Initialize();
+ CFWL_FormImp* pFormImpl = new CFWL_FormImp(properties, pOuter);
+ SetImpl(pFormImpl);
+ pFormImpl->SetInterface(this);
+ return pFormImpl->Initialize();
}
FWL_ERR IFWL_Form::Initialize(CFWL_WidgetImpProperties& properties,
CFX_WideString* classname,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_FormImp(properties, pOuter);
- ((CFWL_FormImp*)m_pImpl)->SetInterface(this);
- ((CFWL_FormImp*)m_pImpl)->SetPrivateData(this, classname, NULL);
- return ((CFWL_FormImp*)m_pImpl)->Initialize();
+ CFWL_FormImp* pFormImpl = new CFWL_FormImp(properties, pOuter);
+ SetImpl(pFormImpl);
+ pFormImpl->SetInterface(this);
+ pFormImpl->SetPrivateData(this, classname, NULL);
+ return pFormImpl->Initialize();
}
FWL_FORMSIZE IFWL_Form::GetFormSize() {
- return ((CFWL_FormImp*)m_pImpl)->GetFormSize();
+ return static_cast<CFWL_FormImp*>(GetImpl())->GetFormSize();
}
FWL_ERR IFWL_Form::SetFormSize(FWL_FORMSIZE eFormSize) {
- return ((CFWL_FormImp*)m_pImpl)->SetFormSize(eFormSize);
+ return static_cast<CFWL_FormImp*>(GetImpl())->SetFormSize(eFormSize);
}
IFWL_Widget* IFWL_Form::DoModal() {
- return ((CFWL_FormImp*)m_pImpl)->DoModal();
+ return static_cast<CFWL_FormImp*>(GetImpl())->DoModal();
}
IFWL_Widget* IFWL_Form::DoModal(FX_DWORD& dwCommandID) {
- return ((CFWL_FormImp*)m_pImpl)->DoModal(dwCommandID);
+ return static_cast<CFWL_FormImp*>(GetImpl())->DoModal(dwCommandID);
}
FWL_ERR IFWL_Form::EndDoModal() {
- return ((CFWL_FormImp*)m_pImpl)->EndDoModal();
+ return static_cast<CFWL_FormImp*>(GetImpl())->EndDoModal();
}
FWL_ERR IFWL_Form::SetBorderRegion(CFX_Path* pPath) {
- return ((CFWL_FormImp*)m_pImpl)->SetBorderRegion(pPath);
+ return static_cast<CFWL_FormImp*>(GetImpl())->SetBorderRegion(pPath);
}
IFWL_Form::IFWL_Form() {
- m_pImpl = NULL;
-}
-IFWL_Form::~IFWL_Form() {
- if (m_pImpl) {
- delete (CFWL_FormImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
CFWL_FormImp::CFWL_FormImp(IFWL_Widget* pOuter)
: CFWL_PanelImp(pOuter),
diff --git a/xfa/src/fwl/src/core/fwl_gridimp.cpp b/xfa/src/fwl/src/core/fwl_gridimp.cpp
index 95dbfe5219..433deabbb1 100644
--- a/xfa/src/fwl/src/core/fwl_gridimp.cpp
+++ b/xfa/src/fwl/src/core/fwl_gridimp.cpp
@@ -15,114 +15,118 @@ IFWL_Grid* IFWL_Grid::Create() {
return new IFWL_Grid;
}
FWL_ERR IFWL_Grid::Initialize() {
- m_pImpl = new CFWL_GridImp;
- ((CFWL_GridImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_GridImp*)m_pImpl)->Initialize();
+ CFWL_GridImp* pGridImpl = new CFWL_GridImp;
+ SetImpl(pGridImpl);
+ pGridImpl->SetInterface(this);
+ return pGridImpl->Initialize();
}
FWL_ERR IFWL_Grid::Initialize(CFWL_WidgetImpProperties& properties) {
- m_pImpl = new CFWL_GridImp(properties);
- ((CFWL_GridImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_GridImp*)m_pImpl)->Initialize();
+ CFWL_GridImp* pGridImpl = new CFWL_GridImp(properties);
+ SetImpl(pGridImpl);
+ pGridImpl->SetInterface(this);
+ return pGridImpl->Initialize();
}
FWL_HGRIDCOLROW IFWL_Grid::InsertColRow(FX_BOOL bColumn, int32_t nIndex) {
- return ((CFWL_GridImp*)m_pImpl)->InsertColRow(bColumn, nIndex);
+ return static_cast<CFWL_GridImp*>(GetImpl())->InsertColRow(bColumn, nIndex);
}
int32_t IFWL_Grid::CountColRows(FX_BOOL bColumn) {
- return ((CFWL_GridImp*)m_pImpl)->CountColRows(bColumn);
+ return static_cast<CFWL_GridImp*>(GetImpl())->CountColRows(bColumn);
}
FWL_HGRIDCOLROW IFWL_Grid::GetColRow(FX_BOOL bColumn, int32_t nIndex) {
- return ((CFWL_GridImp*)m_pImpl)->GetColRow(bColumn, nIndex);
+ return static_cast<CFWL_GridImp*>(GetImpl())->GetColRow(bColumn, nIndex);
}
int32_t IFWL_Grid::GetIndex(FWL_HGRIDCOLROW hColRow) {
- return ((CFWL_GridImp*)m_pImpl)->GetIndex(hColRow);
+ return static_cast<CFWL_GridImp*>(GetImpl())->GetIndex(hColRow);
}
FX_FLOAT IFWL_Grid::GetSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT& eUnit) {
- return ((CFWL_GridImp*)m_pImpl)->GetSize(hColRow, eUnit);
+ return static_cast<CFWL_GridImp*>(GetImpl())->GetSize(hColRow, eUnit);
}
FWL_ERR IFWL_Grid::SetSize(FWL_HGRIDCOLROW hColRow,
FX_FLOAT fSize,
FWL_GRIDUNIT eUnit) {
- return ((CFWL_GridImp*)m_pImpl)->SetSize(hColRow, fSize, eUnit);
+ return static_cast<CFWL_GridImp*>(GetImpl())->SetSize(hColRow, fSize, eUnit);
}
FX_FLOAT IFWL_Grid::GetMinSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT& eUnit) {
- return ((CFWL_GridImp*)m_pImpl)->GetMinSize(hColRow, eUnit);
+ return static_cast<CFWL_GridImp*>(GetImpl())->GetMinSize(hColRow, eUnit);
}
FWL_ERR IFWL_Grid::SetMinSize(FWL_HGRIDCOLROW hColRow,
FX_FLOAT fSize,
FWL_GRIDUNIT eUnit) {
- return ((CFWL_GridImp*)m_pImpl)->SetMinSize(hColRow, fSize, eUnit);
+ return static_cast<CFWL_GridImp*>(GetImpl())
+ ->SetMinSize(hColRow, fSize, eUnit);
}
FX_FLOAT IFWL_Grid::GetMaxSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT& eUnit) {
- return ((CFWL_GridImp*)m_pImpl)->GetMaxSize(hColRow, eUnit);
+ return static_cast<CFWL_GridImp*>(GetImpl())->GetMaxSize(hColRow, eUnit);
}
FWL_ERR IFWL_Grid::SetMaxSize(FWL_HGRIDCOLROW hColRow,
FX_FLOAT fSize,
FWL_GRIDUNIT eUnit) {
- return ((CFWL_GridImp*)m_pImpl)->SetMaxSize(hColRow, fSize, eUnit);
+ return static_cast<CFWL_GridImp*>(GetImpl())
+ ->SetMaxSize(hColRow, fSize, eUnit);
}
FX_BOOL IFWL_Grid::DeleteColRow(FWL_HGRIDCOLROW hColRow) {
- return ((CFWL_GridImp*)m_pImpl)->DeleteColRow(hColRow);
+ return static_cast<CFWL_GridImp*>(GetImpl())->DeleteColRow(hColRow);
}
FX_BOOL IFWL_Grid::IsColumn(FWL_HGRIDCOLROW hColRow) {
- return ((CFWL_GridImp*)m_pImpl)->IsColumn(hColRow);
+ return static_cast<CFWL_GridImp*>(GetImpl())->IsColumn(hColRow);
}
int32_t IFWL_Grid::GetWidgetPos(IFWL_Widget* pWidget, FX_BOOL bColumn) {
- return ((CFWL_GridImp*)m_pImpl)->GetWidgetPos(pWidget, bColumn);
+ return static_cast<CFWL_GridImp*>(GetImpl())->GetWidgetPos(pWidget, bColumn);
}
FWL_ERR IFWL_Grid::SetWidgetPos(IFWL_Widget* pWidget,
int32_t iPos,
FX_BOOL bColumn) {
- return ((CFWL_GridImp*)m_pImpl)->SetWidgetPos(pWidget, iPos, bColumn);
+ return static_cast<CFWL_GridImp*>(GetImpl())
+ ->SetWidgetPos(pWidget, iPos, bColumn);
}
int32_t IFWL_Grid::GetWidgetSpan(IFWL_Widget* pWidget, FX_BOOL bColumn) {
- return ((CFWL_GridImp*)m_pImpl)->GetWidgetSpan(pWidget, bColumn);
+ return static_cast<CFWL_GridImp*>(GetImpl())->GetWidgetSpan(pWidget, bColumn);
}
FWL_ERR IFWL_Grid::SetWidgetSpan(IFWL_Widget* pWidget,
int32_t iSpan,
FX_BOOL bColumn) {
- return ((CFWL_GridImp*)m_pImpl)->SetWidgetSpan(pWidget, iSpan, bColumn);
+ return static_cast<CFWL_GridImp*>(GetImpl())
+ ->SetWidgetSpan(pWidget, iSpan, bColumn);
}
FX_FLOAT IFWL_Grid::GetWidgetSize(IFWL_Widget* pWidget,
FWL_GRIDSIZE eSize,
FWL_GRIDUNIT& eUnit) {
- return ((CFWL_GridImp*)m_pImpl)->GetWidgetSize(pWidget, eSize, eUnit);
+ return static_cast<CFWL_GridImp*>(GetImpl())
+ ->GetWidgetSize(pWidget, eSize, eUnit);
}
FWL_ERR IFWL_Grid::SetWidgetSize(IFWL_Widget* pWidget,
FWL_GRIDSIZE eSize,
FX_FLOAT fSize,
FWL_GRIDUNIT eUit) {
- return ((CFWL_GridImp*)m_pImpl)->SetWidgetSize(pWidget, eSize, fSize, eUit);
+ return static_cast<CFWL_GridImp*>(GetImpl())
+ ->SetWidgetSize(pWidget, eSize, fSize, eUit);
}
FX_BOOL IFWL_Grid::GetWidgetMargin(IFWL_Widget* pWidget,
FWL_GRIDMARGIN eMargin,
FX_FLOAT& fMargin) {
- return ((CFWL_GridImp*)m_pImpl)->GetWidgetMargin(pWidget, eMargin, fMargin);
+ return static_cast<CFWL_GridImp*>(GetImpl())
+ ->GetWidgetMargin(pWidget, eMargin, fMargin);
}
FWL_ERR IFWL_Grid::SetWidgetMargin(IFWL_Widget* pWidget,
FWL_GRIDMARGIN eMargin,
FX_FLOAT fMargin) {
- return ((CFWL_GridImp*)m_pImpl)->SetWidgetMargin(pWidget, eMargin, fMargin);
+ return static_cast<CFWL_GridImp*>(GetImpl())
+ ->SetWidgetMargin(pWidget, eMargin, fMargin);
}
FWL_ERR IFWL_Grid::RemoveWidgetMargin(IFWL_Widget* pWidget,
FWL_GRIDMARGIN eMargin) {
- return ((CFWL_GridImp*)m_pImpl)->RemoveWidgetMargin(pWidget, eMargin);
+ return static_cast<CFWL_GridImp*>(GetImpl())
+ ->RemoveWidgetMargin(pWidget, eMargin);
}
FX_FLOAT IFWL_Grid::GetGridSize(FWL_GRIDSIZE eSize, FWL_GRIDUNIT& eUnit) {
- return ((CFWL_GridImp*)m_pImpl)->GetGridSize(eSize, eUnit);
+ return static_cast<CFWL_GridImp*>(GetImpl())->GetGridSize(eSize, eUnit);
}
FWL_ERR IFWL_Grid::SetGridSize(FWL_GRIDSIZE eSize,
FX_FLOAT fSize,
FWL_GRIDUNIT eUit) {
- return ((CFWL_GridImp*)m_pImpl)->SetGridSize(eSize, fSize, eUit);
+ return static_cast<CFWL_GridImp*>(GetImpl())->SetGridSize(eSize, fSize, eUit);
}
IFWL_Grid::IFWL_Grid() {
- m_pImpl = NULL;
-}
-IFWL_Grid::~IFWL_Grid() {
- if (m_pImpl) {
- delete (CFWL_GridImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
CFWL_GridImp::CFWL_GridImp() {
m_Size[FWL_GRIDSIZE_Width].eUnit = FWL_GRIDUNIT_Auto;
diff --git a/xfa/src/fwl/src/core/fwl_panelimp.cpp b/xfa/src/fwl/src/core/fwl_panelimp.cpp
index aef3521c5f..e127ff6096 100644
--- a/xfa/src/fwl/src/core/fwl_panelimp.cpp
+++ b/xfa/src/fwl/src/core/fwl_panelimp.cpp
@@ -13,30 +13,25 @@ IFWL_Panel* IFWL_Panel::Create() {
return new IFWL_Panel;
}
FWL_ERR IFWL_Panel::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_PanelImp(pOuter);
- ((CFWL_PanelImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_PanelImp*)m_pImpl)->Initialize();
+ CFWL_PanelImp* pPanelImpl = new CFWL_PanelImp(pOuter);
+ SetImpl(pPanelImpl);
+ pPanelImpl->SetInterface(this);
+ return pPanelImpl->Initialize();
}
FWL_ERR IFWL_Panel::Initialize(CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_PanelImp(properties, pOuter);
- ((CFWL_PanelImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_PanelImp*)m_pImpl)->Initialize();
+ CFWL_PanelImp* pPanelImpl = new CFWL_PanelImp(properties, pOuter);
+ SetImpl(pPanelImpl);
+ pPanelImpl->SetInterface(this);
+ return pPanelImpl->Initialize();
}
IFWL_Content* IFWL_Panel::GetContent() {
- return ((CFWL_PanelImp*)m_pImpl)->GetContent();
+ return static_cast<CFWL_PanelImp*>(GetImpl())->GetContent();
}
FWL_ERR IFWL_Panel::SetContent(IFWL_Content* pContent) {
- return ((CFWL_PanelImp*)m_pImpl)->SetContent(pContent);
+ return static_cast<CFWL_PanelImp*>(GetImpl())->SetContent(pContent);
}
IFWL_Panel::IFWL_Panel() {
- m_pImpl = NULL;
-}
-IFWL_Panel::~IFWL_Panel() {
- if (m_pImpl) {
- delete (CFWL_PanelImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
CFWL_PanelImp::CFWL_PanelImp(IFWL_Widget* pOuter)
: CFWL_WidgetImp(pOuter), m_pContent(NULL) {}
@@ -142,31 +137,27 @@ IFWL_CustomPanel* IFWL_CustomPanel::Create() {
return new IFWL_CustomPanel;
}
FWL_ERR IFWL_CustomPanel::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_CustomPanelImp(pOuter);
- ((CFWL_CustomPanelImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_CustomPanelImp*)m_pImpl)->Initialize();
+ CFWL_CustomPanelImp* pCustomPanelImpl = new CFWL_CustomPanelImp(pOuter);
+ SetImpl(pCustomPanelImpl);
+ pCustomPanelImpl->SetInterface(this);
+ return pCustomPanelImpl->Initialize();
}
FWL_ERR IFWL_CustomPanel::Initialize(CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_CustomPanelImp(properties, pOuter);
- ((CFWL_CustomPanelImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_CustomPanelImp*)m_pImpl)->Initialize();
+ CFWL_CustomPanelImp* pCustomPanelImpl =
+ new CFWL_CustomPanelImp(properties, pOuter);
+ SetImpl(pCustomPanelImpl);
+ pCustomPanelImpl->SetInterface(this);
+ return pCustomPanelImpl->Initialize();
}
IFWL_Content* IFWL_CustomPanel::GetContent() {
- return ((CFWL_CustomPanelImp*)m_pImpl)->GetContent();
+ return static_cast<CFWL_CustomPanelImp*>(GetImpl())->GetContent();
}
FWL_ERR IFWL_CustomPanel::SetContent(IFWL_Content* pContent) {
- return ((CFWL_CustomPanelImp*)m_pImpl)->SetContent(pContent);
+ return static_cast<CFWL_CustomPanelImp*>(GetImpl())->SetContent(pContent);
}
FWL_ERR IFWL_CustomPanel::SetProxy(IFWL_Proxy* pProxy) {
- return ((CFWL_CustomPanelImp*)m_pImpl)->SetProxy(pProxy);
+ return static_cast<CFWL_CustomPanelImp*>(GetImpl())->SetProxy(pProxy);
}
IFWL_CustomPanel::IFWL_CustomPanel() {
- m_pImpl = NULL;
-}
-IFWL_CustomPanel::~IFWL_CustomPanel() {
- if (m_pImpl) {
- delete (CFWL_CustomPanelImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
diff --git a/xfa/src/fwl/src/core/fwl_targetimp.cpp b/xfa/src/fwl/src/core/fwl_targetimp.cpp
index 1acc56a018..0ae40d11f4 100644
--- a/xfa/src/fwl/src/core/fwl_targetimp.cpp
+++ b/xfa/src/fwl/src/core/fwl_targetimp.cpp
@@ -7,35 +7,37 @@
#include "../../../foxitlib.h"
#include "include/fwl_targetimp.h"
FX_DWORD IFWL_Target::Release() {
- FX_DWORD dwRef = ((CFWL_TargetImp*)m_pImpl)->Release();
+ FX_DWORD dwRef = m_pImpl->Release();
if (!dwRef) {
- m_pImpl = NULL;
+ m_pImpl = nullptr;
delete this;
}
return dwRef;
}
IFWL_Target* IFWL_Target::Retain() {
- return ((CFWL_TargetImp*)m_pImpl)->Retain();
+ return m_pImpl->Retain();
}
FX_DWORD IFWL_Target::GetRefCount() const {
- return ((CFWL_TargetImp*)m_pImpl)->GetRefCount();
+ return m_pImpl->GetRefCount();
}
FWL_ERR IFWL_Target::GetClassName(CFX_WideString& wsClass) const {
- return ((CFWL_TargetImp*)m_pImpl)->GetClassName(wsClass);
+ return m_pImpl->GetClassName(wsClass);
}
FX_DWORD IFWL_Target::GetClassID() const {
- return ((CFWL_TargetImp*)m_pImpl)->GetClassID();
+ return m_pImpl->GetClassID();
}
FX_BOOL IFWL_Target::IsInstance(const CFX_WideStringC& wsClass) const {
- return ((CFWL_TargetImp*)m_pImpl)->IsInstance(wsClass);
+ return m_pImpl->IsInstance(wsClass);
}
FWL_ERR IFWL_Target::Initialize() {
- return ((CFWL_TargetImp*)m_pImpl)->Initialize();
+ return m_pImpl->Initialize();
}
FWL_ERR IFWL_Target::Finalize() {
- return ((CFWL_TargetImp*)m_pImpl)->Finalize();
+ return m_pImpl->Finalize();
+}
+IFWL_Target::~IFWL_Target() {
+ delete m_pImpl;
}
-IFWL_Target::~IFWL_Target() {}
CFWL_TargetImp::CFWL_TargetImp() : m_dwRefCount(1) {
}
CFWL_TargetImp::~CFWL_TargetImp() {
diff --git a/xfa/src/fwl/src/core/fwl_widgetimp.cpp b/xfa/src/fwl/src/core/fwl_widgetimp.cpp
index 923e09c678..78daae08a7 100644
--- a/xfa/src/fwl/src/core/fwl_widgetimp.cpp
+++ b/xfa/src/fwl/src/core/fwl_widgetimp.cpp
@@ -12,109 +12,114 @@
#include "include/fwl_widgetmgrimp.h"
#include "include/fwl_widgetimp.h"
FWL_ERR IFWL_Widget::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
- return ((CFWL_WidgetImp*)m_pImpl)->GetWidgetRect(rect, bAutoSize);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())
+ ->GetWidgetRect(rect, bAutoSize);
}
FWL_ERR IFWL_Widget::GetGlobalRect(CFX_RectF& rect) {
- return ((CFWL_WidgetImp*)m_pImpl)->GetGlobalRect(rect);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->GetGlobalRect(rect);
}
FWL_ERR IFWL_Widget::SetWidgetRect(const CFX_RectF& rect) {
- return ((CFWL_WidgetImp*)m_pImpl)->SetWidgetRect(rect);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->SetWidgetRect(rect);
}
FWL_ERR IFWL_Widget::GetClientRect(CFX_RectF& rect) {
- return ((CFWL_WidgetImp*)m_pImpl)->GetClientRect(rect);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->GetClientRect(rect);
}
IFWL_Widget* IFWL_Widget::GetParent() {
- return ((CFWL_WidgetImp*)m_pImpl)->GetParent();
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->GetParent();
}
FWL_ERR IFWL_Widget::SetParent(IFWL_Widget* pParent) {
- return ((CFWL_WidgetImp*)m_pImpl)->SetParent(pParent);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->SetParent(pParent);
}
IFWL_Widget* IFWL_Widget::GetOwner() {
- return ((CFWL_WidgetImp*)m_pImpl)->GetOwner();
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOwner();
}
FWL_ERR IFWL_Widget::SetOwner(IFWL_Widget* pOwner) {
- return ((CFWL_WidgetImp*)m_pImpl)->SetOwner(pOwner);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->SetOwner(pOwner);
}
IFWL_Widget* IFWL_Widget::GetOuter() {
- return ((CFWL_WidgetImp*)m_pImpl)->GetOuter();
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOuter();
}
FX_DWORD IFWL_Widget::GetStyles() {
- return ((CFWL_WidgetImp*)m_pImpl)->GetStyles();
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStyles();
}
FWL_ERR IFWL_Widget::ModifyStyles(FX_DWORD dwStylesAdded,
FX_DWORD dwStylesRemoved) {
- return ((CFWL_WidgetImp*)m_pImpl)
+ return static_cast<CFWL_WidgetImp*>(GetImpl())
->ModifyStyles(dwStylesAdded, dwStylesRemoved);
}
FX_DWORD IFWL_Widget::GetStylesEx() {
- return ((CFWL_WidgetImp*)m_pImpl)->GetStylesEx();
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStylesEx();
}
FWL_ERR IFWL_Widget::ModifyStylesEx(FX_DWORD dwStylesExAdded,
FX_DWORD dwStylesExRemoved) {
- return ((CFWL_WidgetImp*)m_pImpl)
+ return static_cast<CFWL_WidgetImp*>(GetImpl())
->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
}
FX_DWORD IFWL_Widget::GetStates() {
- return ((CFWL_WidgetImp*)m_pImpl)->GetStates();
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStates();
}
FWL_ERR IFWL_Widget::SetStates(FX_DWORD dwStates, FX_BOOL bSet) {
- return ((CFWL_WidgetImp*)m_pImpl)->SetStates(dwStates, bSet);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->SetStates(dwStates, bSet);
}
FWL_ERR IFWL_Widget::SetPrivateData(void* module_id,
void* pData,
PD_CALLBACK_FREEDATA callback) {
- return ((CFWL_WidgetImp*)m_pImpl)->SetPrivateData(module_id, pData, callback);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())
+ ->SetPrivateData(module_id, pData, callback);
}
void* IFWL_Widget::GetPrivateData(void* module_id) {
- return ((CFWL_WidgetImp*)m_pImpl)->GetPrivateData(module_id);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->GetPrivateData(module_id);
}
FWL_ERR IFWL_Widget::Update() {
- return ((CFWL_WidgetImp*)m_pImpl)->Update();
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->Update();
}
FWL_ERR IFWL_Widget::LockUpdate() {
- return ((CFWL_WidgetImp*)m_pImpl)->LockUpdate();
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->LockUpdate();
}
FWL_ERR IFWL_Widget::UnlockUpdate() {
- return ((CFWL_WidgetImp*)m_pImpl)->UnlockUpdate();
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->UnlockUpdate();
}
FX_DWORD IFWL_Widget::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
- return ((CFWL_WidgetImp*)m_pImpl)->HitTest(fx, fy);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->HitTest(fx, fy);
}
FWL_ERR IFWL_Widget::TransformTo(IFWL_Widget* pWidget,
FX_FLOAT& fx,
FX_FLOAT& fy) {
- return ((CFWL_WidgetImp*)m_pImpl)->TransformTo(pWidget, fx, fy);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->TransformTo(pWidget, fx, fy);
}
FWL_ERR IFWL_Widget::TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt) {
- return ((CFWL_WidgetImp*)m_pImpl)->TransformTo(pWidget, rt);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->TransformTo(pWidget, rt);
}
FWL_ERR IFWL_Widget::GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal) {
- return ((CFWL_WidgetImp*)m_pImpl)->GetMatrix(matrix, bGlobal);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->GetMatrix(matrix, bGlobal);
}
FWL_ERR IFWL_Widget::SetMatrix(const CFX_Matrix& matrix) {
- return ((CFWL_WidgetImp*)m_pImpl)->SetMatrix(matrix);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->SetMatrix(matrix);
}
FWL_ERR IFWL_Widget::DrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) {
- return ((CFWL_WidgetImp*)m_pImpl)->DrawWidget(pGraphics, pMatrix);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())
+ ->DrawWidget(pGraphics, pMatrix);
}
IFWL_ThemeProvider* IFWL_Widget::GetThemeProvider() {
- return ((CFWL_WidgetImp*)m_pImpl)->GetThemeProvider();
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->GetThemeProvider();
}
FWL_ERR IFWL_Widget::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
- return ((CFWL_WidgetImp*)m_pImpl)->SetThemeProvider(pThemeProvider);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())
+ ->SetThemeProvider(pThemeProvider);
}
FWL_ERR IFWL_Widget::SetDataProvider(IFWL_DataProvider* pDataProvider) {
- return ((CFWL_WidgetImp*)m_pImpl)->SetDataProvider(pDataProvider);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())
+ ->SetDataProvider(pDataProvider);
}
IFWL_WidgetDelegate* IFWL_Widget::SetDelegate(IFWL_WidgetDelegate* pDelegate) {
- return ((CFWL_WidgetImp*)m_pImpl)->SetDelegate(pDelegate);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->SetDelegate(pDelegate);
}
IFWL_NoteThread* IFWL_Widget::GetOwnerThread() const {
- return ((CFWL_WidgetImp*)m_pImpl)->GetOwnerThread();
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOwnerThread();
}
CFX_SizeF IFWL_Widget::GetOffsetFromParent(IFWL_Widget* pParent) {
- return ((CFWL_WidgetImp*)m_pImpl)->GetOffsetFromParent(pParent);
+ return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOffsetFromParent(pParent);
}
FWL_ERR CFWL_WidgetImp::Initialize() {
IFWL_App* pApp = FWL_GetApp();
@@ -1115,27 +1120,22 @@ IFWL_Custom* IFWL_Custom::Create() {
return new IFWL_Custom;
}
IFWL_Custom::IFWL_Custom() {
- m_pImpl = NULL;
-}
-IFWL_Custom::~IFWL_Custom() {
- if (m_pImpl) {
- delete (CFWL_Custom*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_Custom::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_Custom(pOuter);
- ((CFWL_Custom*)m_pImpl)->SetInterface(this);
- return ((CFWL_Custom*)m_pImpl)->Initialize();
+ CFWL_Custom* pCustomImpl = new CFWL_Custom(pOuter);
+ SetImpl(pCustomImpl);
+ pCustomImpl->SetInterface(this);
+ return pCustomImpl->Initialize();
}
FWL_ERR IFWL_Custom::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_Custom(properties, pOuter);
- ((CFWL_Custom*)m_pImpl)->SetInterface(this);
- return ((CFWL_Custom*)m_pImpl)->Initialize();
+ CFWL_Custom* pCustomImpl = new CFWL_Custom(properties, pOuter);
+ SetImpl(pCustomImpl);
+ pCustomImpl->SetInterface(this);
+ return pCustomImpl->Initialize();
}
FWL_ERR IFWL_Custom::SetProxy(IFWL_Proxy* pProxy) {
- return ((CFWL_Custom*)m_pImpl)->SetProxy(pProxy);
+ return static_cast<CFWL_Custom*>(GetImpl())->SetProxy(pProxy);
}
void FWL_SetWidgetRect(IFWL_Widget* widget, const CFX_RectF& rect) {
static_cast<CFWL_WidgetImp*>(widget->GetImpl())->m_pProperties->m_rtWidget =
diff --git a/xfa/src/fwl/src/core/include/fwl_targetimp.h b/xfa/src/fwl/src/core/include/fwl_targetimp.h
index 87ae8ea390..5f494a78e2 100644
--- a/xfa/src/fwl/src/core/include/fwl_targetimp.h
+++ b/xfa/src/fwl/src/core/include/fwl_targetimp.h
@@ -12,6 +12,8 @@
class CFWL_TargetImp {
public:
+ virtual ~CFWL_TargetImp();
+
virtual FX_DWORD Release();
virtual IFWL_Target* Retain();
virtual FX_DWORD GetRefCount() const;
@@ -23,7 +25,6 @@ class CFWL_TargetImp {
protected:
CFWL_TargetImp();
- virtual ~CFWL_TargetImp();
FX_DWORD m_dwRefCount;
};