From cfb1944e245e20fe2ce0e94feebc06526db34fa1 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 20 Apr 2017 13:13:04 -0400 Subject: Cleanup the fx_extension code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL cleans up the fx_extension file. The stream code was moved to fx_stream. IFX_FileAccess was removed and CFX_CRTFileAccess split to its own file. Code shuffled from header to cpp file. Change-Id: I700fdfcc9797cf4e8050cd9ba010ad8854feefbf Reviewed-on: https://pdfium-review.googlesource.com/4371 Reviewed-by: Nicolás Peña Commit-Queue: dsinclair --- xfa/fgas/font/cfgas_fontmgr.cpp | 8 ++++---- xfa/fgas/font/cfgas_fontmgr.h | 5 +++-- xfa/fgas/font/fgas_fontutils.cpp | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'xfa/fgas/font') diff --git a/xfa/fgas/font/cfgas_fontmgr.cpp b/xfa/fgas/font/cfgas_fontmgr.cpp index e0b71118d9..74c284012f 100644 --- a/xfa/fgas/font/cfgas_fontmgr.cpp +++ b/xfa/fgas/font/cfgas_fontmgr.cpp @@ -678,12 +678,11 @@ bool CFX_FontSourceEnum_File::HasStartPosition() { return m_wsNext.GetLength() != 0; } -CFX_RetainPtr CFX_FontSourceEnum_File::GetNext() { +CFX_RetainPtr CFX_FontSourceEnum_File::GetNext() { if (m_wsNext.GetLength() == 0) return nullptr; - CFX_RetainPtr pAccess = - IFX_FileAccess::CreateDefault(m_wsNext.AsStringC()); + auto pAccess = pdfium::MakeRetain(m_wsNext.AsStringC()); m_wsNext = GetNextFile().UTF8Decode(); return pAccess; } @@ -733,7 +732,8 @@ bool CFGAS_FontMgr::EnumFontsFromFiles() { if (!m_pFontSource->HasStartPosition()) return !m_InstalledFonts.empty(); - while (CFX_RetainPtr pFontSource = m_pFontSource->GetNext()) { + while (CFX_RetainPtr pFontSource = + m_pFontSource->GetNext()) { CFX_RetainPtr pFontStream = pFontSource->CreateFileStream(FX_FILEMODE_ReadOnly); if (pFontStream) diff --git a/xfa/fgas/font/cfgas_fontmgr.h b/xfa/fgas/font/cfgas_fontmgr.h index cca999a869..1ef78a79a6 100644 --- a/xfa/fgas/font/cfgas_fontmgr.h +++ b/xfa/fgas/font/cfgas_fontmgr.h @@ -13,9 +13,10 @@ #include #include +#include "core/fxcrt/cfx_crtfileaccess.h" #include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/cfx_seekablestreamproxy.h" -#include "core/fxcrt/fx_ext.h" +#include "core/fxcrt/fx_extension.h" #include "core/fxge/cfx_fontmapper.h" #include "core/fxge/fx_freetype.h" #include "core/fxge/ifx_systemfontinfo.h" @@ -169,7 +170,7 @@ class CFX_FontSourceEnum_File { ~CFX_FontSourceEnum_File(); bool HasStartPosition(); - CFX_RetainPtr GetNext(); + CFX_RetainPtr GetNext(); private: CFX_ByteString GetNextFile(); diff --git a/xfa/fgas/font/fgas_fontutils.cpp b/xfa/fgas/font/fgas_fontutils.cpp index 82930094ec..44f9423297 100644 --- a/xfa/fgas/font/fgas_fontutils.cpp +++ b/xfa/fgas/font/fgas_fontutils.cpp @@ -7,7 +7,7 @@ #include "xfa/fgas/font/fgas_fontutils.h" #include "core/fxcrt/fx_codepage.h" -#include "core/fxcrt/fx_ext.h" +#include "core/fxcrt/fx_extension.h" #include "xfa/fgas/font/cfgas_fontmgr.h" namespace { -- cgit v1.2.3