summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cba_fontmap.cpp
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/formfiller/cba_fontmap.cpp
parenta4fdfc5ed0e8d2e6acc52cc34eac42c6072f0ccc (diff)
downloadpdfium-1cd352e0a4bc19f96df199b0acfa32a344240d5e.tar.xz
Get rid of NULLs in fpdfsdk/
Review-Url: https://codereview.chromium.org/2031653003
Diffstat (limited to 'fpdfsdk/formfiller/cba_fontmap.cpp')
-rw-r--r--fpdfsdk/formfiller/cba_fontmap.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp
index 4c74d5a242..9102b7bf9a 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());