summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-06-07 17:53:06 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-07 17:53:06 -0700
commit1cd352e0a4bc19f96df199b0acfa32a344240d5e (patch)
treebe24d7a4bd135c2ab5568148ab318b7bf648edda /fpdfsdk/pdfwindow
parenta4fdfc5ed0e8d2e6acc52cc34eac42c6072f0ccc (diff)
downloadpdfium-1cd352e0a4bc19f96df199b0acfa32a344240d5e.tar.xz
Get rid of NULLs in fpdfsdk/
Review-Url: https://codereview.chromium.org/2031653003
Diffstat (limited to 'fpdfsdk/pdfwindow')
-rw-r--r--fpdfsdk/pdfwindow/PWL_Caret.h2
-rw-r--r--fpdfsdk/pdfwindow/PWL_ComboBox.cpp10
-rw-r--r--fpdfsdk/pdfwindow/PWL_Edit.cpp6
-rw-r--r--fpdfsdk/pdfwindow/PWL_EditCtrl.cpp8
-rw-r--r--fpdfsdk/pdfwindow/PWL_FontMap.cpp24
-rw-r--r--fpdfsdk/pdfwindow/PWL_Icon.cpp9
-rw-r--r--fpdfsdk/pdfwindow/PWL_IconList.cpp13
-rw-r--r--fpdfsdk/pdfwindow/PWL_Label.cpp4
-rw-r--r--fpdfsdk/pdfwindow/PWL_ListBox.cpp16
-rw-r--r--fpdfsdk/pdfwindow/PWL_ScrollBar.cpp10
-rw-r--r--fpdfsdk/pdfwindow/PWL_Signature.cpp8
-rw-r--r--fpdfsdk/pdfwindow/PWL_Utils.cpp6
-rw-r--r--fpdfsdk/pdfwindow/PWL_Utils.h4
-rw-r--r--fpdfsdk/pdfwindow/PWL_Wnd.cpp20
-rw-r--r--fpdfsdk/pdfwindow/PWL_Wnd.h18
15 files changed, 81 insertions, 77 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_Caret.h b/fpdfsdk/pdfwindow/PWL_Caret.h
index a7cf1d4c05..0f002a2b4a 100644
--- a/fpdfsdk/pdfwindow/PWL_Caret.h
+++ b/fpdfsdk/pdfwindow/PWL_Caret.h
@@ -28,7 +28,7 @@ class CPWL_Caret : public CPWL_Wnd {
void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override;
void DrawThisAppearance(CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device) override;
- void InvalidateRect(CFX_FloatRect* pRect = NULL) override;
+ void InvalidateRect(CFX_FloatRect* pRect = nullptr) override;
void SetVisible(FX_BOOL bVisible) override {}
void TimerProc() override;
diff --git a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
index f49016123a..c5560228f1 100644
--- a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
@@ -169,7 +169,7 @@ void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice,
path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO);
path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO);
- pDevice->DrawPath(&path, pUser2Device, NULL,
+ pDevice->DrawPath(&path, pUser2Device, nullptr,
CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_BLACKCOLOR,
GetTransparency()),
0, FXFILL_ALTERNATE);
@@ -201,13 +201,13 @@ FX_BOOL CPWL_CBButton::OnLButtonUp(const CFX_FloatPoint& point,
}
CPWL_ComboBox::CPWL_ComboBox()
- : m_pEdit(NULL),
- m_pButton(NULL),
- m_pList(NULL),
+ : m_pEdit(nullptr),
+ m_pButton(nullptr),
+ m_pList(nullptr),
m_bPopup(FALSE),
m_nPopupWhere(0),
m_nSelectItem(-1),
- m_pFillerNotify(NULL) {}
+ m_pFillerNotify(nullptr) {}
CFX_ByteString CPWL_ComboBox::GetClassName() const {
return "CPWL_ComboBox";
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp
index eec1fd98c7..21d4b033ab 100644
--- a/fpdfsdk/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp
@@ -388,7 +388,7 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice,
CFX_FloatRect rcClip;
CPVT_WordRange wrRange = m_pEdit->GetVisibleWordRange();
- CPVT_WordRange* pRange = NULL;
+ CPVT_WordRange* pRange = nullptr;
if (!HasFlag(PES_TEXTOVERFLOW)) {
rcClip = GetClientRect();
@@ -938,7 +938,7 @@ void CPWL_Edit::GeneratePageObjects(
const CFX_FloatPoint& ptOffset,
CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray) {
IFX_Edit::GeneratePageObjects(
- pObjectHolder, m_pEdit, ptOffset, NULL,
+ pObjectHolder, m_pEdit, ptOffset, nullptr,
CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()),
ObjArray);
}
@@ -947,7 +947,7 @@ void CPWL_Edit::GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder,
const CFX_FloatPoint& ptOffset) {
CFX_ArrayTemplate<CPDF_TextObject*> ObjArray;
IFX_Edit::GeneratePageObjects(
- pObjectHolder, m_pEdit, ptOffset, NULL,
+ pObjectHolder, m_pEdit, ptOffset, nullptr,
CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()),
ObjArray);
}
diff --git a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
index aa653929bd..e74a6d8b32 100644
--- a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
+++ b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
@@ -22,9 +22,9 @@
CPWL_EditCtrl::CPWL_EditCtrl()
: m_pEdit(IFX_Edit::NewEdit()),
- m_pEditCaret(NULL),
+ m_pEditCaret(nullptr),
m_bMouseDown(FALSE),
- m_pEditNotify(NULL),
+ m_pEditNotify(nullptr),
m_nCharSet(DEFAULT_CHARSET),
m_nCodePage(0) {}
@@ -450,7 +450,7 @@ CPDF_Font* CPWL_EditCtrl::GetCaretFont() const {
if (IPVT_FontMap* pFontMap = GetFontMap())
return pFontMap->GetPDFFont(nFontIndex);
- return NULL;
+ return nullptr;
}
FX_FLOAT CPWL_EditCtrl::GetCaretFontSize() const {
@@ -563,7 +563,7 @@ void CPWL_EditCtrl::IOnSetCaret(FX_BOOL bVisible,
cInfo.ptHead = ptHead;
cInfo.ptFoot = ptFoot;
- OnNotify(this, PNM_SETCARETINFO, (intptr_t)&cInfo, (intptr_t)NULL);
+ OnNotify(this, PNM_SETCARETINFO, (intptr_t)&cInfo, (intptr_t) nullptr);
}
void CPWL_EditCtrl::IOnCaretChange(const CPVT_SecProps& secProps,
diff --git a/fpdfsdk/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/pdfwindow/PWL_FontMap.cpp
index f73468bf2b..d4eab01cfd 100644
--- a/fpdfsdk/pdfwindow/PWL_FontMap.cpp
+++ b/fpdfsdk/pdfwindow/PWL_FontMap.cpp
@@ -35,13 +35,13 @@ const char* const g_sDEStandardFontName[] = {"Courier",
} // namespace
CPWL_FontMap::CPWL_FontMap(CFX_SystemHandler* pSystemHandler)
- : m_pPDFDoc(NULL), m_pSystemHandler(pSystemHandler) {
+ : m_pPDFDoc(nullptr), m_pSystemHandler(pSystemHandler) {
ASSERT(m_pSystemHandler);
}
CPWL_FontMap::~CPWL_FontMap() {
delete m_pPDFDoc;
- m_pPDFDoc = NULL;
+ m_pPDFDoc = nullptr;
Empty();
}
@@ -68,7 +68,7 @@ CPDF_Font* CPWL_FontMap::GetPDFFont(int32_t nFontIndex) {
}
}
- return NULL;
+ return nullptr;
}
CFX_ByteString CPWL_FontMap::GetPDFFontAlias(int32_t nFontIndex) {
@@ -208,7 +208,7 @@ int32_t CPWL_FontMap::GetFontIndex(const CFX_ByteString& sFontName,
return nFontIndex;
CFX_ByteString sAlias;
- CPDF_Font* pFont = NULL;
+ CPDF_Font* pFont = nullptr;
if (bFind)
pFont = FindFontSameCharset(sAlias, nCharset);
@@ -246,7 +246,7 @@ int32_t CPWL_FontMap::GetPWLFontIndex(uint16_t word, int32_t nCharset) {
CPDF_Font* CPWL_FontMap::FindFontSameCharset(CFX_ByteString& sFontAlias,
int32_t nCharset) {
- return NULL;
+ return nullptr;
}
int32_t CPWL_FontMap::AddFontData(CPDF_Font* pFont,
@@ -301,12 +301,12 @@ CPDF_Font* CPWL_FontMap::AddFontToDocument(CPDF_Document* pDoc,
CPDF_Font* CPWL_FontMap::AddStandardFont(CPDF_Document* pDoc,
CFX_ByteString& sFontName) {
if (!pDoc)
- return NULL;
+ return nullptr;
- CPDF_Font* pFont = NULL;
+ CPDF_Font* pFont = nullptr;
if (sFontName == "ZapfDingbats") {
- pFont = pDoc->AddStandardFont(sFontName.c_str(), NULL);
+ pFont = pDoc->AddStandardFont(sFontName.c_str(), nullptr);
} else {
CPDF_FontEncoding fe(PDFFONT_ENCODING_WINANSI);
pFont = pDoc->AddStandardFont(sFontName.c_str(), &fe);
@@ -319,7 +319,7 @@ CPDF_Font* CPWL_FontMap::AddSystemFont(CPDF_Document* pDoc,
CFX_ByteString& sFontName,
uint8_t nCharset) {
if (!pDoc)
- return NULL;
+ return nullptr;
if (sFontName.IsEmpty())
sFontName = GetNativeFont(nCharset);
@@ -330,7 +330,7 @@ CPDF_Font* CPWL_FontMap::AddSystemFont(CPDF_Document* pDoc,
return m_pSystemHandler->AddNativeTrueTypeFontToPDF(pDoc, sFontName,
nCharset);
- return NULL;
+ return nullptr;
}
CFX_ByteString CPWL_FontMap::EncodeFontAlias(const CFX_ByteString& sFontName,
@@ -355,7 +355,7 @@ const CPWL_FontMap_Data* CPWL_FontMap::GetFontMapData(int32_t nIndex) const {
return m_aData.GetAt(nIndex);
}
- return NULL;
+ return nullptr;
}
int32_t CPWL_FontMap::GetNativeCharset() {
@@ -424,7 +424,7 @@ const CPWL_FontMap::CharsetFontMap CPWL_FontMap::defaultTTFMap[] = {
#else
{EASTEUROPE_CHARSET, "Tahoma"},
#endif
- {ARABIC_CHARSET, "Arial"}, {-1, NULL}};
+ {ARABIC_CHARSET, "Arial"}, {-1, nullptr}};
CFX_ByteString CPWL_FontMap::GetDefaultFontByCharset(int32_t nCharset) {
int i = 0;
diff --git a/fpdfsdk/pdfwindow/PWL_Icon.cpp b/fpdfsdk/pdfwindow/PWL_Icon.cpp
index 18111ac358..9c2e5cbf69 100644
--- a/fpdfsdk/pdfwindow/PWL_Icon.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Icon.cpp
@@ -11,7 +11,7 @@
#include "fpdfsdk/pdfwindow/PWL_Utils.h"
#include "fpdfsdk/pdfwindow/PWL_Wnd.h"
-CPWL_Image::CPWL_Image() : m_pPDFStream(NULL) {}
+CPWL_Image::CPWL_Image() : m_pPDFStream(nullptr) {}
CPWL_Image::~CPWL_Image() {}
@@ -108,7 +108,7 @@ void CPWL_Image::GetImageOffset(FX_FLOAT& x, FX_FLOAT& y) {
y = 0.0f;
}
-CPWL_Icon::CPWL_Icon() : m_pIconFit(NULL) {}
+CPWL_Icon::CPWL_Icon() : m_pIconFit(nullptr) {}
CPWL_Icon::~CPWL_Icon() {}
@@ -130,8 +130,9 @@ void CPWL_Icon::GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom) {
if (m_pIconFit) {
fLeft = 0.0f;
fBottom = 0.0f;
- CPDF_Array* pA =
- m_pIconFit->GetDict() ? m_pIconFit->GetDict()->GetArrayBy("A") : NULL;
+ CPDF_Array* pA = m_pIconFit->GetDict()
+ ? m_pIconFit->GetDict()->GetArrayBy("A")
+ : nullptr;
if (pA) {
size_t dwCount = pA->GetCount();
if (dwCount > 0)
diff --git a/fpdfsdk/pdfwindow/PWL_IconList.cpp b/fpdfsdk/pdfwindow/PWL_IconList.cpp
index 4928560f1c..26d6c92ea4 100644
--- a/fpdfsdk/pdfwindow/PWL_IconList.cpp
+++ b/fpdfsdk/pdfwindow/PWL_IconList.cpp
@@ -19,7 +19,10 @@
#define PWL_IconList_ITEM_SPACE 4.0f
CPWL_IconList_Item::CPWL_IconList_Item()
- : m_nIconIndex(-1), m_pData(NULL), m_bSelected(FALSE), m_pText(NULL) {}
+ : m_nIconIndex(-1),
+ m_pData(nullptr),
+ m_bSelected(FALSE),
+ m_pText(nullptr) {}
CPWL_IconList_Item::~CPWL_IconList_Item() {}
@@ -288,7 +291,7 @@ CPWL_IconList_Item* CPWL_IconList_Content::GetListItem(
}
}
- return NULL;
+ return nullptr;
}
void CPWL_IconList_Content::SetListData(int32_t nItemIndex, void* pData) {
@@ -328,7 +331,7 @@ void CPWL_IconList_Content::SetIconFillColor(const CPWL_Color& color) {
}
CPWL_IconList::CPWL_IconList(int32_t nListCount)
- : m_pListContent(NULL), m_nListCount(nListCount) {}
+ : m_pListContent(nullptr), m_nListCount(nListCount) {}
CPWL_IconList::~CPWL_IconList() {}
@@ -392,7 +395,7 @@ void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd,
m_pListContent->SetScrollPos(
CFX_FloatPoint(0.0f, *(FX_FLOAT*)lParam));
m_pListContent->ResetFace();
- m_pListContent->InvalidateRect(NULL);
+ m_pListContent->InvalidateRect(nullptr);
}
return;
case PNM_SETSCROLLPOS:
@@ -461,7 +464,7 @@ FX_BOOL CPWL_IconList::OnMouseWheel(short zDelta,
if (ptNew.y != ptScroll.y) {
m_pListContent->SetScrollPos(ptNew);
m_pListContent->ResetFace();
- m_pListContent->InvalidateRect(NULL);
+ m_pListContent->InvalidateRect(nullptr);
if (CPWL_ScrollBar* pScrollBar = GetVScrollBar())
pScrollBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL,
diff --git a/fpdfsdk/pdfwindow/PWL_Label.cpp b/fpdfsdk/pdfwindow/PWL_Label.cpp
index 203ec49e0f..83d299cd34 100644
--- a/fpdfsdk/pdfwindow/PWL_Label.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Label.cpp
@@ -87,7 +87,7 @@ void CPWL_Label::DrawThisAppearance(CFX_RenderDevice* pDevice,
CFX_FloatRect rcClip;
CPVT_WordRange wrRange = m_pEdit->GetVisibleWordRange();
- CPVT_WordRange* pRange = NULL;
+ CPVT_WordRange* pRange = nullptr;
if (!HasFlag(PES_TEXTOVERFLOW)) {
rcClip = GetClientRect();
@@ -98,7 +98,7 @@ void CPWL_Label::DrawThisAppearance(CFX_RenderDevice* pDevice,
pDevice, pUser2Device, m_pEdit,
CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()),
CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor(), GetTransparency()),
- rcClip, CFX_FloatPoint(0.0f, 0.0f), pRange, pSysHandler, NULL);
+ rcClip, CFX_FloatPoint(0.0f, 0.0f), pRange, pSysHandler, nullptr);
}
void CPWL_Label::SetHorzScale(int32_t nHorzScale) {
diff --git a/fpdfsdk/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/pdfwindow/PWL_ListBox.cpp
index 86f3b8f24a..84d2614804 100644
--- a/fpdfsdk/pdfwindow/PWL_ListBox.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ListBox.cpp
@@ -65,18 +65,18 @@ void CPWL_List_Notify::IOnInvalidateRect(CFX_FloatRect* pRect) {
}
CPWL_ListBox::CPWL_ListBox()
- : m_pList(NULL),
- m_pListNotify(NULL),
+ : m_pList(nullptr),
+ m_pListNotify(nullptr),
m_bMouseDown(FALSE),
m_bHoverSel(FALSE),
- m_pFillerNotify(NULL) {
+ m_pFillerNotify(nullptr) {
m_pList = IFX_List::NewList();
}
CPWL_ListBox::~CPWL_ListBox() {
IFX_List::DelList(m_pList);
delete m_pListNotify;
- m_pListNotify = NULL;
+ m_pListNotify = nullptr;
}
CFX_ByteString CPWL_ListBox::GetClassName() const {
@@ -100,7 +100,7 @@ void CPWL_ListBox::OnCreated() {
void CPWL_ListBox::OnDestroy() {
delete m_pListNotify;
- m_pListNotify = NULL;
+ m_pListNotify = nullptr;
}
void CPWL_ListBox::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
@@ -187,21 +187,21 @@ void CPWL_ListBox::DrawThisAppearance(CFX_RenderDevice* pDevice,
pDevice, pUser2Device, m_pList->GetItemEdit(i),
CPWL_Utils::PWLColorToFXColor(GetTextColor()),
CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor()), rcList,
- ptOffset, NULL, pSysHandler, m_pFormFiller);
+ ptOffset, nullptr, pSysHandler, m_pFormFiller);
pSysHandler->OutputSelectedRect(m_pFormFiller, rcItem);
} else {
CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcItem,
ArgbEncode(255, 0, 51, 113));
IFX_Edit::DrawEdit(pDevice, pUser2Device, m_pList->GetItemEdit(i),
ArgbEncode(255, 255, 255, 255), 0, rcList,
- ptOffset, NULL, pSysHandler, m_pFormFiller);
+ ptOffset, nullptr, pSysHandler, m_pFormFiller);
}
} else {
CFX_SystemHandler* pSysHandler = GetSystemHandler();
IFX_Edit::DrawEdit(pDevice, pUser2Device, m_pList->GetItemEdit(i),
CPWL_Utils::PWLColorToFXColor(GetTextColor()),
CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor()),
- rcList, ptOffset, NULL, pSysHandler, NULL);
+ rcList, ptOffset, nullptr, pSysHandler, nullptr);
}
}
}
diff --git a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
index 9532244bc9..7cec290a6b 100644
--- a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
@@ -273,7 +273,7 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice,
path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO);
path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO);
- pDevice->DrawPath(&path, pUser2Device, NULL,
+ pDevice->DrawPath(&path, pUser2Device, nullptr,
CPWL_Utils::PWLColorToFXColor(
PWL_DEFAULT_BLACKCOLOR, nTransparancy),
0, FXFILL_ALTERNATE);
@@ -297,7 +297,7 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice,
path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO);
path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO);
- pDevice->DrawPath(&path, pUser2Device, NULL,
+ pDevice->DrawPath(&path, pUser2Device, nullptr,
CPWL_Utils::PWLColorToFXColor(
PWL_DEFAULT_BLACKCOLOR, nTransparancy),
0, FXFILL_ALTERNATE);
@@ -579,9 +579,9 @@ FX_BOOL CPWL_SBButton::OnMouseMove(const CFX_FloatPoint& point,
CPWL_ScrollBar::CPWL_ScrollBar(PWL_SCROLLBAR_TYPE sbType)
: m_sbType(sbType),
- m_pMinButton(NULL),
- m_pMaxButton(NULL),
- m_pPosButton(NULL),
+ m_pMinButton(nullptr),
+ m_pMaxButton(nullptr),
+ m_pPosButton(nullptr),
m_bMouseDown(FALSE),
m_bMinOrMax(FALSE),
m_bNotifyForever(TRUE) {}
diff --git a/fpdfsdk/pdfwindow/PWL_Signature.cpp b/fpdfsdk/pdfwindow/PWL_Signature.cpp
index c737998f26..7513950cb7 100644
--- a/fpdfsdk/pdfwindow/PWL_Signature.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Signature.cpp
@@ -12,7 +12,7 @@
#include "fpdfsdk/pdfwindow/PWL_Utils.h"
#include "fpdfsdk/pdfwindow/PWL_Wnd.h"
-CPWL_Signature_Image::CPWL_Signature_Image() : m_pImage(NULL) {}
+CPWL_Signature_Image::CPWL_Signature_Image() : m_pImage(nullptr) {}
CPWL_Signature_Image::~CPWL_Signature_Image() {}
@@ -57,9 +57,9 @@ void CPWL_Signature_Image::GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale) {
}
CPWL_Signature::CPWL_Signature()
- : m_pText(NULL),
- m_pDescription(NULL),
- m_pImage(NULL),
+ : m_pText(nullptr),
+ m_pDescription(nullptr),
+ m_pImage(nullptr),
m_bTextExist(TRUE),
m_bImageExist(FALSE),
m_bFlagExist(TRUE) {}
diff --git a/fpdfsdk/pdfwindow/PWL_Utils.cpp b/fpdfsdk/pdfwindow/PWL_Utils.cpp
index e4232db5e8..f5d30b2d14 100644
--- a/fpdfsdk/pdfwindow/PWL_Utils.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Utils.cpp
@@ -1222,7 +1222,7 @@ void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice,
CFX_PathData path;
CFX_FloatRect rcTemp(rect);
path.AppendRect(rcTemp.left, rcTemp.bottom, rcTemp.right, rcTemp.top);
- pDevice->DrawPath(&path, pUser2Device, NULL, color, 0, FXFILL_WINDING);
+ pDevice->DrawPath(&path, pUser2Device, nullptr, color, 0, FXFILL_WINDING);
}
void CPWL_Utils::DrawFillArea(CFX_RenderDevice* pDevice,
@@ -1237,7 +1237,7 @@ void CPWL_Utils::DrawFillArea(CFX_RenderDevice* pDevice,
for (int32_t i = 1; i < nCount; i++)
path.SetPoint(i, pPts[i].x, pPts[i].y, FXPT_LINETO);
- pDevice->DrawPath(&path, pUser2Device, NULL, color, 0, FXFILL_ALTERNATE);
+ pDevice->DrawPath(&path, pUser2Device, nullptr, color, 0, FXFILL_ALTERNATE);
}
void CPWL_Utils::DrawStrokeRect(CFX_RenderDevice* pDevice,
@@ -1340,7 +1340,7 @@ void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice,
path.AppendRect(fLeft, fBottom, fRight, fTop);
path.AppendRect(fLeft + fWidth, fBottom + fWidth, fRight - fWidth,
fTop - fWidth);
- pDevice->DrawPath(&path, pUser2Device, NULL,
+ pDevice->DrawPath(&path, pUser2Device, nullptr,
PWLColorToFXColor(color, nTransparancy), 0,
FXFILL_ALTERNATE);
break;
diff --git a/fpdfsdk/pdfwindow/PWL_Utils.h b/fpdfsdk/pdfwindow/PWL_Utils.h
index 8ab08a857e..db79cf77e2 100644
--- a/fpdfsdk/pdfwindow/PWL_Utils.h
+++ b/fpdfsdk/pdfwindow/PWL_Utils.h
@@ -168,13 +168,13 @@ class CPWL_Utils {
static CFX_ByteString GetEditAppStream(IFX_Edit* pEdit,
const CFX_FloatPoint& ptOffset,
- const CPVT_WordRange* pRange = NULL,
+ const CPVT_WordRange* pRange = nullptr,
FX_BOOL bContinuous = TRUE,
uint16_t SubWord = 0);
static CFX_ByteString GetEditSelAppStream(
IFX_Edit* pEdit,
const CFX_FloatPoint& ptOffset,
- const CPVT_WordRange* pRange = NULL);
+ const CPVT_WordRange* pRange = nullptr);
static CFX_ByteString GetTextAppStream(const CFX_FloatRect& rcBBox,
IPVT_FontMap* pFontMap,
const CFX_WideString& sText,
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
index 310f2f3f90..2a0a0aabbb 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
@@ -55,7 +55,7 @@ void CPWL_Timer::TimerProc(int32_t idEvent) {
pTimer->m_pAttached->TimerProc();
}
-CPWL_TimerHandler::CPWL_TimerHandler() : m_pTimer(NULL) {}
+CPWL_TimerHandler::CPWL_TimerHandler() : m_pTimer(nullptr) {}
CPWL_TimerHandler::~CPWL_TimerHandler() {
delete m_pTimer;
@@ -90,8 +90,8 @@ class CPWL_MsgControl {
void Default() {
m_aMousePath.RemoveAll();
m_aKeyboardPath.RemoveAll();
- m_pMainMouseWnd = NULL;
- m_pMainKeyboardWnd = NULL;
+ m_pMainMouseWnd = nullptr;
+ m_pMainKeyboardWnd = nullptr;
}
FX_BOOL IsWndCreated(const CPWL_Wnd* pWnd) const {
@@ -149,7 +149,7 @@ class CPWL_MsgControl {
if (CPWL_Wnd* pWnd = m_aKeyboardPath.GetAt(0))
pWnd->OnKillFocus();
- m_pMainKeyboardWnd = NULL;
+ m_pMainKeyboardWnd = nullptr;
m_aKeyboardPath.RemoveAll();
}
@@ -168,7 +168,7 @@ class CPWL_MsgControl {
}
void ReleaseCapture() {
- m_pMainMouseWnd = NULL;
+ m_pMainMouseWnd = nullptr;
m_aMousePath.RemoveAll();
}
@@ -181,7 +181,7 @@ class CPWL_MsgControl {
};
CPWL_Wnd::CPWL_Wnd()
- : m_pVScrollBar(NULL),
+ : m_pVScrollBar(nullptr),
m_rcWindow(),
m_rcClip(),
m_bCreated(FALSE),
@@ -255,7 +255,7 @@ void CPWL_Wnd::Destroy() {
if (CPWL_Wnd* pChild = m_aChildren[i]) {
pChild->Destroy();
delete pChild;
- pChild = NULL;
+ pChild = nullptr;
}
}
@@ -268,7 +268,7 @@ void CPWL_Wnd::Destroy() {
FXSYS_memset(&m_sPrivateParam, 0, sizeof(PWL_CREATEPARAM));
m_aChildren.RemoveAll();
- m_pVScrollBar = NULL;
+ m_pVScrollBar = nullptr;
}
void CPWL_Wnd::Move(const CFX_FloatRect& rcNew,
@@ -624,7 +624,7 @@ CPWL_ScrollBar* CPWL_Wnd::GetVScrollBar() const {
if (HasFlag(PWS_VSCROLL))
return m_pVScrollBar;
- return NULL;
+ return nullptr;
}
void CPWL_Wnd::CreateScrollBar(const PWL_CREATEPARAM& cp) {
@@ -958,7 +958,7 @@ const CPWL_Wnd* CPWL_Wnd::GetFocused() const {
return pMsgCtrl->m_pMainKeyboardWnd;
}
- return NULL;
+ return nullptr;
}
void CPWL_Wnd::EnableWindow(FX_BOOL bEnable) {
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.h b/fpdfsdk/pdfwindow/PWL_Wnd.h
index c8552fb985..c393d2730e 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.h
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.h
@@ -188,13 +188,13 @@ struct PWL_CREATEPARAM {
public:
PWL_CREATEPARAM()
: rcRectWnd(0, 0, 0, 0),
- pSystemHandler(NULL),
- pFontMap(NULL),
- pProvider(NULL),
- pFocusHandler(NULL),
+ pSystemHandler(nullptr),
+ pFontMap(nullptr),
+ pProvider(nullptr),
+ pFocusHandler(nullptr),
dwFlags(0),
sBackgroundColor(),
- hAttachedWnd(NULL),
+ hAttachedWnd(nullptr),
nBorderStyle(BorderStyle::SOLID),
dwBorderWidth(1),
sBorderColor(),
@@ -203,9 +203,9 @@ struct PWL_CREATEPARAM {
nTransparency(255),
fFontSize(PWL_DEFAULT_FONTSIZE),
sDash(3, 0, 0),
- pAttachedData(NULL),
- pParentWnd(NULL),
- pMsgControl(NULL),
+ pAttachedData(nullptr),
+ pParentWnd(nullptr),
+ pMsgControl(nullptr),
eCursorType(FXCT_ARROW),
mtChild(1, 0, 0, 1, 0, 0) {}
@@ -274,7 +274,7 @@ class CPWL_Wnd : public CPWL_TimerHandler {
void InvalidateProvider(IPWL_Provider* provider);
void Destroy();
void Move(const CFX_FloatRect& rcNew, FX_BOOL bReset, FX_BOOL bRefresh);
- virtual void InvalidateRect(CFX_FloatRect* pRect = NULL);
+ virtual void InvalidateRect(CFX_FloatRect* pRect = nullptr);
void DrawAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device);