diff options
author | Lei Zhang <thestig@chromium.org> | 2015-06-13 01:01:06 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-06-13 01:01:06 -0700 |
commit | 366e1c47335717b73d14b804020291758c8afc38 (patch) | |
tree | 74c8503b4614fb949db17a9010e38365d33eb427 /core/src/fpdfapi | |
parent | 95e854f3d8a6e1971b4538cc57c6e7c533b4aaed (diff) | |
download | pdfium-366e1c47335717b73d14b804020291758c8afc38.tar.xz |
Merge to XFA: Remove unneeded checks in CPDF_DocPageData::GetFontFileStreamAcc().
The input cannot be null. Same for CPDF_Document::LoadFontFile().
Also set the contract for CPDF_Document::LoadFont() and adjust callers
accordingly.
Also remove unused CPDF_Document::FindFont().
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1184673002.
(cherry picked from commit 1972b16849fedfda675eacd5c8594b54dbd1264d)
Review URL: https://codereview.chromium.org/1181393002.
Diffstat (limited to 'core/src/fpdfapi')
-rw-r--r-- | core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp index 7ccf948698..ab945c5f87 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp @@ -75,27 +75,18 @@ void CPDF_PageModule::NotifyCJKAvailable() { m_FontGlobals.m_CMapManager.ReloadAll(); } + CPDF_Font* CPDF_Document::LoadFont(CPDF_Dictionary* pFontDict) { - if (!pFontDict) { - return NULL; - } + ASSERT(pFontDict); return GetValidatePageData()->GetFont(pFontDict, FALSE); } -CPDF_Font* CPDF_Document::FindFont(CPDF_Dictionary* pFontDict) -{ - if (!pFontDict) { - return NULL; - } - return GetValidatePageData()->GetFont(pFontDict, TRUE); -} + CPDF_StreamAcc* CPDF_Document::LoadFontFile(CPDF_Stream* pStream) { - if (pStream == NULL) { - return NULL; - } return GetValidatePageData()->GetFontFileStreamAcc(pStream); } + CPDF_ColorSpace* _CSFromName(const CFX_ByteString& name); CPDF_ColorSpace* CPDF_Document::LoadColorSpace(CPDF_Object* pCSObj, CPDF_Dictionary* pResources) { @@ -599,8 +590,7 @@ void CPDF_DocPageData::ReleaseIccProfile(CPDF_IccProfile* pIccProfile) CPDF_StreamAcc* CPDF_DocPageData::GetFontFileStreamAcc(CPDF_Stream* pFontStream) { - if (!pFontStream) - return nullptr; + ASSERT(pFontStream); auto it = m_FontFileMap.find(pFontStream); if (it != m_FontFileMap.end()) { |