diff options
Diffstat (limited to 'xfa/fwl/lightwidget/cfwl_datetimepicker.cpp')
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_datetimepicker.cpp | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/xfa/fwl/lightwidget/cfwl_datetimepicker.cpp b/xfa/fwl/lightwidget/cfwl_datetimepicker.cpp index dba1a527b4..1256e1a35d 100644 --- a/xfa/fwl/lightwidget/cfwl_datetimepicker.cpp +++ b/xfa/fwl/lightwidget/cfwl_datetimepicker.cpp @@ -12,6 +12,14 @@ #include "xfa/fwl/core/fwl_error.h" #include "xfa/fwl/core/ifwl_widget.h" +IFWL_DateTimePicker* CFWL_DateTimePicker::GetWidget() { + return static_cast<IFWL_DateTimePicker*>(m_pIface.get()); +} + +const IFWL_DateTimePicker* CFWL_DateTimePicker::GetWidget() const { + return static_cast<IFWL_DateTimePicker*>(m_pIface.get()); +} + CFWL_DateTimePicker* CFWL_DateTimePicker::Create() { return new CFWL_DateTimePicker; } @@ -31,7 +39,7 @@ FWL_Error CFWL_DateTimePicker::Initialize( if (ret != FWL_Error::Succeeded) { return ret; } - m_pIface = pDateTimePicker.release(); + m_pIface = std::move(pDateTimePicker); CFWL_Widget::Initialize(); return FWL_Error::Succeeded; } @@ -46,34 +54,31 @@ FWL_Error CFWL_DateTimePicker::SetToday(int32_t iYear, } int32_t CFWL_DateTimePicker::CountSelRanges() { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->CountSelRanges(); + return GetWidget()->CountSelRanges(); } int32_t CFWL_DateTimePicker::GetSelRange(int32_t nIndex, int32_t& nStart) { - return static_cast<IFWL_DateTimePicker*>(m_pIface) - ->GetSelRange(nIndex, nStart); + return GetWidget()->GetSelRange(nIndex, nStart); } FWL_Error CFWL_DateTimePicker::GetEditText(CFX_WideString& wsText) { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->GetEditText(wsText); + return GetWidget()->GetEditText(wsText); } FWL_Error CFWL_DateTimePicker::SetEditText(const CFX_WideString& wsText) { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->SetEditText(wsText); + return GetWidget()->SetEditText(wsText); } FWL_Error CFWL_DateTimePicker::GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay) { - return static_cast<IFWL_DateTimePicker*>(m_pIface) - ->GetCurSel(iYear, iMonth, iDay); + return GetWidget()->GetCurSel(iYear, iMonth, iDay); } FWL_Error CFWL_DateTimePicker::SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay) { - return static_cast<IFWL_DateTimePicker*>(m_pIface) - ->SetCurSel(iYear, iMonth, iDay); + return GetWidget()->SetCurSel(iYear, iMonth, iDay); } CFWL_DateTimePicker::CFWL_DateTimePicker() {} @@ -105,67 +110,66 @@ FWL_Error CFWL_DateTimePicker::CFWL_DateTimePickerDP::GetToday( } FX_BOOL CFWL_DateTimePicker::CanUndo() { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->CanUndo(); + return GetWidget()->CanUndo(); } FX_BOOL CFWL_DateTimePicker::CanRedo() { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->CanRedo(); + return GetWidget()->CanRedo(); } FX_BOOL CFWL_DateTimePicker::Undo() { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->Undo(); + return GetWidget()->Undo(); } FX_BOOL CFWL_DateTimePicker::Redo() { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->Redo(); + return GetWidget()->Redo(); } FX_BOOL CFWL_DateTimePicker::CanCopy() { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->CanCopy(); + return GetWidget()->CanCopy(); } FX_BOOL CFWL_DateTimePicker::CanCut() { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->CanCut(); + return GetWidget()->CanCut(); } FX_BOOL CFWL_DateTimePicker::CanSelectAll() { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->CanSelectAll(); + return GetWidget()->CanSelectAll(); } FX_BOOL CFWL_DateTimePicker::Copy(CFX_WideString& wsCopy) { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->Copy(wsCopy); + return GetWidget()->Copy(wsCopy); } FX_BOOL CFWL_DateTimePicker::Cut(CFX_WideString& wsCut) { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->Copy(wsCut); + return GetWidget()->Copy(wsCut); } FX_BOOL CFWL_DateTimePicker::Paste(const CFX_WideString& wsPaste) { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->Paste(wsPaste); + return GetWidget()->Paste(wsPaste); } FX_BOOL CFWL_DateTimePicker::SelectAll() { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->SelectAll(); + return GetWidget()->SelectAll(); } FX_BOOL CFWL_DateTimePicker::Delete() { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->Delete(); + return GetWidget()->Delete(); } FX_BOOL CFWL_DateTimePicker::DeSelect() { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->DeSelect(); + return GetWidget()->DeSelect(); } FWL_Error CFWL_DateTimePicker::GetBBox(CFX_RectF& rect) { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->GetBBox(rect); + return GetWidget()->GetBBox(rect); } FWL_Error CFWL_DateTimePicker::SetEditLimit(int32_t nLimit) { - return static_cast<IFWL_DateTimePicker*>(m_pIface)->SetEditLimit(nLimit); + return GetWidget()->SetEditLimit(nLimit); } FWL_Error CFWL_DateTimePicker::ModifyEditStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved) { - return static_cast<IFWL_DateTimePicker*>(m_pIface) - ->ModifyEditStylesEx(dwStylesExAdded, dwStylesExRemoved); + return GetWidget()->ModifyEditStylesEx(dwStylesExAdded, dwStylesExRemoved); } |