summaryrefslogtreecommitdiff
path: root/xfa/fwl
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-06-23 12:40:16 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-23 12:40:16 -0700
commit85d1f2c2f9f1e746bedb1b6f03576613f54fbc27 (patch)
treeff5b393fb9b89f006327bee7bc8c955522defb67 /xfa/fwl
parent6e12478cb298c3a8277493ee79ae0b73d6df8554 (diff)
downloadpdfium-85d1f2c2f9f1e746bedb1b6f03576613f54fbc27.tar.xz
Remove NULL in xfa/
This CL converts all NULL's to nullptr. All instances of comparison to nullptr have been removed. Review-Url: https://codereview.chromium.org/2095653002
Diffstat (limited to 'xfa/fwl')
-rw-r--r--xfa/fwl/basewidget/cfx_barcode.cpp18
-rw-r--r--xfa/fwl/basewidget/fwl_caretimp.h2
-rw-r--r--xfa/fwl/basewidget/fwl_checkboximp.cpp2
-rw-r--r--xfa/fwl/basewidget/fwl_checkboximp.h2
-rw-r--r--xfa/fwl/basewidget/fwl_comboboximp.cpp36
-rw-r--r--xfa/fwl/basewidget/fwl_comboboximp.h6
-rw-r--r--xfa/fwl/basewidget/fwl_datetimepickerimp.cpp13
-rw-r--r--xfa/fwl/basewidget/fwl_datetimepickerimp.h4
-rw-r--r--xfa/fwl/basewidget/fwl_editimp.cpp12
-rw-r--r--xfa/fwl/basewidget/fwl_editimp.h12
-rw-r--r--xfa/fwl/basewidget/fwl_formproxyimp.cpp2
-rw-r--r--xfa/fwl/basewidget/fwl_listboximp.cpp24
-rw-r--r--xfa/fwl/basewidget/fwl_listboximp.h8
-rw-r--r--xfa/fwl/basewidget/fwl_monthcalendarimp.cpp2
-rw-r--r--xfa/fwl/basewidget/fwl_monthcalendarimp.h2
-rw-r--r--xfa/fwl/basewidget/fwl_pictureboximp.h4
-rw-r--r--xfa/fwl/basewidget/fwl_pushbuttonimp.cpp4
-rw-r--r--xfa/fwl/basewidget/fwl_pushbuttonimp.h2
-rw-r--r--xfa/fwl/basewidget/fwl_scrollbarimp.h8
-rw-r--r--xfa/fwl/basewidget/fwl_spinbuttonimp.h2
-rw-r--r--xfa/fwl/basewidget/fwl_tooltipctrlimp.h2
-rw-r--r--xfa/fwl/core/cfwl_themetext.h2
-rw-r--r--xfa/fwl/core/cfwl_widgetmgr.cpp32
-rw-r--r--xfa/fwl/core/cfwl_widgetmgr.h5
-rw-r--r--xfa/fwl/core/fwl_appimp.cpp2
-rw-r--r--xfa/fwl/core/fwl_formimp.cpp12
-rw-r--r--xfa/fwl/core/fwl_formimp.h6
-rw-r--r--xfa/fwl/core/fwl_noteimp.cpp54
-rw-r--r--xfa/fwl/core/fwl_widgetimp.cpp16
-rw-r--r--xfa/fwl/core/fwl_widgetimp.h14
-rw-r--r--xfa/fwl/core/ifwl_widget.h2
-rw-r--r--xfa/fwl/lightwidget/cfwl_barcode.h2
-rw-r--r--xfa/fwl/lightwidget/cfwl_checkbox.h2
-rw-r--r--xfa/fwl/lightwidget/cfwl_combobox.cpp12
-rw-r--r--xfa/fwl/lightwidget/cfwl_combobox.h2
-rw-r--r--xfa/fwl/lightwidget/cfwl_datetimepicker.h2
-rw-r--r--xfa/fwl/lightwidget/cfwl_edit.h2
-rw-r--r--xfa/fwl/lightwidget/cfwl_listbox.cpp22
-rw-r--r--xfa/fwl/lightwidget/cfwl_listbox.h2
-rw-r--r--xfa/fwl/lightwidget/cfwl_picturebox.h2
-rw-r--r--xfa/fwl/lightwidget/cfwl_pushbutton.h4
-rw-r--r--xfa/fwl/lightwidget/cfwl_widget.h8
-rw-r--r--xfa/fwl/theme/cfwl_carettp.h2
-rw-r--r--xfa/fwl/theme/cfwl_checkboxtp.h20
-rw-r--r--xfa/fwl/theme/cfwl_listboxtp.h4
-rw-r--r--xfa/fwl/theme/cfwl_scrollbartp.h8
-rw-r--r--xfa/fwl/theme/cfwl_widgettp.cpp14
-rw-r--r--xfa/fwl/theme/cfwl_widgettp.h28
48 files changed, 221 insertions, 227 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);
diff --git a/xfa/fwl/core/cfwl_themetext.h b/xfa/fwl/core/cfwl_themetext.h
index 7f3dde91d8..c8929bd1f0 100644
--- a/xfa/fwl/core/cfwl_themetext.h
+++ b/xfa/fwl/core/cfwl_themetext.h
@@ -13,7 +13,7 @@
class CFWL_ThemeText : public CFWL_ThemePart {
public:
- CFWL_ThemeText() : m_pGraphics(NULL) {}
+ CFWL_ThemeText() : m_pGraphics(nullptr) {}
CFX_WideString m_wsText;
uint32_t m_dwTTOStyles;
int32_t m_iTTOAlign;
diff --git a/xfa/fwl/core/cfwl_widgetmgr.cpp b/xfa/fwl/core/cfwl_widgetmgr.cpp
index d36ab7792b..b4f3a864bf 100644
--- a/xfa/fwl/core/cfwl_widgetmgr.cpp
+++ b/xfa/fwl/core/cfwl_widgetmgr.cpp
@@ -139,8 +139,8 @@ FX_BOOL CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) {
if (pItem->pParent->pChild == pItem) {
pItem->pParent->pChild = pItem->pNext;
}
- pItem->pNext = NULL;
- pItem->pPrevious = NULL;
+ pItem->pNext = nullptr;
+ pItem->pPrevious = nullptr;
break;
}
if (!pChild->pNext) {
@@ -157,7 +157,7 @@ FX_BOOL CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) {
}
pChild->pNext = pItem;
pItem->pPrevious = pChild;
- pItem->pNext = NULL;
+ pItem->pNext = nullptr;
return TRUE;
}
i = 0;
@@ -168,7 +168,7 @@ FX_BOOL CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) {
if (!pChild->pNext) {
pChild->pNext = pItem;
pItem->pPrevious = pChild;
- pItem->pNext = NULL;
+ pItem->pNext = nullptr;
return TRUE;
}
if (pChild->pPrevious) {
@@ -182,8 +182,8 @@ FX_BOOL CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) {
}
} else {
pItem->pParent->pChild = pItem;
- pItem->pPrevious = NULL;
- pItem->pNext = NULL;
+ pItem->pPrevious = nullptr;
+ pItem->pNext = nullptr;
}
return TRUE;
}
@@ -213,7 +213,7 @@ FWL_Error CFWL_WidgetMgr::RepaintWidget(IFWL_Widget* pWidget,
return m_pAdapter->RepaintWidget(pNative, &rect);
}
void CFWL_WidgetMgr::AddWidget(IFWL_Widget* pWidget) {
- CFWL_WidgetMgrItem* pParentItem = GetWidgetMgrItem(NULL);
+ CFWL_WidgetMgrItem* pParentItem = GetWidgetMgrItem(nullptr);
CFWL_WidgetMgrItem* pItem = GetWidgetMgrItem(pWidget);
if (!pItem) {
pItem = new CFWL_WidgetMgrItem(pWidget);
@@ -314,8 +314,8 @@ void CFWL_WidgetMgr::SetParent(IFWL_Widget* pParent, IFWL_Widget* pChild) {
if (pItem->pParent->pChild == pItem) {
pItem->pParent->pChild = pItem->pNext;
}
- pItem->pNext = NULL;
- pItem->pPrevious = NULL;
+ pItem->pNext = nullptr;
+ pItem->pPrevious = nullptr;
}
pItem->pParent = pParentItem;
SetWidgetIndex(pChild, -1);
@@ -357,7 +357,7 @@ IFWL_Widget* CFWL_WidgetMgr::GetWidgetAtPoint(IFWL_Widget* parent,
FX_FLOAT x,
FX_FLOAT y) {
if (!parent)
- return NULL;
+ return nullptr;
FX_FLOAT x1;
FX_FLOAT y1;
IFWL_Widget* child = GetLastChildWidget(parent);
@@ -453,7 +453,7 @@ void CFWL_WidgetMgr::GetSameGroupRadioButton(
int32_t iGroup = CountRadioButtonGroup(pFirst);
if (iGroup < 2) {
IFWL_Widget* pNext = pFirst;
- while ((pNext = GetSiblingRadioButton(pNext, TRUE)) != NULL) {
+ while ((pNext = GetSiblingRadioButton(pNext, TRUE)) != nullptr) {
group.Add(pNext);
}
return;
@@ -484,7 +484,7 @@ IFWL_Widget* CFWL_WidgetMgr::GetDefaultButton(IFWL_Widget* pParent) {
}
child = CFWL_WidgetMgr::GetInstance()->GetNextSiblingWidget(child);
}
- return NULL;
+ return nullptr;
}
void CFWL_WidgetMgr::AddRedrawCounts(IFWL_Widget* pWidget) {
CFWL_WidgetMgrItem* pItem = GetWidgetMgrItem(pWidget);
@@ -621,20 +621,20 @@ void CFWL_WidgetMgrDelegate::OnDrawWidget(IFWL_Widget* pWidget,
#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ || \
_FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_ANDROID_
- IFWL_WidgetDelegate* pDelegate = pWidget->SetDelegate(NULL);
+ IFWL_WidgetDelegate* pDelegate = pWidget->SetDelegate(nullptr);
pDelegate->OnDrawWidget(pTemp, pMatrix);
pGraphics->GetClipRect(clipBounds);
clipCopy = clipBounds;
#elif _FX_OS_ == _FX_MACOSX_
if (m_pWidgetMgr->IsFormDisabled()) {
- IFWL_WidgetDelegate* pDelegate = pWidget->SetDelegate(NULL);
+ IFWL_WidgetDelegate* pDelegate = pWidget->SetDelegate(nullptr);
pDelegate->OnDrawWidget(pTemp, pMatrix);
pGraphics->GetClipRect(clipBounds);
clipCopy = clipBounds;
} else {
clipBounds.Set(pMatrix->a, pMatrix->b, pMatrix->c, pMatrix->d);
const_cast<CFX_Matrix*>(pMatrix)->SetIdentity(); // FIXME: const cast.
- IFWL_WidgetDelegate* pDelegate = pWidget->SetDelegate(NULL);
+ IFWL_WidgetDelegate* pDelegate = pWidget->SetDelegate(nullptr);
pDelegate->OnDrawWidget(pTemp, pMatrix);
}
#endif // _FX_OS_ == _FX_MACOSX_
@@ -688,7 +688,7 @@ void CFWL_WidgetMgrDelegate::DrawChild(IFWL_Widget* parent,
pGraphics->SetClipRect(clipBounds);
}
widgetMatrix.Translate(rtWidget.left, rtWidget.top, TRUE);
- IFWL_WidgetDelegate* pDelegate = child->SetDelegate(NULL);
+ IFWL_WidgetDelegate* pDelegate = child->SetDelegate(nullptr);
if (pDelegate) {
if (m_pWidgetMgr->IsFormDisabled() ||
IsNeedRepaint(child, &widgetMatrix, rtClip)) {
diff --git a/xfa/fwl/core/cfwl_widgetmgr.h b/xfa/fwl/core/cfwl_widgetmgr.h
index 1f0df3beb6..346785fd97 100644
--- a/xfa/fwl/core/cfwl_widgetmgr.h
+++ b/xfa/fwl/core/cfwl_widgetmgr.h
@@ -62,7 +62,8 @@ class CFWL_WidgetMgr {
IFWL_Widget* GetSystemFormWidget(IFWL_Widget* pWidget) const;
FX_BOOL SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex);
- FWL_Error RepaintWidget(IFWL_Widget* pWidget, const CFX_RectF* pRect = NULL);
+ FWL_Error RepaintWidget(IFWL_Widget* pWidget,
+ const CFX_RectF* pRect = nullptr);
void AddWidget(IFWL_Widget* pWidget);
void InsertWidget(IFWL_Widget* pParent,
@@ -99,7 +100,7 @@ class CFWL_WidgetMgr {
int32_t TravelWidgetMgr(CFWL_WidgetMgrItem* pParent,
int32_t* pIndex,
CFWL_WidgetMgrItem* pItem,
- IFWL_Widget** pWidget = NULL);
+ IFWL_Widget** pWidget = nullptr);
FX_BOOL IsAbleNative(IFWL_Widget* pWidget) const;
uint32_t m_dwCapability;
diff --git a/xfa/fwl/core/fwl_appimp.cpp b/xfa/fwl/core/fwl_appimp.cpp
index 2c4258ce74..2df579ca38 100644
--- a/xfa/fwl/core/fwl_appimp.cpp
+++ b/xfa/fwl/core/fwl_appimp.cpp
@@ -103,7 +103,7 @@ IFWL_ThemeProvider* CFWL_AppImp::GetThemeProvider() const {
CXFA_FFApp* FWL_GetAdapterNative() {
IFWL_App* pApp = FWL_GetApp();
if (!pApp)
- return NULL;
+ return nullptr;
return pApp->GetAdapterNative();
}
diff --git a/xfa/fwl/core/fwl_formimp.cpp b/xfa/fwl/core/fwl_formimp.cpp
index 8b4ef9fc43..a3fc6be816 100644
--- a/xfa/fwl/core/fwl_formimp.cpp
+++ b/xfa/fwl/core/fwl_formimp.cpp
@@ -397,8 +397,8 @@ IFWL_Widget* CFWL_FormImp::DoModal() {
pDriver->PopNoteLoop();
#endif
delete m_pNoteLoop;
- m_pNoteLoop = NULL;
- return NULL;
+ m_pNoteLoop = nullptr;
+ return nullptr;
}
IFWL_Widget* CFWL_FormImp::DoModal(uint32_t& dwCommandID) {
return DoModal();
@@ -499,7 +499,7 @@ CFWL_SysBtn* CFWL_FormImp::GetSysBtnAtPoint(FX_FLOAT fx, FX_FLOAT fy) {
if (m_pCaptionBox && m_pCaptionBox->m_rtBtn.Contains(fx, fy)) {
return m_pCaptionBox;
}
- return NULL;
+ return nullptr;
}
CFWL_SysBtn* CFWL_FormImp::GetSysBtnByState(uint32_t dwState) {
if (m_pCloseBox && (m_pCloseBox->m_dwState & dwState)) {
@@ -514,7 +514,7 @@ CFWL_SysBtn* CFWL_FormImp::GetSysBtnByState(uint32_t dwState) {
if (m_pCaptionBox && (m_pCaptionBox->m_dwState & dwState)) {
return m_pCaptionBox;
}
- return NULL;
+ return nullptr;
}
CFWL_SysBtn* CFWL_FormImp::GetSysBtnByIndex(int32_t nIndex) {
if (nIndex < 0)
@@ -801,7 +801,7 @@ void CFWL_FormImp::DoWidthLimit(FX_FLOAT& fLeft,
FX_BOOL bLeft) {
FX_FLOAT fx = fCurX;
FX_FLOAT fy = 0;
- TransformTo(NULL, fx, fy);
+ TransformTo(nullptr, fx, fy);
FX_FLOAT fTemp =
bLeft ? (fWidth - fx + fLeft + fSpace) : (fx - fLeft + fSpace);
if (fTemp >= fLimitMin && fTemp <= fLimitMax) {
@@ -826,7 +826,7 @@ void CFWL_FormImp::DoHeightLimit(FX_FLOAT& fTop,
FX_BOOL bTop) {
FX_FLOAT fx = 0;
FX_FLOAT fy = fCurY;
- TransformTo(NULL, fx, fy);
+ TransformTo(nullptr, fx, fy);
FX_FLOAT fTemp = bTop ? (fHeight - fy + fTop + fSpace) : (fy - fTop + fSpace);
if (fTemp >= fLimitMin && fTemp <= fLimitMax) {
fHeight = fTemp;
diff --git a/xfa/fwl/core/fwl_formimp.h b/xfa/fwl/core/fwl_formimp.h
index 7278afb681..ee1507d17e 100644
--- a/xfa/fwl/core/fwl_formimp.h
+++ b/xfa/fwl/core/fwl_formimp.h
@@ -94,10 +94,10 @@ class CFWL_FormImp : public CFWL_WidgetImp {
FX_FLOAT GetCaptionHeight();
void DrawCaptionText(CFX_Graphics* pGs,
IFWL_ThemeProvider* pTheme,
- const CFX_Matrix* pMatrix = NULL);
+ const CFX_Matrix* pMatrix = nullptr);
void DrawIconImage(CFX_Graphics* pGs,
IFWL_ThemeProvider* pTheme,
- const CFX_Matrix* pMatrix = NULL);
+ const CFX_Matrix* pMatrix = nullptr);
void GetEdgeRect(CFX_RectF& rtEdge);
void SetWorkAreaRect();
void SetCursor(FX_FLOAT fx, FX_FLOAT fy);
@@ -162,7 +162,7 @@ class CFWL_FormImpDelegate : 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 OnLButtonDown(CFWL_MsgMouse* pMsg);
diff --git a/xfa/fwl/core/fwl_noteimp.cpp b/xfa/fwl/core/fwl_noteimp.cpp
index b38592b2d3..cc5ff8d432 100644
--- a/xfa/fwl/core/fwl_noteimp.cpp
+++ b/xfa/fwl/core/fwl_noteimp.cpp
@@ -163,7 +163,7 @@ FX_BOOL CFWL_NoteDriver::SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify) {
if (bNotify) {
ms.m_dwExtend = 1;
}
- IFWL_WidgetDelegate* pDelegate = pPrev->SetDelegate(NULL);
+ IFWL_WidgetDelegate* pDelegate = pPrev->SetDelegate(nullptr);
if (pDelegate) {
pDelegate->OnProcessMessage(&ms);
}
@@ -183,7 +183,7 @@ FX_BOOL CFWL_NoteDriver::SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify) {
if (bNotify) {
ms.m_dwExtend = 1;
}
- IFWL_WidgetDelegate* pDelegate = pFocus->SetDelegate(NULL);
+ IFWL_WidgetDelegate* pDelegate = pFocus->SetDelegate(nullptr);
if (pDelegate) {
pDelegate->OnProcessMessage(&ms);
}
@@ -197,7 +197,7 @@ FWL_Error CFWL_NoteDriver::Run() {
#if (_FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_WIN32_DESKTOP_ || \
_FX_OS_ == _FX_WIN64_)
- CFWL_NoteLoop* pTopLoop = NULL;
+ CFWL_NoteLoop* pTopLoop = nullptr;
for (;;) {
pTopLoop = GetTopLoop();
if (!pTopLoop || !pTopLoop->ContinueModal())
@@ -220,28 +220,28 @@ void CFWL_NoteDriver::SetHover(IFWL_Widget* pHover) {
m_pHover = pHover;
}
void CFWL_NoteDriver::SetGrab(IFWL_Widget* pGrab, FX_BOOL bSet) {
- m_pGrab = bSet ? pGrab : NULL;
+ m_pGrab = bSet ? pGrab : nullptr;
}
void CFWL_NoteDriver::NotifyTargetHide(IFWL_Widget* pNoteTarget) {
if (m_pFocus == pNoteTarget) {
- m_pFocus = NULL;
+ m_pFocus = nullptr;
}
if (m_pHover == pNoteTarget) {
- m_pHover = NULL;
+ m_pHover = nullptr;
}
if (m_pGrab == pNoteTarget) {
- m_pGrab = NULL;
+ m_pGrab = nullptr;
}
}
void CFWL_NoteDriver::NotifyTargetDestroy(IFWL_Widget* pNoteTarget) {
if (m_pFocus == pNoteTarget) {
- m_pFocus = NULL;
+ m_pFocus = nullptr;
}
if (m_pHover == pNoteTarget) {
- m_pHover = NULL;
+ m_pHover = nullptr;
}
if (m_pGrab == pNoteTarget) {
- m_pGrab = NULL;
+ m_pGrab = nullptr;
}
UnregisterEventTarget(pNoteTarget);
int32_t count = m_forms.GetSize();
@@ -254,7 +254,7 @@ void CFWL_NoteDriver::NotifyTargetDestroy(IFWL_Widget* pNoteTarget) {
if (!pSubFocus)
return;
if (pSubFocus && pSubFocus->GetInterface() == pNoteTarget) {
- pForm->SetSubFocus(NULL);
+ pForm->SetSubFocus(nullptr);
}
}
}
@@ -388,7 +388,8 @@ FX_BOOL CFWL_NoteDriver::DispatchMessage(CFWL_Message* pMessage,
}
}
if (bRet) {
- IFWL_WidgetDelegate* pDelegate = pMessage->m_pDstTarget->SetDelegate(NULL);
+ IFWL_WidgetDelegate* pDelegate =
+ pMessage->m_pDstTarget->SetDelegate(nullptr);
if (pDelegate)
pDelegate->OnProcessMessage(pMessage);
}
@@ -458,7 +459,7 @@ FX_BOOL CFWL_NoteDriver::DoKillFocus(CFWL_MsgKillFocus* pMsg,
CFWL_WidgetMgr* pWidgetMgr = CFWL_WidgetMgr::GetInstance();
if (pWidgetMgr->IsFormDisabled()) {
if (m_pFocus == pMsg->m_pDstTarget) {
- m_pFocus = NULL;
+ m_pFocus = nullptr;
}
return TRUE;
}
@@ -470,7 +471,7 @@ FX_BOOL CFWL_NoteDriver::DoKillFocus(CFWL_MsgKillFocus* pMsg,
if (pSubFocus && (pSubFocus->GetStates() & FWL_WGTSTATE_Focused)) {
pMsg->m_pDstTarget = pSubFocus->GetInterface();
if (m_pFocus == pMsg->m_pDstTarget) {
- m_pFocus = NULL;
+ m_pFocus = nullptr;
return TRUE;
}
}
@@ -523,7 +524,7 @@ FX_BOOL CFWL_NoteDriver::DoMouse(CFWL_MsgMouse* pMsg,
if (pMsg->m_dwCmd == FWL_MouseCommand::Leave ||
pMsg->m_dwCmd == FWL_MouseCommand::Hover ||
pMsg->m_dwCmd == FWL_MouseCommand::Enter) {
- return pMsg->m_pDstTarget != NULL;
+ return !!pMsg->m_pDstTarget;
}
if (pMsg->m_pDstTarget != pMessageForm) {
pMsg->m_pDstTarget->TransformTo(pMessageForm, pMsg->m_fx, pMsg->m_fy);
@@ -569,7 +570,7 @@ FX_BOOL CFWL_NoteDriver::DoMouseEx(CFWL_MsgMouse* pMsg,
CFWL_WidgetMgr* pWidgetMgr = CFWL_WidgetMgr::GetInstance();
if (!pWidgetMgr)
return FALSE;
- IFWL_Widget* pTarget = NULL;
+ IFWL_Widget* pTarget = nullptr;
if (m_pGrab)
pTarget = m_pGrab;
if (!pTarget) {
@@ -706,7 +707,7 @@ int32_t CFWL_CoreToolTipDP::GetAutoPopDelay(IFWL_Widget* pWidget) {
}
CFX_DIBitmap* CFWL_CoreToolTipDP::GetToolTipIcon(IFWL_Widget* pWidget) {
- return NULL;
+ return nullptr;
}
CFX_SizeF CFWL_CoreToolTipDP::GetToolTipIconSize(IFWL_Widget* pWidget) {
@@ -734,7 +735,7 @@ int32_t CFWL_EventTarget::SetEventSource(IFWL_Widget* pSource,
}
FX_BOOL CFWL_EventTarget::ProcessEvent(CFWL_Event* pEvent) {
- IFWL_WidgetDelegate* pDelegate = m_pListener->SetDelegate(NULL);
+ IFWL_WidgetDelegate* pDelegate = m_pListener->SetDelegate(nullptr);
if (!pDelegate)
return FALSE;
if (m_eventSources.GetCount() == 0) {
@@ -743,7 +744,7 @@ FX_BOOL CFWL_EventTarget::ProcessEvent(CFWL_Event* pEvent) {
}
FX_POSITION pos = m_eventSources.GetStartPosition();
while (pos) {
- IFWL_Widget* pSource = NULL;
+ IFWL_Widget* pSource = nullptr;
uint32_t dwFilter = 0;
m_eventSources.GetNextAssoc(pos, (void*&)pSource, dwFilter);
if (pSource == pEvent->m_pSrcTarget ||
@@ -784,10 +785,10 @@ FX_BOOL CFWL_EventTarget::IsFilterEvent(CFWL_Event* pEvent, uint32_t dwFilter) {
}
}
-CFWL_ToolTipContainer* CFWL_ToolTipContainer::s_pInstance = NULL;
+CFWL_ToolTipContainer* CFWL_ToolTipContainer::s_pInstance = nullptr;
CFWL_ToolTipContainer::CFWL_ToolTipContainer()
- : pCurTarget(NULL), m_pToolTipImp(NULL) {
+ : pCurTarget(nullptr), m_pToolTipImp(nullptr) {
m_ToolTipDp = new CFWL_CoreToolTipDP;
m_ToolTipDp->m_nInitDelayTime = 0;
m_ToolTipDp->m_nAutoPopDelayTime = 2000;
@@ -812,7 +813,7 @@ CFWL_ToolTipContainer* CFWL_ToolTipContainer::getInstance() {
// static
void CFWL_ToolTipContainer::DeleteInstance() {
delete s_pInstance;
- s_pInstance = NULL;
+ s_pInstance = nullptr;
}
FWL_Error CFWL_ToolTipContainer::AddToolTipTarget(IFWL_ToolTipTarget* pTarget) {
@@ -845,7 +846,7 @@ FX_BOOL CFWL_ToolTipContainer::HasToolTip(IFWL_Widget* pWedget) {
FX_BOOL CFWL_ToolTipContainer::ProcessEnter(CFWL_EvtMouse* pEvt,
IFWL_Widget* pOwner) {
if (HasToolTip(pEvt->m_pDstTarget)) {
- if (NULL == m_pToolTipImp) {
+ if (!m_pToolTipImp) {
CFWL_WidgetImpProperties prop;
prop.m_pDataProvider = m_ToolTipDp;
prop.m_pOwner = pOwner;
@@ -884,7 +885,8 @@ FX_BOOL CFWL_ToolTipContainer::ProcessEnter(CFWL_EvtMouse* pEvt,
} else {
CFX_RectF rtAnchor;
pCurTarget->GetWidget()->GetClientRect(rtAnchor);
- pCurTarget->GetWidget()->TransformTo(NULL, rtAnchor.left, rtAnchor.top);
+ pCurTarget->GetWidget()->TransformTo(nullptr, rtAnchor.left,
+ rtAnchor.top);
m_pToolTipImp->SetAnchor(rtAnchor);
m_pToolTipImp->ModifyStylesEx(0, FWL_STYLEEXT_TTP_NoAnchor);
}
@@ -897,9 +899,9 @@ FX_BOOL CFWL_ToolTipContainer::ProcessEnter(CFWL_EvtMouse* pEvt,
return FALSE;
}
FX_BOOL CFWL_ToolTipContainer::ProcessLeave(CFWL_EvtMouse* pEvt) {
- if (HasToolTip(pEvt->m_pDstTarget) && NULL != m_pToolTipImp) {
+ if (HasToolTip(pEvt->m_pDstTarget) && m_pToolTipImp) {
m_pToolTipImp->Hide();
- pCurTarget = NULL;
+ pCurTarget = nullptr;
return TRUE;
}
return FALSE;
diff --git a/xfa/fwl/core/fwl_widgetimp.cpp b/xfa/fwl/core/fwl_widgetimp.cpp
index d556499e27..52a2978908 100644
--- a/xfa/fwl/core/fwl_widgetimp.cpp
+++ b/xfa/fwl/core/fwl_widgetimp.cpp
@@ -245,7 +245,7 @@ FWL_Error CFWL_WidgetImp::SetWidgetRect(const CFX_RectF& rect) {
ev.m_pSrcTarget = m_pInterface;
ev.m_rtOld = rtOld;
ev.m_rtNew = rect;
- IFWL_WidgetDelegate* pDelegate = SetDelegate(NULL);
+ IFWL_WidgetDelegate* pDelegate = SetDelegate(nullptr);
if (pDelegate) {
pDelegate->OnProcessEvent(&ev);
}
@@ -625,7 +625,7 @@ void CFWL_WidgetImp::GetRelativeRect(CFX_RectF& rect) {
void* CFWL_WidgetImp::GetThemeCapacity(CFWL_WidgetCapacity dwCapacity) {
IFWL_ThemeProvider* pTheme = GetAvailableTheme();
if (!pTheme)
- return NULL;
+ return nullptr;
CFWL_ThemePart part;
part.m_pWidget = m_pInterface;
return pTheme->GetCapacity(&part, dwCapacity);
@@ -710,7 +710,7 @@ void CFWL_WidgetImp::SetFocus(FX_BOOL bFocus) {
if (bFocus && curFocus != m_pInterface) {
pDriver->SetFocus(m_pInterface);
} else if (!bFocus && curFocus == m_pInterface) {
- pDriver->SetFocus(NULL);
+ pDriver->SetFocus(nullptr);
}
}
void CFWL_WidgetImp::SetGrab(FX_BOOL bSet) {
@@ -753,7 +753,7 @@ FX_BOOL CFWL_WidgetImp::GetPopupPosMenu(FX_FLOAT fMinHeight,
if (GetStylesEx() & FWL_STYLEEXT_MNU_Vert) {
FX_BOOL bLeft = m_pProperties->m_rtWidget.left < 0;
FX_FLOAT fRight = rtAnchor.right() + rtPopup.width;
- TransformTo(NULL, fx, fy);
+ TransformTo(nullptr, fx, fy);
if (fRight + fx > fScreenWidth || bLeft) {
rtPopup.Set(rtAnchor.left - rtPopup.width, rtAnchor.top, rtPopup.width,
rtPopup.height);
@@ -763,7 +763,7 @@ FX_BOOL CFWL_WidgetImp::GetPopupPosMenu(FX_FLOAT fMinHeight,
}
} else {
FX_FLOAT fBottom = rtAnchor.bottom() + rtPopup.height;
- TransformTo(NULL, fx, fy);
+ TransformTo(nullptr, fx, fy);
if (fBottom + fy > fScreenHeight) {
rtPopup.Set(rtAnchor.left, rtAnchor.top - rtPopup.height, rtPopup.width,
rtPopup.height);
@@ -792,7 +792,7 @@ FX_BOOL CFWL_WidgetImp::GetPopupPosComboBox(FX_FLOAT fMinHeight,
}
FX_FLOAT fWidth = std::max(rtAnchor.width, rtPopup.width);
FX_FLOAT fBottom = rtAnchor.bottom() + fPopHeight;
- TransformTo(NULL, fx, fy);
+ TransformTo(nullptr, fx, fy);
if (fBottom + fy > fScreenHeight) {
rtPopup.Set(rtAnchor.left, rtAnchor.top - fPopHeight, fWidth, fPopHeight);
} else {
@@ -810,7 +810,7 @@ FX_BOOL CFWL_WidgetImp::GetPopupPosGeneral(FX_FLOAT fMinHeight,
FX_FLOAT fScreenWidth = 0;
FX_FLOAT fScreenHeight = 0;
GetScreenSize(fScreenWidth, fScreenHeight);
- TransformTo(NULL, fx, fy);
+ TransformTo(nullptr, fx, fy);
if (rtAnchor.bottom() + fy > fScreenHeight) {
rtPopup.Set(rtAnchor.left, rtAnchor.top - rtPopup.height, rtPopup.width,
rtPopup.height);
@@ -860,7 +860,7 @@ void CFWL_WidgetImp::DispatchKeyEvent(CFWL_MsgKey* pNote) {
}
void CFWL_WidgetImp::DispatchEvent(CFWL_Event* pEvent) {
if (m_pOuter) {
- IFWL_WidgetDelegate* pDelegate = m_pOuter->SetDelegate(NULL);
+ IFWL_WidgetDelegate* pDelegate = m_pOuter->SetDelegate(nullptr);
pDelegate->OnProcessEvent(pEvent);
return;
}
diff --git a/xfa/fwl/core/fwl_widgetimp.h b/xfa/fwl/core/fwl_widgetimp.h
index be97c060f2..d8c4fe6eb6 100644
--- a/xfa/fwl/core/fwl_widgetimp.h
+++ b/xfa/fwl/core/fwl_widgetimp.h
@@ -63,7 +63,7 @@ class CFWL_WidgetImp {
virtual FWL_Error GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE);
virtual FWL_Error SetMatrix(const CFX_Matrix& matrix);
virtual FWL_Error DrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix = NULL);
+ const CFX_Matrix* pMatrix = nullptr);
virtual IFWL_ThemeProvider* GetThemeProvider();
virtual FWL_Error SetThemeProvider(IFWL_ThemeProvider* pThemeProvider);
virtual FWL_Error SetDataProvider(IFWL_DataProvider* pDataProvider);
@@ -132,24 +132,24 @@ class CFWL_WidgetImp {
const CFX_RectF& rtAnchor,
CFX_RectF& rtPopup);
FX_BOOL GetScreenSize(FX_FLOAT& fx, FX_FLOAT& fy);
- void RegisterEventTarget(IFWL_Widget* pEventSource = NULL,
+ void RegisterEventTarget(IFWL_Widget* pEventSource = nullptr,
uint32_t dwFilter = FWL_EVENT_ALL_MASK);
void UnregisterEventTarget();
void DispatchKeyEvent(CFWL_MsgKey* pNote);
void DispatchEvent(CFWL_Event* pEvent);
- void Repaint(const CFX_RectF* pRect = NULL);
+ void Repaint(const CFX_RectF* pRect = nullptr);
void DrawBackground(CFX_Graphics* pGraphics,
CFWL_Part iPartBk,
IFWL_ThemeProvider* pTheme,
- const CFX_Matrix* pMatrix = NULL);
+ const CFX_Matrix* pMatrix = nullptr);
void DrawBorder(CFX_Graphics* pGraphics,
CFWL_Part iPartBorder,
IFWL_ThemeProvider* pTheme,
- const CFX_Matrix* pMatrix = NULL);
+ const CFX_Matrix* pMatrix = nullptr);
void DrawEdge(CFX_Graphics* pGraphics,
CFWL_Part iPartEdge,
IFWL_ThemeProvider* pTheme,
- const CFX_Matrix* pMatrix = NULL);
+ const CFX_Matrix* pMatrix = nullptr);
void NotifyDriver();
FX_BOOL IsParent(IFWL_Widget* pParent);
@@ -174,7 +174,7 @@ class CFWL_WidgetImpDelegate : public IFWL_WidgetDelegate {
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;
};
#endif // XFA_FWL_CORE_FWL_WIDGETIMP_H_
diff --git a/xfa/fwl/core/ifwl_widget.h b/xfa/fwl/core/ifwl_widget.h
index 90a484def2..21099921e8 100644
--- a/xfa/fwl/core/ifwl_widget.h
+++ b/xfa/fwl/core/ifwl_widget.h
@@ -93,7 +93,7 @@ class IFWL_Widget {
FWL_Error GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE);
FWL_Error SetMatrix(const CFX_Matrix& matrix);
FWL_Error DrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix = NULL);
+ const CFX_Matrix* pMatrix = nullptr);
IFWL_ThemeProvider* GetThemeProvider();
FWL_Error SetThemeProvider(IFWL_ThemeProvider* pThemeProvider);
FWL_Error SetDataProvider(IFWL_DataProvider* pDataProvider);
diff --git a/xfa/fwl/lightwidget/cfwl_barcode.h b/xfa/fwl/lightwidget/cfwl_barcode.h
index 1a22064a97..466ff6ed09 100644
--- a/xfa/fwl/lightwidget/cfwl_barcode.h
+++ b/xfa/fwl/lightwidget/cfwl_barcode.h
@@ -17,7 +17,7 @@ class CFWL_WidgetProperties;
class CFWL_Barcode : public CFWL_Edit {
public:
static CFWL_Barcode* Create();
- FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
void SetType(BC_TYPE type);
FX_BOOL IsProtectedType();
diff --git a/xfa/fwl/lightwidget/cfwl_checkbox.h b/xfa/fwl/lightwidget/cfwl_checkbox.h
index 7fcd43a6eb..eb23536e25 100644
--- a/xfa/fwl/lightwidget/cfwl_checkbox.h
+++ b/xfa/fwl/lightwidget/cfwl_checkbox.h
@@ -17,7 +17,7 @@ class CFWL_CheckBox : public CFWL_Widget {
static CFWL_CheckBox* Create();
- FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
FWL_Error SetCaption(const CFX_WideStringC& wsCaption);
FWL_Error SetBoxSize(FX_FLOAT fHeight);
int32_t GetCheckState();
diff --git a/xfa/fwl/lightwidget/cfwl_combobox.cpp b/xfa/fwl/lightwidget/cfwl_combobox.cpp
index 9d20c97824..01b64dcd07 100644
--- a/xfa/fwl/lightwidget/cfwl_combobox.cpp
+++ b/xfa/fwl/lightwidget/cfwl_combobox.cpp
@@ -169,9 +169,7 @@ FWL_Error CFWL_ComboBox::SetItemData(int32_t iIndex, void* pData) {
void* CFWL_ComboBox::GetItemData(int32_t iIndex) {
CFWL_ComboBoxItem* pItem =
static_cast<CFWL_ComboBoxItem*>(m_comboBoxData.GetItem(m_pIface, iIndex));
- if (!pItem)
- return NULL;
- return pItem->m_pData;
+ return pItem ? pItem->m_pData : nullptr;
}
FWL_Error CFWL_ComboBox::SetListTheme(IFWL_ThemeProvider* pTheme) {
@@ -357,9 +355,7 @@ FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::GetItemRect(IFWL_Widget* pWidget,
void* CFWL_ComboBox::CFWL_ComboBoxDP::GetItemData(IFWL_Widget* pWidget,
IFWL_ListItem* pItem) {
- if (!pItem)
- return NULL;
- return static_cast<CFWL_ComboBoxItem*>(pItem)->m_pData;
+ return pItem ? static_cast<CFWL_ComboBoxItem*>(pItem)->m_pData : nullptr;
}
FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::SetItemStyles(IFWL_Widget* pWidget,
@@ -396,9 +392,7 @@ FX_FLOAT CFWL_ComboBox::CFWL_ComboBoxDP::GetItemHeight(IFWL_Widget* pWidget) {
CFX_DIBitmap* CFWL_ComboBox::CFWL_ComboBoxDP::GetItemIcon(
IFWL_Widget* pWidget,
IFWL_ListItem* pItem) {
- if (!pItem)
- return NULL;
- return static_cast<CFWL_ComboBoxItem*>(pItem)->m_pDIB;
+ return pItem ? static_cast<CFWL_ComboBoxItem*>(pItem)->m_pDIB : nullptr;
}
FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::GetItemCheckRect(IFWL_Widget* pWidget,
diff --git a/xfa/fwl/lightwidget/cfwl_combobox.h b/xfa/fwl/lightwidget/cfwl_combobox.h
index ba5db16f87..ab703fe372 100644
--- a/xfa/fwl/lightwidget/cfwl_combobox.h
+++ b/xfa/fwl/lightwidget/cfwl_combobox.h
@@ -24,7 +24,7 @@ class CFWL_ComboBox : public CFWL_Widget {
~CFWL_ComboBox() override;
static CFWL_ComboBox* Create();
- FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
int32_t AddString(const CFX_WideStringC& wsText);
int32_t AddString(const CFX_WideStringC& wsText, CFX_DIBitmap* pIcon);
bool RemoveAt(int32_t iIndex); // Returns false iff |iIndex| out of range.
diff --git a/xfa/fwl/lightwidget/cfwl_datetimepicker.h b/xfa/fwl/lightwidget/cfwl_datetimepicker.h
index 2fa385fede..4348b6cd38 100644
--- a/xfa/fwl/lightwidget/cfwl_datetimepicker.h
+++ b/xfa/fwl/lightwidget/cfwl_datetimepicker.h
@@ -14,7 +14,7 @@ class CFWL_DateTimePicker : public CFWL_Widget {
public:
static CFWL_DateTimePicker* Create();
- FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
FWL_Error SetToday(int32_t iYear, int32_t iMonth, int32_t iDay);
FWL_Error GetEditText(CFX_WideString& wsText);
FWL_Error SetEditText(const CFX_WideString& wsText);
diff --git a/xfa/fwl/lightwidget/cfwl_edit.h b/xfa/fwl/lightwidget/cfwl_edit.h
index a9c058a514..a6db961a2b 100644
--- a/xfa/fwl/lightwidget/cfwl_edit.h
+++ b/xfa/fwl/lightwidget/cfwl_edit.h
@@ -20,7 +20,7 @@ class CFWL_Edit : public CFWL_Widget {
~CFWL_Edit() override;
static CFWL_Edit* Create();
- FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
FWL_Error SetText(const CFX_WideString& wsText);
int32_t GetTextLength() const;
FWL_Error GetText(CFX_WideString& wsText,
diff --git a/xfa/fwl/lightwidget/cfwl_listbox.cpp b/xfa/fwl/lightwidget/cfwl_listbox.cpp
index be6a6b1249..e85e773813 100644
--- a/xfa/fwl/lightwidget/cfwl_listbox.cpp
+++ b/xfa/fwl/lightwidget/cfwl_listbox.cpp
@@ -81,7 +81,7 @@ int32_t CFWL_ListBox::CountSelItems() {
IFWL_ListItem* CFWL_ListBox::GetSelItem(int32_t nIndexSel) {
if (!m_pIface)
- return NULL;
+ return nullptr;
return static_cast<IFWL_ListBox*>(m_pIface)->GetSelItem(nIndexSel);
}
@@ -164,9 +164,7 @@ FWL_Error CFWL_ListBox::SetItemData(IFWL_ListItem* pItem, void* pData) {
}
void* CFWL_ListBox::GetItemData(IFWL_ListItem* pItem) {
- if (!pItem)
- return NULL;
- return static_cast<CFWL_ListItem*>(pItem)->m_pData;
+ return pItem ? static_cast<CFWL_ListItem*>(pItem)->m_pData : nullptr;
}
IFWL_ListItem* CFWL_ListBox::GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy) {
@@ -178,20 +176,20 @@ IFWL_ListItem* CFWL_ListBox::GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy) {
FX_FLOAT fPosY = 0;
static_cast<IFWL_ListBox*>(m_pIface)->GetScrollPos(fx);
static_cast<IFWL_ListBox*>(m_pIface)->GetScrollPos(fy, FALSE);
- int32_t nCount = m_ListBoxDP.CountItems(NULL);
+ int32_t nCount = m_ListBoxDP.CountItems(nullptr);
for (int32_t i = 0; i < nCount; i++) {
- IFWL_ListItem* pItem = m_ListBoxDP.GetItem(NULL, i);
+ IFWL_ListItem* pItem = m_ListBoxDP.GetItem(nullptr, i);
if (!pItem) {
continue;
}
CFX_RectF rtItem;
- m_ListBoxDP.GetItemRect(NULL, pItem, rtItem);
+ m_ListBoxDP.GetItemRect(nullptr, pItem, rtItem);
rtItem.Offset(-fPosX, -fPosY);
if (rtItem.Contains(fx, fy)) {
return pItem;
}
}
- return NULL;
+ return nullptr;
}
uint32_t CFWL_ListBox::GetItemStates(IFWL_ListItem* pItem) {
@@ -273,9 +271,7 @@ FWL_Error CFWL_ListBox::CFWL_ListBoxDP::GetItemRect(IFWL_Widget* pWidget,
void* CFWL_ListBox::CFWL_ListBoxDP::GetItemData(IFWL_Widget* pWidget,
IFWL_ListItem* pItem) {
- if (!pItem)
- return NULL;
- return static_cast<CFWL_ListItem*>(pItem)->m_pData;
+ return pItem ? static_cast<CFWL_ListItem*>(pItem)->m_pData : nullptr;
}
FWL_Error CFWL_ListBox::CFWL_ListBoxDP::SetItemStyles(IFWL_Widget* pWidget,
@@ -346,8 +342,8 @@ CFWL_ListItem::CFWL_ListItem() {
m_rtItem.Reset();
m_dwStates = 0;
m_wsText = L"";
- m_pDIB = NULL;
- m_pData = NULL;
+ m_pDIB = nullptr;
+ m_pData = nullptr;
m_dwCheckState = 0;
m_rtCheckBox.Reset();
}
diff --git a/xfa/fwl/lightwidget/cfwl_listbox.h b/xfa/fwl/lightwidget/cfwl_listbox.h
index c684015b61..725a7248a1 100644
--- a/xfa/fwl/lightwidget/cfwl_listbox.h
+++ b/xfa/fwl/lightwidget/cfwl_listbox.h
@@ -23,7 +23,7 @@ class CFWL_ListBox : public CFWL_Widget {
~CFWL_ListBox() override;
static CFWL_ListBox* Create();
- FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
FWL_Error AddDIBitmap(CFX_DIBitmap* pDIB, IFWL_ListItem* pItem);
IFWL_ListItem* AddString(const CFX_WideStringC& wsAdd,
FX_BOOL bSelect = FALSE);
diff --git a/xfa/fwl/lightwidget/cfwl_picturebox.h b/xfa/fwl/lightwidget/cfwl_picturebox.h
index 95a0117224..ffc67f4446 100644
--- a/xfa/fwl/lightwidget/cfwl_picturebox.h
+++ b/xfa/fwl/lightwidget/cfwl_picturebox.h
@@ -18,7 +18,7 @@ class CFWL_PictureBox : public CFWL_Widget {
static CFWL_PictureBox* Create();
- FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
CFX_DIBitmap* GetPicture();
FWL_Error SetPicture(CFX_DIBitmap* pBitmap);
FX_FLOAT GetRotation();
diff --git a/xfa/fwl/lightwidget/cfwl_pushbutton.h b/xfa/fwl/lightwidget/cfwl_pushbutton.h
index 145f5ed6f0..c2b71681c2 100644
--- a/xfa/fwl/lightwidget/cfwl_pushbutton.h
+++ b/xfa/fwl/lightwidget/cfwl_pushbutton.h
@@ -17,7 +17,7 @@ class CFWL_PushButton : public CFWL_Widget {
static CFWL_PushButton* Create();
- FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
FWL_Error GetCaption(CFX_WideString& wsCaption);
FWL_Error SetCaption(const CFX_WideStringC& wsCaption);
CFX_DIBitmap* GetPicture();
@@ -26,7 +26,7 @@ class CFWL_PushButton : public CFWL_Widget {
protected:
class CFWL_PushButtonDP : public IFWL_PushButtonDP {
public:
- CFWL_PushButtonDP() : m_pBitmap(NULL) {}
+ CFWL_PushButtonDP() : m_pBitmap(nullptr) {}
// IFWL_DataProvider
FWL_Error GetCaption(IFWL_Widget* pWidget,
diff --git a/xfa/fwl/lightwidget/cfwl_widget.h b/xfa/fwl/lightwidget/cfwl_widget.h
index ea17627063..2c180bad8f 100644
--- a/xfa/fwl/lightwidget/cfwl_widget.h
+++ b/xfa/fwl/lightwidget/cfwl_widget.h
@@ -57,14 +57,14 @@ class CFWL_Widget {
FWL_Error GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE);
FWL_Error SetMatrix(const CFX_Matrix& matrix);
FWL_Error DrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix = NULL);
+ const CFX_Matrix* pMatrix = nullptr);
IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate);
- FWL_Error Repaint(const CFX_RectF* pRect = NULL);
+ FWL_Error Repaint(const CFX_RectF* pRect = nullptr);
FWL_Error SetFocus(FX_BOOL bFocus);
FWL_Error SetGrab(FX_BOOL bSet);
CFWL_Widget();
- void RegisterEventTarget(CFWL_Widget* pEventSource = NULL,
+ void RegisterEventTarget(CFWL_Widget* pEventSource = nullptr,
uint32_t dwFilter = FWL_EVENT_ALL_MASK);
void DispatchEvent(CFWL_Event* pEvent);
CFX_SizeF CalcTextSize(const CFX_WideString& wsText,
@@ -76,7 +76,7 @@ class CFWL_Widget {
CFWL_WidgetProperties* m_pProperties;
protected:
- FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
};
#endif // XFA_FWL_LIGHTWIDGET_CFWL_WIDGET_H_
diff --git a/xfa/fwl/theme/cfwl_carettp.h b/xfa/fwl/theme/cfwl_carettp.h
index 03b376a61e..faf37e725a 100644
--- a/xfa/fwl/theme/cfwl_carettp.h
+++ b/xfa/fwl/theme/cfwl_carettp.h
@@ -23,7 +23,7 @@ class CFWL_CaretTP : public CFWL_WidgetTP {
uint32_t dwStates,
const CFX_RectF* pRect,
CFX_Color* crFill,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
};
#endif // XFA_FWL_THEME_CFWL_CARETTP_H_
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.h b/xfa/fwl/theme/cfwl_checkboxtp.h
index a502b92926..ce44f70aef 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.h
+++ b/xfa/fwl/theme/cfwl_checkboxtp.h
@@ -30,44 +30,44 @@ class CFWL_CheckBoxTP : public CFWL_WidgetTP {
CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
uint32_t dwStates,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawSign(IFWL_Widget* pWidget,
CFX_Graphics* pGraphics,
const CFX_RectF* pRtBox,
uint32_t dwStates,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawSignNeutral(CFX_Graphics* pGraphics,
const CFX_RectF* pRtSign,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawSignCheck(CFX_Graphics* pGraphics,
const CFX_RectF* pRtSign,
FX_ARGB argbFill,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawSignCircle(CFX_Graphics* pGraphics,
const CFX_RectF* pRtSign,
FX_ARGB argbFill,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawSignCross(CFX_Graphics* pGraphics,
const CFX_RectF* pRtSign,
FX_ARGB argbFill,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawSignDiamond(CFX_Graphics* pGraphics,
const CFX_RectF* pRtSign,
FX_ARGB argbFill,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawSignSquare(CFX_Graphics* pGraphics,
const CFX_RectF* pRtSign,
FX_ARGB argbFill,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawSignStar(CFX_Graphics* pGraphics,
const CFX_RectF* pRtSign,
FX_ARGB argbFill,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawSignBorder(IFWL_Widget* pWidget,
CFX_Graphics* pGraphics,
const CFX_RectF* pRtBox,
FX_BOOL bDisable = FALSE,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void SetThemeData(uint32_t dwID);
void initCheckPath(FX_FLOAT fCheckLen);
struct CKBThemeData {
diff --git a/xfa/fwl/theme/cfwl_listboxtp.h b/xfa/fwl/theme/cfwl_listboxtp.h
index a13df08845..9a6c457d5d 100644
--- a/xfa/fwl/theme/cfwl_listboxtp.h
+++ b/xfa/fwl/theme/cfwl_listboxtp.h
@@ -24,8 +24,8 @@ class CFWL_ListBoxTP : public CFWL_WidgetTP {
void DrawListBoxItem(CFX_Graphics* pGraphics,
uint32_t dwStates,
const CFX_RectF* prtItem,
- void* pData = NULL,
- CFX_Matrix* pMatrix = NULL);
+ void* pData = nullptr,
+ CFX_Matrix* pMatrix = nullptr);
};
#endif // XFA_FWL_THEME_CFWL_LISTBOXTP_H_
diff --git a/xfa/fwl/theme/cfwl_scrollbartp.h b/xfa/fwl/theme/cfwl_scrollbartp.h
index 84e18193db..ce32f5e774 100644
--- a/xfa/fwl/theme/cfwl_scrollbartp.h
+++ b/xfa/fwl/theme/cfwl_scrollbartp.h
@@ -38,23 +38,23 @@ class CFWL_ScrollBarTP : public CFWL_WidgetTP {
FX_BOOL bVert,
FWLTHEME_STATE eState,
FX_BOOL bPawButton = TRUE,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawTrack(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
FX_BOOL bVert,
FWLTHEME_STATE eState,
FX_BOOL bLowerTrack,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawMaxMinBtn(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
FWLTHEME_DIRECTION eDict,
FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawPaw(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
FX_BOOL bVert,
FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void SetThemeData(uint32_t dwID);
struct SBThemeData* m_pThemeData;
diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp
index 867e908a0e..3ef9b0ba2d 100644
--- a/xfa/fwl/theme/cfwl_widgettp.cpp
+++ b/xfa/fwl/theme/cfwl_widgettp.cpp
@@ -150,7 +150,7 @@ void* CFWL_WidgetTP::GetCapacity(CFWL_ThemePart* pThemePart,
m_rtMargin.Set(0, 0, 0, 0);
return &m_rtMargin;
}
- default: { return NULL; }
+ default: { return nullptr; }
}
return &m_fValue;
}
@@ -665,17 +665,17 @@ void CFWL_WidgetTP::DrawArrowBtn(CFX_Graphics* pGraphics,
CFWL_ArrowData::GetInstance()->m_pColorData;
DrawArrow(pGraphics, pRect, eDict, pColorData->clrSign[eState - 1], pMatrix);
}
-CFWL_ArrowData::CFWL_ArrowData() : m_pColorData(NULL) {
+CFWL_ArrowData::CFWL_ArrowData() : m_pColorData(nullptr) {
SetColorData(0);
}
CFWL_FontData::CFWL_FontData()
: m_dwStyles(0),
m_dwCodePage(0),
m_pFont(0),
- m_pFontMgr(NULL)
+ m_pFontMgr(nullptr)
#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
,
- m_pFontSource(NULL)
+ m_pFontSource(nullptr)
#endif
{
}
@@ -687,7 +687,7 @@ CFWL_FontData::~CFWL_FontData() {
m_pFontMgr->Release();
}
#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
- if (m_pFontSource != NULL) {
+ if (m_pFontSource) {
m_pFontSource->Release();
}
#endif
@@ -714,7 +714,7 @@ FX_BOOL CFWL_FontData::LoadFont(const CFX_WideStringC& wsFontFamily,
}
m_pFont = CFGAS_GEFont::LoadFont(wsFontFamily.c_str(), dwFontStyles,
dwCodePage, m_pFontMgr);
- return m_pFont != NULL;
+ return !!m_pFont;
}
CFWL_FontManager* CFWL_FontManager::s_FontManager = nullptr;
@@ -756,7 +756,7 @@ uint32_t FWL_GetThemeColor(uint32_t dwThemeID) {
return 0x0000ffff & dwThemeID;
}
-CFWL_ArrowData* CFWL_ArrowData::m_pInstance = NULL;
+CFWL_ArrowData* CFWL_ArrowData::m_pInstance = nullptr;
CFWL_ArrowData* CFWL_ArrowData::GetInstance() {
if (!m_pInstance)
diff --git a/xfa/fwl/theme/cfwl_widgettp.h b/xfa/fwl/theme/cfwl_widgettp.h
index 20be62619e..d8015e19db 100644
--- a/xfa/fwl/theme/cfwl_widgettp.h
+++ b/xfa/fwl/theme/cfwl_widgettp.h
@@ -147,7 +147,7 @@ class CFWL_WidgetTP {
void DrawEdge(CFX_Graphics* pGraphics,
uint32_t dwStyles,
const CFX_RectF* pRect,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void Draw3DRect(CFX_Graphics* pGraphics,
FWLTHEME_EDGE eType,
FX_FLOAT fWidth,
@@ -156,7 +156,7 @@ class CFWL_WidgetTP {
FX_ARGB cr2,
FX_ARGB cr3,
FX_ARGB cr4,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void Draw3DCircle(CFX_Graphics* pGraphics,
FWLTHEME_EDGE eType,
FX_FLOAT fWidth,
@@ -165,17 +165,17 @@ class CFWL_WidgetTP {
FX_ARGB cr2,
FX_ARGB cr3,
FX_ARGB cr4,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawBorder(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void FillBackground(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void FillSoildRect(CFX_Graphics* pGraphics,
FX_ARGB fillColor,
const CFX_RectF* pRect,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawAxialShading(CFX_Graphics* pGraphics,
FX_FLOAT fx1,
FX_FLOAT fy1,
@@ -185,40 +185,40 @@ class CFWL_WidgetTP {
FX_ARGB endColor,
CFX_Path* path,
int32_t fillMode = FXFILL_WINDING,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawAnnulusRect(CFX_Graphics* pGraphics,
FX_ARGB fillColor,
const CFX_RectF* pRect,
FX_FLOAT fRingWidth = 1,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawAnnulusCircle(CFX_Graphics* pGraphics,
FX_ARGB fillColor,
const CFX_RectF* pRect,
FX_FLOAT fWidth = 1,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawFocus(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawArrow(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
FWLTHEME_DIRECTION eDict,
FX_ARGB argbFill,
FX_BOOL bPressed,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawArrow(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
FWLTHEME_DIRECTION eDict,
FX_ARGB argSign,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawBtn(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
void DrawArrowBtn(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
FWLTHEME_DIRECTION eDict,
FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix = NULL);
+ CFX_Matrix* pMatrix = nullptr);
uint32_t m_dwRefCount;
std::unique_ptr<CFDE_TextOut> m_pTextOut;
CFGAS_GEFont* m_pFDEFont;