diff options
Diffstat (limited to 'xfa/fwl/basewidget')
21 files changed, 84 insertions, 83 deletions
diff --git a/xfa/fwl/basewidget/cfx_barcode.cpp b/xfa/fwl/basewidget/cfx_barcode.cpp index 665317989a..723619fc5f 100644 --- a/xfa/fwl/basewidget/cfx_barcode.cpp +++ b/xfa/fwl/basewidget/cfx_barcode.cpp @@ -46,7 +46,7 @@ CBC_CodeBase* CreateBarCodeEngineObject(BC_TYPE type) { return new CBC_DataMatrix(); case BC_UNKNOWN: default: - return NULL; + return nullptr; } } @@ -60,7 +60,7 @@ CFX_Barcode::~CFX_Barcode() { FX_BOOL CFX_Barcode::Create(BC_TYPE type) { m_pBCEngine = CreateBarCodeEngineObject(type); - return m_pBCEngine != NULL; + return !!m_pBCEngine; } BC_TYPE CFX_Barcode::GetType() { return m_pBCEngine ? m_pBCEngine->GetType() : BC_UNKNOWN; @@ -225,7 +225,7 @@ FX_BOOL CFX_Barcode::SetFontColor(FX_ARGB color) { } FX_BOOL CFX_Barcode::SetTextLocation(BC_TEXT_LOC location) { typedef FX_BOOL (CBC_CodeBase::*memptrtype)(BC_TEXT_LOC); - memptrtype memptr = NULL; + memptrtype memptr = nullptr; switch (GetType()) { case BC_CODE39: memptr = (memptrtype)&CBC_Code39::SetTextLocation; @@ -245,7 +245,7 @@ FX_BOOL CFX_Barcode::SetTextLocation(BC_TEXT_LOC location) { } FX_BOOL CFX_Barcode::SetWideNarrowRatio(int32_t ratio) { typedef FX_BOOL (CBC_CodeBase::*memptrtype)(int32_t); - memptrtype memptr = NULL; + memptrtype memptr = nullptr; switch (GetType()) { case BC_CODE39: memptr = (memptrtype)&CBC_Code39::SetWideNarrowRatio; @@ -260,7 +260,7 @@ FX_BOOL CFX_Barcode::SetWideNarrowRatio(int32_t ratio) { } FX_BOOL CFX_Barcode::SetStartChar(FX_CHAR start) { typedef FX_BOOL (CBC_CodeBase::*memptrtype)(FX_CHAR); - memptrtype memptr = NULL; + memptrtype memptr = nullptr; switch (GetType()) { case BC_CODABAR: memptr = (memptrtype)&CBC_Codabar::SetStartChar; @@ -272,7 +272,7 @@ FX_BOOL CFX_Barcode::SetStartChar(FX_CHAR start) { } FX_BOOL CFX_Barcode::SetEndChar(FX_CHAR end) { typedef FX_BOOL (CBC_CodeBase::*memptrtype)(FX_CHAR); - memptrtype memptr = NULL; + memptrtype memptr = nullptr; switch (GetType()) { case BC_CODABAR: memptr = (memptrtype)&CBC_Codabar::SetEndChar; @@ -284,7 +284,7 @@ FX_BOOL CFX_Barcode::SetEndChar(FX_CHAR end) { } FX_BOOL CFX_Barcode::SetVersion(int32_t version) { typedef FX_BOOL (CBC_CodeBase::*memptrtype)(int32_t); - memptrtype memptr = NULL; + memptrtype memptr = nullptr; switch (GetType()) { case BC_QR_CODE: memptr = (memptrtype)&CBC_QRCode::SetVersion; @@ -296,7 +296,7 @@ FX_BOOL CFX_Barcode::SetVersion(int32_t version) { } FX_BOOL CFX_Barcode::SetErrorCorrectionLevel(int32_t level) { typedef FX_BOOL (CBC_CodeBase::*memptrtype)(int32_t); - memptrtype memptr = NULL; + memptrtype memptr = nullptr; switch (GetType()) { case BC_QR_CODE: memptr = (memptrtype)&CBC_QRCode::SetErrorCorrectionLevel; @@ -311,7 +311,7 @@ FX_BOOL CFX_Barcode::SetErrorCorrectionLevel(int32_t level) { } FX_BOOL CFX_Barcode::SetTruncated(FX_BOOL truncated) { typedef void (CBC_CodeBase::*memptrtype)(FX_BOOL); - memptrtype memptr = NULL; + memptrtype memptr = nullptr; switch (GetType()) { case BC_PDF417: memptr = (memptrtype)&CBC_PDF417I::SetTruncated; diff --git a/xfa/fwl/basewidget/fwl_caretimp.h b/xfa/fwl/basewidget/fwl_caretimp.h index e7484e6edc..4f16715cd1 100644 --- a/xfa/fwl/basewidget/fwl_caretimp.h +++ b/xfa/fwl/basewidget/fwl_caretimp.h @@ -63,7 +63,7 @@ class CFWL_CaretImpDelegate : public CFWL_WidgetImpDelegate { CFWL_CaretImpDelegate(CFWL_CaretImp* pOwner); void OnProcessMessage(CFWL_Message* pMessage) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; protected: CFWL_CaretImp* m_pOwner; diff --git a/xfa/fwl/basewidget/fwl_checkboximp.cpp b/xfa/fwl/basewidget/fwl_checkboximp.cpp index 5b22dc5abb..581e45319f 100644 --- a/xfa/fwl/basewidget/fwl_checkboximp.cpp +++ b/xfa/fwl/basewidget/fwl_checkboximp.cpp @@ -372,7 +372,7 @@ void CFWL_CheckBoxImp::NextStates() { if (!pWidgetMgr->IsFormDisabled()) { CFX_ArrayTemplate<IFWL_Widget*> radioarr; pWidgetMgr->GetSameGroupRadioButton(m_pInterface, radioarr); - IFWL_CheckBox* pCheckBox = NULL; + IFWL_CheckBox* pCheckBox = nullptr; int32_t iCount = radioarr.GetSize(); for (int32_t i = 0; i < iCount; i++) { pCheckBox = static_cast<IFWL_CheckBox*>(radioarr[i]); diff --git a/xfa/fwl/basewidget/fwl_checkboximp.h b/xfa/fwl/basewidget/fwl_checkboximp.h index 89f680c985..5d36ff00f0 100644 --- a/xfa/fwl/basewidget/fwl_checkboximp.h +++ b/xfa/fwl/basewidget/fwl_checkboximp.h @@ -56,7 +56,7 @@ class CFWL_CheckBoxImpDelegate : public CFWL_WidgetImpDelegate { void OnProcessMessage(CFWL_Message* pMessage) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; protected: void OnActivate(CFWL_Message* pMsg); diff --git a/xfa/fwl/basewidget/fwl_comboboximp.cpp b/xfa/fwl/basewidget/fwl_comboboximp.cpp index 8d4ac452f7..ded0da51f5 100644 --- a/xfa/fwl/basewidget/fwl_comboboximp.cpp +++ b/xfa/fwl/basewidget/fwl_comboboximp.cpp @@ -199,7 +199,7 @@ void CFWL_ComboEditImp::SetComboBoxFocus(FX_BOOL bSet) { CFWL_ComboListImp::CFWL_ComboListImp(const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter) : CFWL_ListBoxImp(properties, pOuter), m_bNotifyOwner(TRUE) { - ASSERT(pOuter != NULL); + ASSERT(pOuter); } FWL_Error CFWL_ComboListImp::Initialize() { if (CFWL_ListBoxImp::Initialize() != FWL_Error::Succeeded) @@ -303,7 +303,7 @@ void CFWL_ComboListImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { pMsg->m_fx -= rect.left; pMsg->m_fy -= rect.top; IFWL_WidgetDelegate* pDelegate = - m_pOwner->m_pVertScrollBar->SetDelegate(NULL); + m_pOwner->m_pVertScrollBar->SetDelegate(nullptr); pDelegate->OnProcessMessage(pMsg); return; } @@ -472,7 +472,7 @@ void CFWL_ComboListImpDelegate::OnDropListKeyDown(CFWL_MsgKey* pKey) { CFWL_ComboBoxImp::CFWL_ComboBoxImp(const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter) : CFWL_WidgetImp(properties, pOuter), - m_pForm(NULL), + m_pForm(nullptr), m_bLButtonDown(FALSE), m_iCurSel(-1), m_iBtnState(CFWL_PartState_Normal), @@ -587,7 +587,7 @@ FWL_Error CFWL_ComboBoxImp::Update() { if (bDropDown && m_pEdit) { ReSetEditAlignment(); } - if (m_pProperties->m_pThemeProvider == NULL) { + if (!m_pProperties->m_pThemeProvider) { m_pProperties->m_pThemeProvider = GetAvailableTheme(); } Layout(); @@ -638,7 +638,7 @@ FWL_Error CFWL_ComboBoxImp::DrawWidget(CFX_Graphics* pGraphics, ->m_pProperties->m_pDataProvider); void* p = pData->GetItemData(m_pListBox.get(), pData->GetItem(m_pListBox.get(), m_iCurSel)); - if (p != NULL) { + if (p) { param.m_pData = p; } } @@ -871,14 +871,14 @@ FWL_Error CFWL_ComboBoxImp::GetBBox(CFX_RectF& rect) { } return FWL_Error::Succeeded; } + FWL_Error CFWL_ComboBoxImp::EditModifyStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved) { - if (m_pEdit != NULL) { - return m_pEdit->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); - } else { + if (!m_pEdit) return FWL_Error::ParameterInvalid; - } + return m_pEdit->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); } + FX_FLOAT CFWL_ComboBoxImp::GetListHeight() { return static_cast<IFWL_ComboBoxDP*>(m_pProperties->m_pDataProvider) ->GetListHeight(m_pInterface); @@ -938,7 +938,7 @@ void CFWL_ComboBoxImp::ShowDropList(FX_BOOL bActivate) { if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_ListDrag) { FX_FLOAT fx = 0; FX_FLOAT fy = m_rtClient.top + m_rtClient.height / 2; - TransformTo(NULL, fx, fy); + TransformTo(nullptr, fx, fy); m_bUpFormHandler = fy > m_rtProxy.top; if (m_bUpFormHandler) { m_rtHandler.Set(0, 0, m_rtList.width, m_fComboFormHandler); @@ -1598,7 +1598,7 @@ void CFWL_ComboBoxImpDelegate::DoSubCtrlKey(CFWL_MsgKey* pMsg) { } FX_BOOL bDropDown = m_pOwner->IsDropDownStyle(); if (bDropDown) { - IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); + IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr); pDelegate->OnProcessMessage(pMsg); } } @@ -1649,7 +1649,7 @@ void CFWL_ComboBoxImpDelegate::DisForm_OnProcessMessage( pKey->m_dwKeyCode == FWL_VKEY_Escape; if (bListKey) { IFWL_WidgetDelegate* pDelegate = - m_pOwner->m_pListBox->SetDelegate(NULL); + m_pOwner->m_pListBox->SetDelegate(nullptr); pDelegate->OnProcessMessage(pMessage); break; } @@ -1688,17 +1688,17 @@ void CFWL_ComboBoxImpDelegate::DisForm_OnFocusChanged(CFWL_Message* pMsg, if ((m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) == 0) { CFWL_MsgSetFocus msg; msg.m_pDstTarget = m_pOwner->m_pEdit.get(); - msg.m_pSrcTarget = NULL; - IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); + msg.m_pSrcTarget = nullptr; + IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr); pDelegate->OnProcessMessage(&msg); } } else { m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; m_pOwner->DisForm_ShowDropList(FALSE); CFWL_MsgKillFocus msg; - msg.m_pDstTarget = NULL; + msg.m_pDstTarget = nullptr; msg.m_pSrcTarget = m_pOwner->m_pEdit.get(); - IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); + IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr); pDelegate->OnProcessMessage(&msg); } } @@ -1743,7 +1743,7 @@ void CFWL_ComboBoxImpDelegate::DisForm_OnKey(CFWL_MsgKey* pMsg) { return; } if (m_pOwner->m_pEdit) { - IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); + IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr); pDelegate->OnProcessMessage(pMsg); } } @@ -1852,7 +1852,7 @@ void CFWL_ComboProxyImpDelegate::OnDeactive(CFWL_MsgDeactivate* pMsg) { void CFWL_ComboProxyImpDelegate::OnFocusChanged(CFWL_MsgKillFocus* pMsg, FX_BOOL bSet) { if (!bSet) { - if (pMsg->m_pSetFocus == NULL) { + if (!pMsg->m_pSetFocus) { m_pComboBox->ShowDropList(FALSE); } } diff --git a/xfa/fwl/basewidget/fwl_comboboximp.h b/xfa/fwl/basewidget/fwl_comboboximp.h index 42452e6871..0ed5dbb1fa 100644 --- a/xfa/fwl/basewidget/fwl_comboboximp.h +++ b/xfa/fwl/basewidget/fwl_comboboximp.h @@ -170,7 +170,7 @@ class CFWL_ComboBoxImp : public CFWL_WidgetImp { FWL_Error DisForm_Update(); FWL_WidgetHit DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy); FWL_Error DisForm_DrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL); + const CFX_Matrix* pMatrix = nullptr); FWL_Error DisForm_GetBBox(CFX_RectF& rect); void DisForm_Layout(); @@ -199,7 +199,7 @@ class CFWL_ComboBoxImpDelegate : public CFWL_WidgetImpDelegate { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; protected: void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); @@ -226,7 +226,7 @@ class CFWL_ComboProxyImpDelegate : public CFWL_WidgetImpDelegate { CFWL_ComboProxyImpDelegate(IFWL_Form* pForm, CFWL_ComboBoxImp* pComboBox); void OnProcessMessage(CFWL_Message* pMessage) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; void Reset() { m_bLButtonUpSelf = FALSE; } protected: diff --git a/xfa/fwl/basewidget/fwl_datetimepickerimp.cpp b/xfa/fwl/basewidget/fwl_datetimepickerimp.cpp index bf534a7a97..d02f8483dd 100644 --- a/xfa/fwl/basewidget/fwl_datetimepickerimp.cpp +++ b/xfa/fwl/basewidget/fwl_datetimepickerimp.cpp @@ -183,7 +183,7 @@ void CFWL_DateTimeEditImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { if (dwHashCode == CFWL_MessageType::SetFocus || dwHashCode == CFWL_MessageType::KillFocus) { IFWL_Widget* pOuter = m_pOwner->GetOuter(); - IFWL_WidgetDelegate* pDelegate = pOuter->SetDelegate(NULL); + IFWL_WidgetDelegate* pDelegate = pOuter->SetDelegate(nullptr); pDelegate->OnProcessMessage(pMessage); } } @@ -243,7 +243,7 @@ void CFWL_DateTimeCalendarImpDelegate::OnProcessMessage( if (dwCode == CFWL_MessageType::SetFocus || dwCode == CFWL_MessageType::KillFocus) { IFWL_Widget* pOuter = m_pOwner->GetOuter(); - IFWL_WidgetDelegate* pDelegate = pOuter->SetDelegate(NULL); + IFWL_WidgetDelegate* pDelegate = pOuter->SetDelegate(nullptr); pDelegate->OnProcessMessage(pMessage); return; } @@ -900,7 +900,7 @@ void CFWL_DateTimePickerImp::DisForm_ShowMonthCalendar(FX_BOOL bActivate) { CFWL_MsgSetFocus msg; msg.m_pDstTarget = m_pMonthCal.get(); msg.m_pSrcTarget = m_pEdit.get(); - IFWL_WidgetDelegate* pDelegate = m_pEdit->SetDelegate(NULL); + IFWL_WidgetDelegate* pDelegate = m_pEdit->SetDelegate(nullptr); pDelegate->OnProcessMessage(&msg); } CFX_RectF rtInvalidate, rtCal; @@ -1065,7 +1065,8 @@ void CFWL_DateTimePickerImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { } case CFWL_MessageType::Key: { if (m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) { - IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); + IFWL_WidgetDelegate* pDelegate = + m_pOwner->m_pEdit->SetDelegate(nullptr); pDelegate->OnProcessMessage(pMessage); return; } @@ -1164,7 +1165,7 @@ void CFWL_DateTimePickerImpDelegate::DisForm_OnFocusChanged(CFWL_Message* pMsg, } rtInvalidate = m_pOwner->m_rtBtn; pMsg->m_pDstTarget = m_pOwner->m_pEdit.get(); - IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); + IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr); pDelegate->OnProcessMessage(pMsg); } else { m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; @@ -1174,7 +1175,7 @@ void CFWL_DateTimePickerImpDelegate::DisForm_OnFocusChanged(CFWL_Message* pMsg, } if (m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) { pMsg->m_pSrcTarget = m_pOwner->m_pEdit.get(); - IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); + IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr); pDelegate->OnProcessMessage(pMsg); } } diff --git a/xfa/fwl/basewidget/fwl_datetimepickerimp.h b/xfa/fwl/basewidget/fwl_datetimepickerimp.h index 5ec22c1fac..8306a26ba8 100644 --- a/xfa/fwl/basewidget/fwl_datetimepickerimp.h +++ b/xfa/fwl/basewidget/fwl_datetimepickerimp.h @@ -216,7 +216,7 @@ class CFWL_DateTimePickerImp : public CFWL_WidgetImp { FWL_Error DisForm_GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); FWL_Error DisForm_GetBBox(CFX_RectF& rect); FWL_Error DisForm_DrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL); + const CFX_Matrix* pMatrix = nullptr); }; class CFWL_DateTimePickerImpDelegate : public CFWL_WidgetImpDelegate { @@ -226,7 +226,7 @@ class CFWL_DateTimePickerImpDelegate : public CFWL_WidgetImpDelegate { // CFWL_WidgetImpDelegate void OnProcessMessage(CFWL_Message* pMessage) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; protected: void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); diff --git a/xfa/fwl/basewidget/fwl_editimp.cpp b/xfa/fwl/basewidget/fwl_editimp.cpp index 3fdd999d5d..ae0b7bcc9f 100644 --- a/xfa/fwl/basewidget/fwl_editimp.cpp +++ b/xfa/fwl/basewidget/fwl_editimp.cpp @@ -203,7 +203,7 @@ CFWL_EditImp::CFWL_EditImp(const CFWL_WidgetImpProperties& properties, m_fVAlignOffset(0.0f), m_fScrollOffsetX(0.0f), m_fScrollOffsetY(0.0f), - m_pEdtEngine(NULL), + m_pEdtEngine(nullptr), m_bLButtonDown(FALSE), m_nSelStart(0), m_nLimit(-1), @@ -489,7 +489,7 @@ void CFWL_EditImp::DrawSpellCheck(CFX_Graphics* pGraphics, pGraphics->SetClipRect(rtClip); pGraphics->SetStrokeColor(&crLine); pGraphics->SetLineWidth(0); - pGraphics->StrokePath(&pathSpell, NULL); + pGraphics->StrokePath(&pathSpell, nullptr); } pGraphics->RestoreGraphState(); } @@ -1364,13 +1364,13 @@ IFWL_ScrollBar* CFWL_EditImp::UpdateScroll() { m_pVertScrollBar && ((m_pVertScrollBar->GetStates() & FWL_WGTSTATE_Invisible) == 0); if (!bShowHorz && !bShowVert) { - return NULL; + return nullptr; } IFDE_TxtEdtPage* pPage = m_pEdtEngine->GetPage(0); if (!pPage) - return NULL; + return nullptr; const CFX_RectF& rtFDE = pPage->GetContentsBox(); - IFWL_ScrollBar* pRepaint = NULL; + IFWL_ScrollBar* pRepaint = nullptr; if (bShowHorz) { CFX_RectF rtScroll; m_pHorzScrollBar->GetWidgetRect(rtScroll); @@ -1551,7 +1551,7 @@ void CFWL_EditImp::LayoutScrollBar() { 0) { return; } - FX_FLOAT* pfWidth = NULL; + FX_FLOAT* pfWidth = nullptr; FX_BOOL bShowVertScrollbar = IsShowScrollBar(TRUE); FX_BOOL bShowHorzScrollbar = IsShowScrollBar(FALSE); if (bShowVertScrollbar) { diff --git a/xfa/fwl/basewidget/fwl_editimp.h b/xfa/fwl/basewidget/fwl_editimp.h index 8f729f32e0..3f7a3862dd 100644 --- a/xfa/fwl/basewidget/fwl_editimp.h +++ b/xfa/fwl/basewidget/fwl_editimp.h @@ -42,7 +42,7 @@ class CFWL_EditImp : public CFWL_WidgetImp { FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE) override; FWL_Error DrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; FWL_Error SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; virtual FWL_Error SetText(const CFX_WideString& wsText); @@ -111,10 +111,10 @@ class CFWL_EditImp : public CFWL_WidgetImp { void DrawTextBk(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, - const CFX_Matrix* pMatrix = NULL); + const CFX_Matrix* pMatrix = nullptr); void DrawContent(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, - const CFX_Matrix* pMatrix = NULL); + const CFX_Matrix* pMatrix = nullptr); void UpdateEditEngine(); void UpdateEditParams(); void UpdateEditLayout(); @@ -128,7 +128,7 @@ class CFWL_EditImp : public CFWL_WidgetImp { void DeviceToEngine(CFX_PointF& pt); void InitScrollBar(FX_BOOL bVert = TRUE); void InitEngine(); - virtual void ShowCaret(FX_BOOL bVisible, CFX_RectF* pRect = NULL); + virtual void ShowCaret(FX_BOOL bVisible, CFX_RectF* pRect = nullptr); FX_BOOL ValidateNumberChar(FX_WCHAR cNum); void InitCaret(); void ClearRecord(); @@ -138,7 +138,7 @@ class CFWL_EditImp : public CFWL_WidgetImp { void ProcessInsertError(int32_t iError); void DrawSpellCheck(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL); + const CFX_Matrix* pMatrix = nullptr); void AddSpellCheckObj(CFX_Path& PathData, int32_t nStart, int32_t nCount, @@ -181,7 +181,7 @@ class CFWL_EditImpDelegate : public CFWL_WidgetImpDelegate { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; protected: void DoActivate(CFWL_MsgActivate* pMsg); diff --git a/xfa/fwl/basewidget/fwl_formproxyimp.cpp b/xfa/fwl/basewidget/fwl_formproxyimp.cpp index 2b76078e0c..0317ae38b2 100644 --- a/xfa/fwl/basewidget/fwl_formproxyimp.cpp +++ b/xfa/fwl/basewidget/fwl_formproxyimp.cpp @@ -54,6 +54,6 @@ CFWL_FormProxyImpDelegate::CFWL_FormProxyImpDelegate(CFWL_FormProxyImp* pOwner) : m_pOwner(pOwner) {} void CFWL_FormProxyImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { - IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pOuter->SetDelegate(NULL); + IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pOuter->SetDelegate(nullptr); pDelegate->OnProcessMessage(pMessage); } diff --git a/xfa/fwl/basewidget/fwl_listboximp.cpp b/xfa/fwl/basewidget/fwl_listboximp.cpp index 7198480b41..7a487f6363 100644 --- a/xfa/fwl/basewidget/fwl_listboximp.cpp +++ b/xfa/fwl/basewidget/fwl_listboximp.cpp @@ -68,10 +68,10 @@ CFWL_ListBoxImp::CFWL_ListBoxImp(const CFWL_WidgetImpProperties& properties, : CFWL_WidgetImp(properties, pOuter), m_dwTTOStyles(0), m_iTTOAligns(0), - m_hAnchor(NULL), + m_hAnchor(nullptr), m_fScorllBarWidth(0), m_bLButtonDown(FALSE), - m_pScrollBarTP(NULL) { + m_pScrollBarTP(nullptr) { m_rtClient.Reset(); m_rtConent.Reset(); m_rtStatic.Reset(); @@ -230,7 +230,7 @@ int32_t CFWL_ListBoxImp::CountSelItems() { } IFWL_ListItem* CFWL_ListBoxImp::GetSelItem(int32_t nIndexSel) { if (!m_pProperties->m_pDataProvider) - return NULL; + return nullptr; int32_t index = 0; IFWL_ListBoxDP* pData = static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider); @@ -238,7 +238,7 @@ IFWL_ListItem* CFWL_ListBoxImp::GetSelItem(int32_t nIndexSel) { for (int32_t i = 0; i < iCount; i++) { IFWL_ListItem* pItem = pData->GetItem(m_pInterface, i); if (!pItem) { - return NULL; + return nullptr; } uint32_t dwStyle = pData->GetItemStyles(m_pInterface, pItem); if (dwStyle & FWL_ITEMSTATE_LTB_Selected) { @@ -249,7 +249,7 @@ IFWL_ListItem* CFWL_ListBoxImp::GetSelItem(int32_t nIndexSel) { } } } - return NULL; + return nullptr; } int32_t CFWL_ListBoxImp::GetSelIndex(int32_t nIndex) { if (!m_pProperties->m_pDataProvider) @@ -282,7 +282,7 @@ FWL_Error CFWL_ListBoxImp::SetSelItem(IFWL_ListItem* pItem, FX_BOOL bSelect) { SelectAll(); } else { ClearSelection(); - SetFocusItem(NULL); + SetFocusItem(nullptr); } return FWL_Error::Indefinite; } @@ -317,7 +317,7 @@ FWL_Error CFWL_ListBoxImp::GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert) { IFWL_ListItem* CFWL_ListBoxImp::GetItem(IFWL_ListItem* pItem, uint32_t dwKeyCode) { - IFWL_ListItem* hRet = NULL; + IFWL_ListItem* hRet = nullptr; switch (dwKeyCode) { case FWL_VKEY_Up: case FWL_VKEY_Down: @@ -422,12 +422,12 @@ IFWL_ListItem* CFWL_ListBoxImp::GetFocusedItem() { for (int32_t i = 0; i < iCount; i++) { IFWL_ListItem* pItem = pData->GetItem(m_pInterface, i); if (!pItem) - return NULL; + return nullptr; if (pData->GetItemStyles(m_pInterface, pItem) & FWL_ITEMSTATE_LTB_Focused) { return pItem; } } - return NULL; + return nullptr; } void CFWL_ListBoxImp::SetFocusItem(IFWL_ListItem* pItem) { IFWL_ListBoxDP* pData = @@ -471,7 +471,7 @@ IFWL_ListItem* CFWL_ListBoxImp::GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy) { return pItem; } } - return NULL; + return nullptr; } FX_BOOL CFWL_ListBoxImp::GetItemCheckRect(IFWL_ListItem* pItem, CFX_RectF& rtCheck) { @@ -958,7 +958,7 @@ void CFWL_ListBoxImp::ProcessSelChanged() { int32_t iCount = CountSelItems(); for (int32_t i = 0; i < iCount; i++) { IFWL_ListItem* item = GetSelItem(i); - if (item == NULL) { + if (!item) { continue; } selEvent.iarraySels.Add(i); @@ -1117,7 +1117,7 @@ void CFWL_ListBoxImpDelegate::OnMouseWheel(CFWL_MsgMouseWheel* pMsg) { return; } IFWL_WidgetDelegate* pDelegate = - m_pOwner->m_pVertScrollBar->SetDelegate(NULL); + m_pOwner->m_pVertScrollBar->SetDelegate(nullptr); pDelegate->OnProcessMessage(pMsg); } void CFWL_ListBoxImpDelegate::OnKeyDown(CFWL_MsgKey* pMsg) { diff --git a/xfa/fwl/basewidget/fwl_listboximp.h b/xfa/fwl/basewidget/fwl_listboximp.h index 1a7a9419e5..6a2fcb138e 100644 --- a/xfa/fwl/basewidget/fwl_listboximp.h +++ b/xfa/fwl/basewidget/fwl_listboximp.h @@ -66,16 +66,16 @@ class CFWL_ListBoxImp : public CFWL_WidgetImp { FX_BOOL ScrollToVisible(IFWL_ListItem* hItem); void DrawBkground(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, - const CFX_Matrix* pMatrix = NULL); + const CFX_Matrix* pMatrix = nullptr); void DrawItems(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, - const CFX_Matrix* pMatrix = NULL); + const CFX_Matrix* pMatrix = nullptr); void DrawItem(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, IFWL_ListItem* hItem, int32_t Index, const CFX_RectF& rtItem, - const CFX_Matrix* pMatrix = NULL); + const CFX_Matrix* pMatrix = nullptr); void DrawStatic(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme); CFX_SizeF CalcSize(FX_BOOL bAutoSize = FALSE); void GetItemSize(CFX_SizeF& size, @@ -109,7 +109,7 @@ class CFWL_ListBoxImpDelegate : public CFWL_WidgetImpDelegate { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; protected: void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); diff --git a/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp b/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp index 209a857dad..ca141a2d7a 100644 --- a/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp +++ b/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp @@ -235,7 +235,7 @@ FWL_Error CFWL_MonthCalendarImp::DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { if (!pGraphics) return FWL_Error::Indefinite; - if (m_pProperties->m_pThemeProvider == NULL) { + if (!m_pProperties->m_pThemeProvider) { m_pProperties->m_pThemeProvider = GetAvailableTheme(); } IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; diff --git a/xfa/fwl/basewidget/fwl_monthcalendarimp.h b/xfa/fwl/basewidget/fwl_monthcalendarimp.h index a3a8f45aa0..db6ce7801c 100644 --- a/xfa/fwl/basewidget/fwl_monthcalendarimp.h +++ b/xfa/fwl/basewidget/fwl_monthcalendarimp.h @@ -231,7 +231,7 @@ class CFWL_MonthCalendarImpDelegate : public CFWL_WidgetImpDelegate { CFWL_MonthCalendarImpDelegate(CFWL_MonthCalendarImp* pOwner); void OnProcessMessage(CFWL_Message* pMessage) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; protected: void OnActivate(CFWL_Message* pMsg); diff --git a/xfa/fwl/basewidget/fwl_pictureboximp.h b/xfa/fwl/basewidget/fwl_pictureboximp.h index 9fa065216a..eb466c108e 100644 --- a/xfa/fwl/basewidget/fwl_pictureboximp.h +++ b/xfa/fwl/basewidget/fwl_pictureboximp.h @@ -35,7 +35,7 @@ class CFWL_PictureBoxImp : public CFWL_WidgetImp { void DrawBkground(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, - const CFX_Matrix* pMatrix = NULL); + const CFX_Matrix* pMatrix = nullptr); FX_BOOL VStyle(FX_BOOL dwStyle); CFX_RectF m_rtClient; @@ -50,7 +50,7 @@ class CFWL_PictureBoxImpDelegate : public CFWL_WidgetImpDelegate { public: CFWL_PictureBoxImpDelegate(CFWL_PictureBoxImp* pOwner); void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; protected: CFWL_PictureBoxImp* m_pOwner; diff --git a/xfa/fwl/basewidget/fwl_pushbuttonimp.cpp b/xfa/fwl/basewidget/fwl_pushbuttonimp.cpp index 77c93f4537..834342ec93 100644 --- a/xfa/fwl/basewidget/fwl_pushbuttonimp.cpp +++ b/xfa/fwl/basewidget/fwl_pushbuttonimp.cpp @@ -67,7 +67,7 @@ FWL_Error CFWL_PushButtonImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { if (bAutoSize) { rect.Set(0, 0, 0, 0); - if (m_pProperties->m_pThemeProvider == NULL) { + if (!m_pProperties->m_pThemeProvider) { m_pProperties->m_pThemeProvider = GetAvailableTheme(); } CFX_WideString wsCaption; @@ -122,7 +122,7 @@ FWL_Error CFWL_PushButtonImp::DrawWidget(CFX_Graphics* pGraphics, return FWL_Error::Indefinite; IFWL_PushButtonDP* pData = static_cast<IFWL_PushButtonDP*>(m_pProperties->m_pDataProvider); - CFX_DIBitmap* pPicture = NULL; + CFX_DIBitmap* pPicture = nullptr; IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; if (HasBorder()) { DrawBorder(pGraphics, CFWL_Part::Border, m_pProperties->m_pThemeProvider, diff --git a/xfa/fwl/basewidget/fwl_pushbuttonimp.h b/xfa/fwl/basewidget/fwl_pushbuttonimp.h index 79a4859cc9..31ad5519bb 100644 --- a/xfa/fwl/basewidget/fwl_pushbuttonimp.h +++ b/xfa/fwl/basewidget/fwl_pushbuttonimp.h @@ -57,7 +57,7 @@ class CFWL_PushButtonImpDelegate : public CFWL_WidgetImpDelegate { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; protected: void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); diff --git a/xfa/fwl/basewidget/fwl_scrollbarimp.h b/xfa/fwl/basewidget/fwl_scrollbarimp.h index 4410830707..4a7a4634ab 100644 --- a/xfa/fwl/basewidget/fwl_scrollbarimp.h +++ b/xfa/fwl/basewidget/fwl_scrollbarimp.h @@ -54,14 +54,14 @@ class CFWL_ScrollBarImp : public CFWL_WidgetImp, public IFWL_Timer { void DrawTrack(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, FX_BOOL bLower = TRUE, - const CFX_Matrix* pMatrix = NULL); + const CFX_Matrix* pMatrix = nullptr); void DrawArrowBtn(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, FX_BOOL bMinBtn = TRUE, - const CFX_Matrix* pMatrix = NULL); + const CFX_Matrix* pMatrix = nullptr); void DrawThumb(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, - const CFX_Matrix* pMatrix = NULL); + const CFX_Matrix* pMatrix = nullptr); void Layout(); void CalcButtonLen(); void CalcMinButtonRect(CFX_RectF& rect); @@ -111,7 +111,7 @@ class CFWL_ScrollBarImpDelegate : public CFWL_WidgetImpDelegate { CFWL_ScrollBarImpDelegate(CFWL_ScrollBarImp* pOwner); void OnProcessMessage(CFWL_Message* pMessage) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; protected: void OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); diff --git a/xfa/fwl/basewidget/fwl_spinbuttonimp.h b/xfa/fwl/basewidget/fwl_spinbuttonimp.h index d986f31cd2..3eca307cdc 100644 --- a/xfa/fwl/basewidget/fwl_spinbuttonimp.h +++ b/xfa/fwl/basewidget/fwl_spinbuttonimp.h @@ -64,7 +64,7 @@ class CFWL_SpinButtonImpDelegate : public CFWL_WidgetImpDelegate { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; protected: void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); diff --git a/xfa/fwl/basewidget/fwl_tooltipctrlimp.h b/xfa/fwl/basewidget/fwl_tooltipctrlimp.h index c21a47ec07..79e3f49f18 100644 --- a/xfa/fwl/basewidget/fwl_tooltipctrlimp.h +++ b/xfa/fwl/basewidget/fwl_tooltipctrlimp.h @@ -80,7 +80,7 @@ class CFWL_ToolTipImpDelegate : public CFWL_WidgetImpDelegate { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) override; + const CFX_Matrix* pMatrix = nullptr) override; protected: void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); |