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

Unified Diff: fpdfsdk/formfiller/cba_fontmap.cpp

Issue 2031653003: Get rid of NULLs in fpdfsdk/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@nullptr_core
Patch Set: rebase 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 | « core/fxcrt/include/fx_memory.h ('k') | fpdfsdk/formfiller/cffl_combobox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/formfiller/cba_fontmap.cpp
diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp
index 4c74d5a242a4b9c4ae6abfd0a0f56bab5b631e66..9102b7bf9a1ad23d2bf0b1bbc1272646feb0f5e4 100644
--- a/fpdfsdk/formfiller/cba_fontmap.cpp
+++ b/fpdfsdk/formfiller/cba_fontmap.cpp
@@ -16,9 +16,9 @@
CBA_FontMap::CBA_FontMap(CPDFSDK_Annot* pAnnot,
CFX_SystemHandler* pSystemHandler)
: CPWL_FontMap(pSystemHandler),
- m_pDocument(NULL),
- m_pAnnotDict(NULL),
- m_pDefaultFont(NULL),
+ m_pDocument(nullptr),
+ m_pAnnotDict(nullptr),
+ m_pDefaultFont(nullptr),
m_sAPType("N") {
CPDF_Page* pPage = pAnnot->GetPDFPage();
@@ -31,7 +31,7 @@ CBA_FontMap::~CBA_FontMap() {}
void CBA_FontMap::Reset() {
Empty();
- m_pDefaultFont = NULL;
+ m_pDefaultFont = nullptr;
m_sDefaultFontName = "";
}
@@ -83,20 +83,20 @@ CPDF_Font* CBA_FontMap::FindFontSameCharset(CFX_ByteString& sFontAlias,
CPDF_Document* pDocument = GetDocument();
CPDF_Dictionary* pRootDict = pDocument->GetRoot();
if (!pRootDict)
- return NULL;
+ return nullptr;
CPDF_Dictionary* pAcroFormDict = pRootDict->GetDictBy("AcroForm");
if (!pAcroFormDict)
- return NULL;
+ return nullptr;
CPDF_Dictionary* pDRDict = pAcroFormDict->GetDictBy("DR");
if (!pDRDict)
- return NULL;
+ return nullptr;
return FindResFontSameCharset(pDRDict, sFontAlias, nCharset);
}
- return NULL;
+ return nullptr;
}
CPDF_Document* CBA_FontMap::GetDocument() {
@@ -107,14 +107,14 @@ CPDF_Font* CBA_FontMap::FindResFontSameCharset(CPDF_Dictionary* pResDict,
CFX_ByteString& sFontAlias,
int32_t nCharset) {
if (!pResDict)
- return NULL;
+ return nullptr;
CPDF_Dictionary* pFonts = pResDict->GetDictBy("Font");
if (!pFonts)
- return NULL;
+ return nullptr;
CPDF_Document* pDocument = GetDocument();
- CPDF_Font* pFind = NULL;
+ CPDF_Font* pFind = nullptr;
for (const auto& it : *pFonts) {
const CFX_ByteString& csKey = it.first;
CPDF_Object* pObj = it.second;
@@ -165,7 +165,7 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont,
CPDF_Stream* pStream = pAPDict->GetStreamBy(m_sAPType);
if (!pStream) {
- pStream = new CPDF_Stream(NULL, 0, NULL);
+ pStream = new CPDF_Stream(nullptr, 0, nullptr);
int32_t objnum = m_pDocument->AddIndirectObject(pStream);
pAPDict->SetAtReference(m_sAPType, m_pDocument, objnum);
}
@@ -174,7 +174,7 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont,
if (!pStreamDict) {
pStreamDict = new CPDF_Dictionary;
- pStream->InitStream(NULL, 0, pStreamDict);
+ pStream->InitStream(nullptr, 0, pStreamDict);
}
if (pStreamDict) {
@@ -199,7 +199,7 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont,
}
CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString& sAlias) {
- CPDF_Dictionary* pAcroFormDict = NULL;
+ CPDF_Dictionary* pAcroFormDict = nullptr;
const bool bWidget = (m_pAnnotDict->GetStringBy("Subtype") == "Widget");
if (bWidget) {
if (CPDF_Dictionary* pRootDict = m_pDocument->GetRoot())
@@ -218,7 +218,7 @@ CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString& sAlias) {
}
}
- CPDF_Dictionary* pFontDict = NULL;
+ CPDF_Dictionary* pFontDict = nullptr;
if (!sDA.IsEmpty()) {
CPDF_SimpleParser syntax(sDA.AsStringC());
« no previous file with comments | « core/fxcrt/include/fx_memory.h ('k') | fpdfsdk/formfiller/cffl_combobox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698