Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1082)

Unified Diff: xfa/fgas/layout/fgas_rtfbreak.h

Issue 2031873003: Get rid of NULLs in xfa/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@nullptr_fpdfsdk
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fgas/font/fgas_stdfontmgr.cpp ('k') | xfa/fgas/layout/fgas_rtfbreak.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fgas/layout/fgas_rtfbreak.h
diff --git a/xfa/fgas/layout/fgas_rtfbreak.h b/xfa/fgas/layout/fgas_rtfbreak.h
index d2041615d0595187dc7c90e4faeda8929f805425..ee30df287b54ce8d659835fb8dc9f05d3196c3ca 100644
--- a/xfa/fgas/layout/fgas_rtfbreak.h
+++ b/xfa/fgas/layout/fgas_rtfbreak.h
@@ -65,15 +65,15 @@ class IFGAS_Font;
struct FX_RTFTEXTOBJ {
FX_RTFTEXTOBJ() {
- pStr = NULL;
- pWidths = NULL;
+ pStr = nullptr;
+ pWidths = nullptr;
iLength = 0;
- pFont = NULL;
+ pFont = nullptr;
fFontSize = 12.0f;
dwLayoutStyles = 0;
iCharRotation = 0;
iBidiLevel = 0;
- pRect = NULL;
+ pRect = nullptr;
wLineBreakChar = L'\n';
iHorizontalScale = 100;
iVerticalScale = 100;
@@ -109,11 +109,10 @@ class CFX_RTFPiece : public CFX_Target {
m_iVerticalScale(100),
m_dwLayoutStyles(0),
m_dwIdentity(0),
- m_pChars(NULL),
- m_pUserData(NULL) {}
+ m_pChars(nullptr),
+ m_pUserData(nullptr) {}
~CFX_RTFPiece() { Reset(); }
void AppendChar(const CFX_RTFChar& tc) {
- ASSERT(m_pChars != NULL);
m_pChars->Add(tc);
if (m_iWidth < 0) {
m_iWidth = tc.m_iCharWidth;
@@ -128,15 +127,15 @@ class CFX_RTFPiece : public CFX_Target {
int32_t GetLength() const { return m_iChars; }
int32_t GetEndChar() const { return m_iStartChar + m_iChars; }
CFX_RTFChar& GetChar(int32_t index) {
- ASSERT(index > -1 && index < m_iChars && m_pChars != NULL);
+ ASSERT(index > -1 && index < m_iChars && m_pChars);
return *m_pChars->GetDataPtr(m_iStartChar + index);
}
CFX_RTFChar* GetCharPtr(int32_t index) const {
- ASSERT(index > -1 && index < m_iChars && m_pChars != NULL);
+ ASSERT(index > -1 && index < m_iChars && m_pChars);
return m_pChars->GetDataPtr(m_iStartChar + index);
}
void GetString(FX_WCHAR* pText) const {
- ASSERT(pText != NULL);
+ ASSERT(pText);
int32_t iEndChar = m_iStartChar + m_iChars;
CFX_RTFChar* pChar;
for (int32_t i = m_iStartChar; i < iEndChar; i++) {
@@ -150,7 +149,7 @@ class CFX_RTFPiece : public CFX_Target {
wsText.ReleaseBuffer(m_iChars);
}
void GetWidths(int32_t* pWidths) const {
- ASSERT(pWidths != NULL);
+ ASSERT(pWidths);
int32_t iEndChar = m_iStartChar + m_iChars;
CFX_RTFChar* pChar;
for (int32_t i = m_iStartChar; i < iEndChar; i++) {
@@ -219,13 +218,11 @@ class CFX_RTFLine {
int32_t GetLineEnd() const { return m_iStart + m_iWidth; }
void RemoveAll(FX_BOOL bLeaveMemory = FALSE) {
CFX_RTFChar* pChar;
- IFX_Retainable* pUnknown;
int32_t iCount = m_LineChars.GetSize();
for (int32_t i = 0; i < iCount; i++) {
pChar = m_LineChars.GetDataPtr(i);
- if ((pUnknown = pChar->m_pUserData) != NULL) {
- pUnknown->Release();
- }
+ if (pChar->m_pUserData)
+ pChar->m_pUserData->Release();
}
m_LineChars.RemoveAll();
m_LinePieces.RemoveAll(bLeaveMemory);
@@ -277,8 +274,8 @@ class CFX_RTFBreak {
int32_t GetDisplayPos(const FX_RTFTEXTOBJ* pText,
FXTEXT_CHARPOS* pCharPos,
FX_BOOL bCharCode = FALSE,
- CFX_WideString* pWSForms = NULL,
- FX_AdjustCharDisplayPos pAdjustPos = NULL) const;
+ CFX_WideString* pWSForms = nullptr,
+ FX_AdjustCharDisplayPos pAdjustPos = nullptr) const;
int32_t GetCharRects(const FX_RTFTEXTOBJ* pText,
CFX_RectFArray& rtArray,
FX_BOOL bCharBBox = FALSE) const;
« no previous file with comments | « xfa/fgas/font/fgas_stdfontmgr.cpp ('k') | xfa/fgas/layout/fgas_rtfbreak.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698