diff options
author | dsinclair <dsinclair@chromium.org> | 2016-04-27 12:47:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-27 12:47:01 -0700 |
commit | 303e525325904cd9b6a847f48951510e7dd8a45e (patch) | |
tree | dab3ff0e3bda317dc51ef0caf8d15daf88e7e6b8 /xfa/fxfa/app | |
parent | 43854a5073602a4613131aa6dbac5f7b9a095bcd (diff) | |
download | pdfium-303e525325904cd9b6a847f48951510e7dd8a45e.tar.xz |
More IFX_ interface cleanup.
Remove IFX_FontProvider, IFX_FontSourceEnum, IFX_SAXReader and
IFX_SAXReaderHandler.
Review-Url: https://codereview.chromium.org/1930533002
Diffstat (limited to 'xfa/fxfa/app')
-rw-r--r-- | xfa/fxfa/app/xfa_checksum.cpp | 21 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_ffapp.cpp | 3 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_fontmgr.cpp | 8 |
3 files changed, 19 insertions, 13 deletions
diff --git a/xfa/fxfa/app/xfa_checksum.cpp b/xfa/fxfa/app/xfa_checksum.cpp index 59bf37b6a5..195033bfab 100644 --- a/xfa/fxfa/app/xfa_checksum.cpp +++ b/xfa/fxfa/app/xfa_checksum.cpp @@ -126,30 +126,28 @@ void CXFA_SAXReaderHandler::UpdateChecksum(FX_BOOL bCheckSpace) { } CXFA_ChecksumContext::CXFA_ChecksumContext() - : m_pSAXReader(NULL), m_pByteContext(NULL) {} + : m_pSAXReader(nullptr), m_pByteContext(nullptr) {} + CXFA_ChecksumContext::~CXFA_ChecksumContext() { FinishChecksum(); } -FX_BOOL CXFA_ChecksumContext::StartChecksum() { + +void CXFA_ChecksumContext::StartChecksum() { FinishChecksum(); m_pByteContext = FX_Alloc(uint8_t, 128); CRYPT_SHA1Start(m_pByteContext); m_bsChecksum.clear(); - m_pSAXReader = FX_SAXReader_Create(); - return m_pSAXReader != NULL; + m_pSAXReader = new CFX_SAXReader; } + FX_BOOL CXFA_ChecksumContext::UpdateChecksum(IFX_FileRead* pSrcFile, FX_FILESIZE offset, size_t size) { - if (m_pSAXReader == NULL) { - return FALSE; - } - if (pSrcFile == NULL) { + if (!m_pSAXReader || !pSrcFile) return FALSE; - } - if (size < 1) { + if (size < 1) size = pSrcFile->GetSize(); - } + CXFA_SAXReaderHandler handler(this); m_pSAXReader->SetHandler(&handler); if (m_pSAXReader->StartParse( @@ -161,6 +159,7 @@ FX_BOOL CXFA_ChecksumContext::UpdateChecksum(IFX_FileRead* pSrcFile, } return m_pSAXReader->ContinueParse(NULL) > 99; } + void CXFA_ChecksumContext::FinishChecksum() { if (m_pSAXReader) { m_pSAXReader->Release(); diff --git a/xfa/fxfa/app/xfa_ffapp.cpp b/xfa/fxfa/app/xfa_ffapp.cpp index 71b8fc44b1..987b3e8efd 100644 --- a/xfa/fxfa/app/xfa_ffapp.cpp +++ b/xfa/fxfa/app/xfa_ffapp.cpp @@ -8,6 +8,7 @@ #include <algorithm> +#include "xfa/fgas/font/fgas_stdfontmgr.h" #include "xfa/fwl/core/ifwl_widgetmgrdelegate.h" #include "xfa/fxfa/app/xfa_fwladapter.h" #include "xfa/fxfa/app/xfa_fwltheme.h" @@ -146,7 +147,7 @@ IFX_FontMgr* CXFA_FFApp::GetFDEFontMgr() { #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ m_pFDEFontMgr = IFX_FontMgr::Create(FX_GetDefFontEnumerator()); #else - m_pFontSource = FX_CreateDefaultFontSourceEnum(); + m_pFontSource = new CFX_FontSourceEnum_File; m_pFDEFontMgr = IFX_FontMgr::Create(m_pFontSource); #endif } diff --git a/xfa/fxfa/app/xfa_fontmgr.cpp b/xfa/fxfa/app/xfa_fontmgr.cpp index 7c6d5cddec..69883674e5 100644 --- a/xfa/fxfa/app/xfa_fontmgr.cpp +++ b/xfa/fxfa/app/xfa_fontmgr.cpp @@ -1874,6 +1874,7 @@ IFX_Font* CXFA_PDFFontMgr::FindFont(CFX_ByteString strPsName, } return NULL; } + IFX_Font* CXFA_PDFFontMgr::GetFont(const CFX_WideStringC& wsFontFamily, uint32_t dwFontStyles, CPDF_Font** pPDFFont, @@ -1894,6 +1895,7 @@ IFX_Font* CXFA_PDFFontMgr::GetFont(const CFX_WideStringC& wsFontFamily, m_FontMap[strKey] = pFont; return pFont; } + CFX_ByteString CXFA_PDFFontMgr::PsNameToFontName( const CFX_ByteString& strPsName, FX_BOOL bBold, @@ -1907,6 +1909,7 @@ CFX_ByteString CXFA_PDFFontMgr::PsNameToFontName( } return strPsName; } + FX_BOOL CXFA_PDFFontMgr::PsNameMatchDRFontName( const CFX_ByteStringC& bsPsName, FX_BOOL bBold, @@ -1996,10 +1999,13 @@ FX_BOOL CXFA_PDFFontMgr::GetCharWidth(IFX_Font* pFont, iWidth = pPDFFont->GetCharWidthF(wUnicode); return TRUE; } -CXFA_FontMgr::CXFA_FontMgr() : m_pDefFontMgr(NULL) {} + +CXFA_FontMgr::CXFA_FontMgr() : m_pDefFontMgr(nullptr) {} + CXFA_FontMgr::~CXFA_FontMgr() { DelAllMgrMap(); } + IFX_Font* CXFA_FontMgr::GetFont(CXFA_FFDoc* hDoc, const CFX_WideStringC& wsFontFamily, uint32_t dwFontStyles, |