summaryrefslogtreecommitdiff
path: root/xfa/fwl/core
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/core
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/core')
-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
10 files changed, 74 insertions, 71 deletions
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);