diff options
Diffstat (limited to 'xfa')
65 files changed, 355 insertions, 371 deletions
diff --git a/xfa/fde/cfde_texteditengine.cpp b/xfa/fde/cfde_texteditengine.cpp index 143bac49f9..d54126f3c3 100644 --- a/xfa/fde/cfde_texteditengine.cpp +++ b/xfa/fde/cfde_texteditengine.cpp @@ -623,7 +623,7 @@ void CFDE_TextEditEngine::SetCharacterLimit(size_t limit) { is_dirty_ = true; } -void CFDE_TextEditEngine::SetFont(CFX_RetainPtr<CFGAS_GEFont> font) { +void CFDE_TextEditEngine::SetFont(RetainPtr<CFGAS_GEFont> font) { if (font_ == font) return; diff --git a/xfa/fde/cfde_texteditengine.h b/xfa/fde/cfde_texteditengine.h index dbb12f3953..7b739be711 100644 --- a/xfa/fde/cfde_texteditengine.h +++ b/xfa/fde/cfde_texteditengine.h @@ -11,8 +11,8 @@ #include <utility> #include <vector> -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_string.h" +#include "core/fxcrt/retain_ptr.h" #include "core/fxge/cfx_renderdevice.h" #include "core/fxge/fx_dib.h" #include "xfa/fgas/font/cfgas_gefont.h" @@ -96,8 +96,8 @@ class CFDE_TextEditEngine { CFX_RectF GetContentsBoundingBox(); void SetAvailableWidth(size_t width); - void SetFont(CFX_RetainPtr<CFGAS_GEFont> font); - CFX_RetainPtr<CFGAS_GEFont> GetFont() const { return font_; } + void SetFont(RetainPtr<CFGAS_GEFont> font); + RetainPtr<CFGAS_GEFont> GetFont() const { return font_; } void SetFontSize(float size); float GetFontSize() const { return font_size_; } void SetFontColor(FX_ARGB color) { font_color_ = color; } @@ -204,7 +204,7 @@ class CFDE_TextEditEngine { std::vector<FDE_TEXTEDITPIECE> text_piece_info_; std::vector<size_t> char_widths_; CFX_TxtBreak text_break_; - CFX_RetainPtr<CFGAS_GEFont> font_; + RetainPtr<CFGAS_GEFont> font_; FX_ARGB font_color_; float font_size_; float line_spacing_; diff --git a/xfa/fde/cfde_texteditengine_unittest.cpp b/xfa/fde/cfde_texteditengine_unittest.cpp index b0a27f331c..e6cff04507 100644 --- a/xfa/fde/cfde_texteditengine_unittest.cpp +++ b/xfa/fde/cfde_texteditengine_unittest.cpp @@ -49,7 +49,7 @@ class CFDE_TextEditEngineTest : public testing::Test { CFDE_TextEditEngine* engine() const { return engine_.get(); } private: - CFX_RetainPtr<CFGAS_GEFont> font_; + RetainPtr<CFGAS_GEFont> font_; std::unique_ptr<CFDE_TextEditEngine> engine_; }; diff --git a/xfa/fde/cfde_textout.cpp b/xfa/fde/cfde_textout.cpp index 3cf4ed36e0..0e9005d88e 100644 --- a/xfa/fde/cfde_textout.cpp +++ b/xfa/fde/cfde_textout.cpp @@ -33,7 +33,7 @@ bool IsTextAlignmentTop(const FDE_TextAlignment align) { // static bool CFDE_TextOut::DrawString(CFX_RenderDevice* device, FX_ARGB color, - const CFX_RetainPtr<CFGAS_GEFont>& pFont, + const RetainPtr<CFGAS_GEFont>& pFont, FXTEXT_CHARPOS* pCharPos, int32_t iCount, float fFontSize, @@ -63,11 +63,11 @@ bool CFDE_TextOut::DrawString(CFX_RenderDevice* device, FxFont.SetSubstFont(std::move(SubstFxFont)); #endif // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ - CFX_RetainPtr<CFGAS_GEFont> pCurFont; + RetainPtr<CFGAS_GEFont> pCurFont; FXTEXT_CHARPOS* pCurCP = nullptr; int32_t iCurCount = 0; for (int32_t i = 0; i < iCount; ++i) { - CFX_RetainPtr<CFGAS_GEFont> pSTFont = + RetainPtr<CFGAS_GEFont> pSTFont = pFont->GetSubstFont(static_cast<int32_t>(pCharPos->m_GlyphIndex)); pCharPos->m_GlyphIndex &= 0x00FFFFFF; pCharPos->m_bFontStyle = false; @@ -140,7 +140,7 @@ CFDE_TextOut::CFDE_TextOut() CFDE_TextOut::~CFDE_TextOut() {} -void CFDE_TextOut::SetFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont) { +void CFDE_TextOut::SetFont(const RetainPtr<CFGAS_GEFont>& pFont) { ASSERT(pFont); m_pFont = pFont; m_pTxtBreak->SetFont(pFont); diff --git a/xfa/fde/cfde_textout.h b/xfa/fde/cfde_textout.h index b936eb4415..f69c0a8717 100644 --- a/xfa/fde/cfde_textout.h +++ b/xfa/fde/cfde_textout.h @@ -77,7 +77,7 @@ class CFDE_TextOut { public: static bool DrawString(CFX_RenderDevice* device, FX_ARGB color, - const CFX_RetainPtr<CFGAS_GEFont>& pFont, + const RetainPtr<CFGAS_GEFont>& pFont, FXTEXT_CHARPOS* pCharPos, int32_t iCount, float fFontSize, @@ -86,7 +86,7 @@ class CFDE_TextOut { CFDE_TextOut(); ~CFDE_TextOut(); - void SetFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont); + void SetFont(const RetainPtr<CFGAS_GEFont>& pFont); void SetFontSize(float fFontSize); void SetTextColor(FX_ARGB color) { m_TxtColor = color; } void SetStyles(const FDE_TextStyle& dwStyles); @@ -121,7 +121,7 @@ class CFDE_TextOut { int32_t GetDisplayPos(FDE_TTOPIECE* pPiece); std::unique_ptr<CFX_TxtBreak> m_pTxtBreak; - CFX_RetainPtr<CFGAS_GEFont> m_pFont; + RetainPtr<CFGAS_GEFont> m_pFont; float m_fFontSize; float m_fLineSpace; float m_fLinePos; diff --git a/xfa/fgas/font/cfgas_defaultfontmanager.cpp b/xfa/fgas/font/cfgas_defaultfontmanager.cpp index 480525802b..d3864be16a 100644 --- a/xfa/fgas/font/cfgas_defaultfontmanager.cpp +++ b/xfa/fgas/font/cfgas_defaultfontmanager.cpp @@ -12,13 +12,13 @@ CFGAS_DefaultFontManager::CFGAS_DefaultFontManager() {} CFGAS_DefaultFontManager::~CFGAS_DefaultFontManager() {} -CFX_RetainPtr<CFGAS_GEFont> CFGAS_DefaultFontManager::GetFont( +RetainPtr<CFGAS_GEFont> CFGAS_DefaultFontManager::GetFont( CFGAS_FontMgr* pFontMgr, const WideStringView& wsFontFamily, uint32_t dwFontStyles, uint16_t wCodePage) { WideString wsFontName(wsFontFamily); - CFX_RetainPtr<CFGAS_GEFont> pFont = + RetainPtr<CFGAS_GEFont> pFont = pFontMgr->LoadFont(wsFontName.c_str(), dwFontStyles, wCodePage); if (!pFont) { const FGAS_FontInfo* pCurFont = @@ -54,12 +54,12 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_DefaultFontManager::GetFont( return pFont; } -CFX_RetainPtr<CFGAS_GEFont> CFGAS_DefaultFontManager::GetDefaultFont( +RetainPtr<CFGAS_GEFont> CFGAS_DefaultFontManager::GetDefaultFont( CFGAS_FontMgr* pFontMgr, const WideStringView& wsFontFamily, uint32_t dwFontStyles, uint16_t wCodePage) { - CFX_RetainPtr<CFGAS_GEFont> pFont = + RetainPtr<CFGAS_GEFont> pFont = pFontMgr->LoadFont(L"Arial Narrow", dwFontStyles, wCodePage); if (!pFont) { pFont = pFontMgr->LoadFont(static_cast<const wchar_t*>(nullptr), diff --git a/xfa/fgas/font/cfgas_defaultfontmanager.h b/xfa/fgas/font/cfgas_defaultfontmanager.h index b596efc719..4e2e5e10d4 100644 --- a/xfa/fgas/font/cfgas_defaultfontmanager.h +++ b/xfa/fgas/font/cfgas_defaultfontmanager.h @@ -9,8 +9,8 @@ #include <vector> -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_string.h" +#include "core/fxcrt/retain_ptr.h" #include "xfa/fgas/font/cfgas_gefont.h" class CFGAS_DefaultFontManager { @@ -18,17 +18,17 @@ class CFGAS_DefaultFontManager { CFGAS_DefaultFontManager(); ~CFGAS_DefaultFontManager(); - CFX_RetainPtr<CFGAS_GEFont> GetFont(CFGAS_FontMgr* pFontMgr, - const WideStringView& wsFontFamily, - uint32_t dwFontStyles, - uint16_t wCodePage = 0xFFFF); - CFX_RetainPtr<CFGAS_GEFont> GetDefaultFont(CFGAS_FontMgr* pFontMgr, - const WideStringView& wsFontFamily, - uint32_t dwFontStyles, - uint16_t wCodePage = 0xFFFF); + RetainPtr<CFGAS_GEFont> GetFont(CFGAS_FontMgr* pFontMgr, + const WideStringView& wsFontFamily, + uint32_t dwFontStyles, + uint16_t wCodePage = 0xFFFF); + RetainPtr<CFGAS_GEFont> GetDefaultFont(CFGAS_FontMgr* pFontMgr, + const WideStringView& wsFontFamily, + uint32_t dwFontStyles, + uint16_t wCodePage = 0xFFFF); private: - std::vector<CFX_RetainPtr<CFGAS_GEFont>> m_CacheFonts; + std::vector<RetainPtr<CFGAS_GEFont>> m_CacheFonts; }; #endif // XFA_FGAS_FONT_CFGAS_DEFAULTFONTMANAGER_H_ diff --git a/xfa/fgas/font/cfgas_fontmgr.cpp b/xfa/fgas/font/cfgas_fontmgr.cpp index f2405e9844..da1763214b 100644 --- a/xfa/fgas/font/cfgas_fontmgr.cpp +++ b/xfa/fgas/font/cfgas_fontmgr.cpp @@ -197,7 +197,7 @@ CFGAS_FontMgr::CFGAS_FontMgr(FX_LPEnumAllFonts pEnumerator) CFGAS_FontMgr::~CFGAS_FontMgr() {} -CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByCodePage( +RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByCodePage( uint16_t wCodePage, uint32_t dwFontStyles, const wchar_t* pszFontFamily) { @@ -215,7 +215,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByCodePage( if (!pFD) return nullptr; - CFX_RetainPtr<CFGAS_GEFont> pFont = + RetainPtr<CFGAS_GEFont> pFont = CFGAS_GEFont::LoadFont(pFD->wsFontFace, dwFontStyles, wCodePage, this); if (!pFont) return nullptr; @@ -227,7 +227,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByCodePage( return LoadFont(pFont, dwFontStyles, wCodePage); } -CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByUnicode( +RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByUnicode( wchar_t wUnicode, uint32_t dwFontStyles, const wchar_t* pszFontFamily) { @@ -254,7 +254,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByUnicode( uint16_t wCodePage = GetCodePageFromCharset(pFD->uCharSet); const wchar_t* pFontFace = pFD->wsFontFace; - CFX_RetainPtr<CFGAS_GEFont> pFont = + RetainPtr<CFGAS_GEFont> pFont = CFGAS_GEFont::LoadFont(pFontFace, dwFontStyles, wCodePage, this); if (!pFont) return nullptr; @@ -266,11 +266,10 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByUnicode( return LoadFont(pFont, dwFontStyles, wCodePage); } -CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::LoadFont( - const wchar_t* pszFontFamily, - uint32_t dwFontStyles, - uint16_t wCodePage) { - CFX_RetainPtr<CFGAS_GEFont> pFont; +RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::LoadFont(const wchar_t* pszFontFamily, + uint32_t dwFontStyles, + uint16_t wCodePage) { + RetainPtr<CFGAS_GEFont> pFont; uint32_t dwHash = GetFontFamilyHash(pszFontFamily, dwFontStyles, wCodePage); auto it = m_FamilyFonts.find(dwHash); if (it != m_FamilyFonts.end()) @@ -298,8 +297,8 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::LoadFont( return LoadFont(pFont, dwFontStyles, wCodePage); } -CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::LoadFont( - const CFX_RetainPtr<CFGAS_GEFont>& pSrcFont, +RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::LoadFont( + const RetainPtr<CFGAS_GEFont>& pSrcFont, uint32_t dwFontStyles, uint16_t wCodePage) { if (pSrcFont->GetFontStyles() == dwFontStyles) @@ -313,7 +312,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::LoadFont( if (it != m_DeriveFonts.end() && it->second) return it->second; - CFX_RetainPtr<CFGAS_GEFont> pFont = pSrcFont->Derive(dwFontStyles, wCodePage); + RetainPtr<CFGAS_GEFont> pFont = pSrcFont->Derive(dwFontStyles, wCodePage); if (!pFont) return nullptr; @@ -325,8 +324,8 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::LoadFont( } void CFGAS_FontMgr::RemoveFont( - std::map<uint32_t, CFX_RetainPtr<CFGAS_GEFont>>* pFontMap, - const CFX_RetainPtr<CFGAS_GEFont>& pFont) { + std::map<uint32_t, RetainPtr<CFGAS_GEFont>>* pFontMap, + const RetainPtr<CFGAS_GEFont>& pFont) { auto iter = pFontMap->begin(); while (iter != pFontMap->end()) { auto old_iter = iter++; @@ -335,7 +334,7 @@ void CFGAS_FontMgr::RemoveFont( } } -void CFGAS_FontMgr::RemoveFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont) { +void CFGAS_FontMgr::RemoveFont(const RetainPtr<CFGAS_GEFont>& pFont) { RemoveFont(&m_CPFonts, pFont); RemoveFont(&m_FamilyFonts, pFont); RemoveFont(&m_UnicodeFonts, pFont); @@ -680,7 +679,7 @@ bool CFX_FontSourceEnum_File::HasStartPosition() { return m_wsNext.GetLength() != 0; } -CFX_RetainPtr<CFX_CRTFileAccess> CFX_FontSourceEnum_File::GetNext() { +RetainPtr<CFX_CRTFileAccess> CFX_FontSourceEnum_File::GetNext() { if (m_wsNext.GetLength() == 0) return nullptr; @@ -717,7 +716,7 @@ bool CFGAS_FontMgr::EnumFontsFromFontMapper() { pSystemFontInfo->EnumFontList(pFontMapper); for (int32_t i = 0; i < pFontMapper->GetFaceSize(); ++i) { - CFX_RetainPtr<IFX_SeekableReadStream> pFontStream = + RetainPtr<IFX_SeekableReadStream> pFontStream = CreateFontStream(pFontMapper, pSystemFontInfo, i); if (!pFontStream) continue; @@ -734,9 +733,8 @@ bool CFGAS_FontMgr::EnumFontsFromFiles() { if (!m_pFontSource->HasStartPosition()) return !m_InstalledFonts.empty(); - while (CFX_RetainPtr<CFX_CRTFileAccess> pFontSource = - m_pFontSource->GetNext()) { - CFX_RetainPtr<IFX_SeekableReadStream> pFontStream = + while (RetainPtr<CFX_CRTFileAccess> pFontSource = m_pFontSource->GetNext()) { + RetainPtr<IFX_SeekableReadStream> pFontStream = pFontSource->CreateFileStream(FX_FILEMODE_ReadOnly); if (pFontStream) RegisterFaces(pFontStream, nullptr); @@ -748,14 +746,13 @@ bool CFGAS_FontMgr::EnumFonts() { return EnumFontsFromFontMapper() || EnumFontsFromFiles(); } -CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::LoadFont( - const wchar_t* pszFontFamily, - uint32_t dwFontStyles, - uint16_t wCodePage) { +RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::LoadFont(const wchar_t* pszFontFamily, + uint32_t dwFontStyles, + uint16_t wCodePage) { return GetFontByCodePage(wCodePage, dwFontStyles, pszFontFamily); } -CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByCodePage( +RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByCodePage( uint16_t wCodePage, uint32_t dwFontStyles, const wchar_t* pszFontFamily) { @@ -763,7 +760,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByCodePage( bsHash.Format("%d, %d", wCodePage, dwFontStyles); bsHash += FX_UTF8Encode(WideStringView(pszFontFamily)); uint32_t dwHash = FX_HashCode_GetA(bsHash.AsStringView(), false); - std::vector<CFX_RetainPtr<CFGAS_GEFont>>* pFontArray = &m_Hash2Fonts[dwHash]; + std::vector<RetainPtr<CFGAS_GEFont>>* pFontArray = &m_Hash2Fonts[dwHash]; if (!pFontArray->empty()) return (*pFontArray)[0]; @@ -780,7 +777,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByCodePage( return nullptr; CFX_FontDescriptor* pDesc = (*sortedFontInfos)[0].pFont; - CFX_RetainPtr<CFGAS_GEFont> pFont = + RetainPtr<CFGAS_GEFont> pFont = LoadFont(pDesc->m_wsFaceName, pDesc->m_nFaceIndex, nullptr); if (!pFont) return nullptr; @@ -790,7 +787,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByCodePage( return pFont; } -CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByUnicode( +RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByUnicode( wchar_t wUnicode, uint32_t dwFontStyles, const wchar_t* pszFontFamily) { @@ -807,7 +804,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByUnicode( bsHash.Format("%d, %d", wCodePage, dwFontStyles); bsHash += FX_UTF8Encode(WideStringView(pszFontFamily)); uint32_t dwHash = FX_HashCode_GetA(bsHash.AsStringView(), false); - std::vector<CFX_RetainPtr<CFGAS_GEFont>>* pFonts = &m_Hash2Fonts[dwHash]; + std::vector<RetainPtr<CFGAS_GEFont>>* pFonts = &m_Hash2Fonts[dwHash]; for (size_t i = 0; i < pFonts->size(); ++i) { if (VerifyUnicode((*pFonts)[i], wUnicode)) return (*pFonts)[i]; @@ -825,7 +822,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByUnicode( CFX_FontDescriptor* pDesc = info.pFont; if (!VerifyUnicode(pDesc, wUnicode)) continue; - CFX_RetainPtr<CFGAS_GEFont> pFont = + RetainPtr<CFGAS_GEFont> pFont = LoadFont(pDesc->m_wsFaceName, pDesc->m_nFaceIndex, nullptr); if (!pFont) continue; @@ -840,7 +837,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByUnicode( bool CFGAS_FontMgr::VerifyUnicode(CFX_FontDescriptor* pDesc, wchar_t wcUnicode) { - CFX_RetainPtr<IFX_SeekableReadStream> pFileRead = + RetainPtr<IFX_SeekableReadStream> pFileRead = CreateFontStream(pDesc->m_wsFaceName.UTF8Encode()); if (!pFileRead) return false; @@ -858,7 +855,7 @@ bool CFGAS_FontMgr::VerifyUnicode(CFX_FontDescriptor* pDesc, return !retCharmap && retIndex; } -bool CFGAS_FontMgr::VerifyUnicode(const CFX_RetainPtr<CFGAS_GEFont>& pFont, +bool CFGAS_FontMgr::VerifyUnicode(const RetainPtr<CFGAS_GEFont>& pFont, wchar_t wcUnicode) { if (!pFont) return false; @@ -875,10 +872,9 @@ bool CFGAS_FontMgr::VerifyUnicode(const CFX_RetainPtr<CFGAS_GEFont>& pFont, return true; } -CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::LoadFont( - const WideString& wsFaceName, - int32_t iFaceIndex, - int32_t* pFaceCount) { +RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::LoadFont(const WideString& wsFaceName, + int32_t iFaceIndex, + int32_t* pFaceCount) { CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr(); CFX_FontMapper* pFontMapper = pFontMgr->GetBuiltinMapper(); if (!pFontMapper) @@ -888,7 +884,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::LoadFont( if (!pSystemFontInfo) return nullptr; - CFX_RetainPtr<IFX_SeekableReadStream> pFontStream = + RetainPtr<IFX_SeekableReadStream> pFontStream = CreateFontStream(wsFaceName.UTF8Encode()); if (!pFontStream) return nullptr; @@ -897,7 +893,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::LoadFont( if (!pInternalFont->LoadFile(pFontStream, iFaceIndex)) return nullptr; - CFX_RetainPtr<CFGAS_GEFont> pFont = + RetainPtr<CFGAS_GEFont> pFont = CFGAS_GEFont::LoadFont(std::move(pInternalFont), this); if (!pFont) return nullptr; @@ -930,7 +926,7 @@ void _ftStreamClose(FXFT_Stream stream) {} }; // extern "C" FXFT_Face CFGAS_FontMgr::LoadFace( - const CFX_RetainPtr<IFX_SeekableReadStream>& pFontStream, + const RetainPtr<IFX_SeekableReadStream>& pFontStream, int32_t iFaceIndex) { if (!pFontStream) return nullptr; @@ -971,7 +967,7 @@ FXFT_Face CFGAS_FontMgr::LoadFace( return pFace; } -CFX_RetainPtr<IFX_SeekableReadStream> CFGAS_FontMgr::CreateFontStream( +RetainPtr<IFX_SeekableReadStream> CFGAS_FontMgr::CreateFontStream( CFX_FontMapper* pFontMapper, IFX_SystemFontInfo* pSystemFontInfo, uint32_t index) { @@ -992,7 +988,7 @@ CFX_RetainPtr<IFX_SeekableReadStream> CFGAS_FontMgr::CreateFontStream( return pdfium::MakeRetain<CFX_MemoryStream>(pBuffer, dwFileSize, true); } -CFX_RetainPtr<IFX_SeekableReadStream> CFGAS_FontMgr::CreateFontStream( +RetainPtr<IFX_SeekableReadStream> CFGAS_FontMgr::CreateFontStream( const ByteString& bsFaceName) { CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr(); CFX_FontMapper* pFontMapper = pFontMgr->GetBuiltinMapper(); @@ -1101,7 +1097,7 @@ int32_t CFGAS_FontMgr::CalcPenalty(CFX_FontDescriptor* pInstalled, return nPenalty; } -void CFGAS_FontMgr::RemoveFont(const CFX_RetainPtr<CFGAS_GEFont>& pEFont) { +void CFGAS_FontMgr::RemoveFont(const RetainPtr<CFGAS_GEFont>& pEFont) { if (!pEFont) return; @@ -1155,7 +1151,7 @@ void CFGAS_FontMgr::RegisterFace(FXFT_Face pFace, const WideString* pFaceName) { } void CFGAS_FontMgr::RegisterFaces( - const CFX_RetainPtr<IFX_SeekableReadStream>& pFontStream, + const RetainPtr<IFX_SeekableReadStream>& pFontStream, const WideString* pFaceName) { int32_t index = 0; int32_t num_faces = 0; diff --git a/xfa/fgas/font/cfgas_fontmgr.h b/xfa/fgas/font/cfgas_fontmgr.h index 642ba6fb67..0bcee12e4d 100644 --- a/xfa/fgas/font/cfgas_fontmgr.h +++ b/xfa/fgas/font/cfgas_fontmgr.h @@ -14,10 +14,10 @@ #include <vector> #include "core/fxcrt/cfx_crtfileaccess.h" -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/cfx_seekablestreamproxy.h" #include "core/fxcrt/fx_extension.h" #include "core/fxcrt/observable.h" +#include "core/fxcrt/retain_ptr.h" #include "core/fxge/cfx_fontmapper.h" #include "core/fxge/fx_freetype.h" #include "core/fxge/ifx_systemfontinfo.h" @@ -88,24 +88,23 @@ class CFGAS_FontMgr : public Observable<CFGAS_FontMgr> { explicit CFGAS_FontMgr(FX_LPEnumAllFonts pEnumerator); ~CFGAS_FontMgr(); - CFX_RetainPtr<CFGAS_GEFont> GetFontByCodePage(uint16_t wCodePage, - uint32_t dwFontStyles, - const wchar_t* pszFontFamily); - CFX_RetainPtr<CFGAS_GEFont> GetFontByUnicode(wchar_t wUnicode, - uint32_t dwFontStyles, - const wchar_t* pszFontFamily); - CFX_RetainPtr<CFGAS_GEFont> LoadFont(const wchar_t* pszFontFamily, - uint32_t dwFontStyles, - uint16_t wCodePage); - void RemoveFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont); + RetainPtr<CFGAS_GEFont> GetFontByCodePage(uint16_t wCodePage, + uint32_t dwFontStyles, + const wchar_t* pszFontFamily); + RetainPtr<CFGAS_GEFont> GetFontByUnicode(wchar_t wUnicode, + uint32_t dwFontStyles, + const wchar_t* pszFontFamily); + RetainPtr<CFGAS_GEFont> LoadFont(const wchar_t* pszFontFamily, + uint32_t dwFontStyles, + uint16_t wCodePage); + void RemoveFont(const RetainPtr<CFGAS_GEFont>& pFont); private: - CFX_RetainPtr<CFGAS_GEFont> LoadFont( - const CFX_RetainPtr<CFGAS_GEFont>& pSrcFont, - uint32_t dwFontStyles, - uint16_t wCodePage); - void RemoveFont(std::map<uint32_t, CFX_RetainPtr<CFGAS_GEFont>>* pFontMap, - const CFX_RetainPtr<CFGAS_GEFont>& pFont); + RetainPtr<CFGAS_GEFont> LoadFont(const RetainPtr<CFGAS_GEFont>& pSrcFont, + uint32_t dwFontStyles, + uint16_t wCodePage); + void RemoveFont(std::map<uint32_t, RetainPtr<CFGAS_GEFont>>* pFontMap, + const RetainPtr<CFGAS_GEFont>& pFont); const FX_FONTDESCRIPTOR* FindFont(const wchar_t* pszFontFamily, uint32_t dwFontStyles, uint32_t dwMatchFlags, @@ -115,13 +114,13 @@ class CFGAS_FontMgr : public Observable<CFGAS_FontMgr> { FX_LPEnumAllFonts m_pEnumerator; std::deque<FX_FONTDESCRIPTOR> m_FontFaces; - std::vector<CFX_RetainPtr<CFGAS_GEFont>> m_Fonts; - std::map<uint32_t, CFX_RetainPtr<CFGAS_GEFont>> m_CPFonts; - std::map<uint32_t, CFX_RetainPtr<CFGAS_GEFont>> m_FamilyFonts; - std::map<uint32_t, CFX_RetainPtr<CFGAS_GEFont>> m_UnicodeFonts; - std::map<uint32_t, CFX_RetainPtr<CFGAS_GEFont>> m_BufferFonts; - std::map<uint32_t, CFX_RetainPtr<CFGAS_GEFont>> m_StreamFonts; - std::map<uint32_t, CFX_RetainPtr<CFGAS_GEFont>> m_DeriveFonts; + std::vector<RetainPtr<CFGAS_GEFont>> m_Fonts; + std::map<uint32_t, RetainPtr<CFGAS_GEFont>> m_CPFonts; + std::map<uint32_t, RetainPtr<CFGAS_GEFont>> m_FamilyFonts; + std::map<uint32_t, RetainPtr<CFGAS_GEFont>> m_UnicodeFonts; + std::map<uint32_t, RetainPtr<CFGAS_GEFont>> m_BufferFonts; + std::map<uint32_t, RetainPtr<CFGAS_GEFont>> m_StreamFonts; + std::map<uint32_t, RetainPtr<CFGAS_GEFont>> m_DeriveFonts; }; #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ @@ -170,7 +169,7 @@ class CFX_FontSourceEnum_File { ~CFX_FontSourceEnum_File(); bool HasStartPosition(); - CFX_RetainPtr<CFX_CRTFileAccess> GetNext(); + RetainPtr<CFX_CRTFileAccess> GetNext(); private: ByteString GetNextFile(); @@ -188,31 +187,30 @@ class CFGAS_FontMgr : public Observable<CFGAS_FontMgr> { explicit CFGAS_FontMgr(CFX_FontSourceEnum_File* pFontEnum); ~CFGAS_FontMgr(); - CFX_RetainPtr<CFGAS_GEFont> GetFontByCodePage(uint16_t wCodePage, - uint32_t dwFontStyles, - const wchar_t* pszFontFamily); - CFX_RetainPtr<CFGAS_GEFont> GetFontByUnicode(wchar_t wUnicode, - uint32_t dwFontStyles, - const wchar_t* pszFontFamily); - CFX_RetainPtr<CFGAS_GEFont> LoadFont(const wchar_t* pszFontFamily, - uint32_t dwFontStyles, - uint16_t wCodePage); - void RemoveFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont); + RetainPtr<CFGAS_GEFont> GetFontByCodePage(uint16_t wCodePage, + uint32_t dwFontStyles, + const wchar_t* pszFontFamily); + RetainPtr<CFGAS_GEFont> GetFontByUnicode(wchar_t wUnicode, + uint32_t dwFontStyles, + const wchar_t* pszFontFamily); + RetainPtr<CFGAS_GEFont> LoadFont(const wchar_t* pszFontFamily, + uint32_t dwFontStyles, + uint16_t wCodePage); + void RemoveFont(const RetainPtr<CFGAS_GEFont>& pFont); private: bool EnumFonts(); bool EnumFontsFromFontMapper(); bool EnumFontsFromFiles(); void RegisterFace(FXFT_Face pFace, const WideString* pFaceName); - void RegisterFaces(const CFX_RetainPtr<IFX_SeekableReadStream>& pFontStream, + void RegisterFaces(const RetainPtr<IFX_SeekableReadStream>& pFontStream, const WideString* pFaceName); void GetNames(const uint8_t* name_table, std::vector<WideString>& Names); std::vector<uint16_t> GetCharsets(FXFT_Face pFace) const; void GetUSBCSB(FXFT_Face pFace, uint32_t* USB, uint32_t* CSB); uint32_t GetFlags(FXFT_Face pFace); bool VerifyUnicode(CFX_FontDescriptor* pDesc, wchar_t wcUnicode); - bool VerifyUnicode(const CFX_RetainPtr<CFGAS_GEFont>& pFont, - wchar_t wcUnicode); + bool VerifyUnicode(const RetainPtr<CFGAS_GEFont>& pFont, wchar_t wcUnicode); int32_t IsPartName(const WideString& Name1, const WideString& Name2); void MatchFonts(std::vector<CFX_FontDescriptorInfo>* MatchedFonts, uint16_t wCodePage, @@ -224,24 +222,24 @@ class CFGAS_FontMgr : public Observable<CFGAS_FontMgr> { uint32_t dwFontStyles, const WideString& FontName, wchar_t wcUnicode = 0xFFFE); - CFX_RetainPtr<CFGAS_GEFont> LoadFont(const WideString& wsFaceName, - int32_t iFaceIndex, - int32_t* pFaceCount); - FXFT_Face LoadFace(const CFX_RetainPtr<IFX_SeekableReadStream>& pFontStream, + RetainPtr<CFGAS_GEFont> LoadFont(const WideString& wsFaceName, + int32_t iFaceIndex, + int32_t* pFaceCount); + FXFT_Face LoadFace(const RetainPtr<IFX_SeekableReadStream>& pFontStream, int32_t iFaceIndex); - CFX_RetainPtr<IFX_SeekableReadStream> CreateFontStream( + RetainPtr<IFX_SeekableReadStream> CreateFontStream( CFX_FontMapper* pFontMapper, IFX_SystemFontInfo* pSystemFontInfo, uint32_t index); - CFX_RetainPtr<IFX_SeekableReadStream> CreateFontStream( + RetainPtr<IFX_SeekableReadStream> CreateFontStream( const ByteString& bsFaceName); CFX_FontSourceEnum_File* const m_pFontSource; std::vector<std::unique_ptr<CFX_FontDescriptor>> m_InstalledFonts; std::map<uint32_t, std::unique_ptr<std::vector<CFX_FontDescriptorInfo>>> m_Hash2CandidateList; - std::map<uint32_t, std::vector<CFX_RetainPtr<CFGAS_GEFont>>> m_Hash2Fonts; - std::map<CFX_RetainPtr<CFGAS_GEFont>, CFX_RetainPtr<IFX_SeekableReadStream>> + std::map<uint32_t, std::vector<RetainPtr<CFGAS_GEFont>>> m_Hash2Fonts; + std::map<RetainPtr<CFGAS_GEFont>, RetainPtr<IFX_SeekableReadStream>> m_IFXFont2FileRead; std::set<wchar_t> m_FailedUnicodesSet; }; diff --git a/xfa/fgas/font/cfgas_gefont.cpp b/xfa/fgas/font/cfgas_gefont.cpp index 404b23cf7b..ba79d77ca0 100644 --- a/xfa/fgas/font/cfgas_gefont.cpp +++ b/xfa/fgas/font/cfgas_gefont.cpp @@ -17,10 +17,10 @@ #include "xfa/fgas/font/fgas_fontutils.h" // static -CFX_RetainPtr<CFGAS_GEFont> CFGAS_GEFont::LoadFont(const wchar_t* pszFontFamily, - uint32_t dwFontStyles, - uint16_t wCodePage, - CFGAS_FontMgr* pFontMgr) { +RetainPtr<CFGAS_GEFont> CFGAS_GEFont::LoadFont(const wchar_t* pszFontFamily, + uint32_t dwFontStyles, + uint16_t wCodePage, + CFGAS_FontMgr* pFontMgr) { #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ if (!pFontMgr) return nullptr; @@ -35,8 +35,8 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_GEFont::LoadFont(const wchar_t* pszFontFamily, } // static -CFX_RetainPtr<CFGAS_GEFont> CFGAS_GEFont::LoadFont(CFX_Font* pExternalFont, - CFGAS_FontMgr* pFontMgr) { +RetainPtr<CFGAS_GEFont> CFGAS_GEFont::LoadFont(CFX_Font* pExternalFont, + CFGAS_FontMgr* pFontMgr) { auto pFont = pdfium::MakeRetain<CFGAS_GEFont>(pFontMgr); if (!pFont->LoadFontInternal(pExternalFont)) return nullptr; @@ -44,7 +44,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_GEFont::LoadFont(CFX_Font* pExternalFont, } // static -CFX_RetainPtr<CFGAS_GEFont> CFGAS_GEFont::LoadFont( +RetainPtr<CFGAS_GEFont> CFGAS_GEFont::LoadFont( std::unique_ptr<CFX_Font> pInternalFont, CFGAS_FontMgr* pFontMgr) { auto pFont = pdfium::MakeRetain<CFGAS_GEFont>(pFontMgr); @@ -64,7 +64,7 @@ CFGAS_GEFont::CFGAS_GEFont(CFGAS_FontMgr* pFontMgr) m_pFontMgr(pFontMgr) { } -CFGAS_GEFont::CFGAS_GEFont(const CFX_RetainPtr<CFGAS_GEFont>& src, +CFGAS_GEFont::CFGAS_GEFont(const RetainPtr<CFGAS_GEFont>& src, uint32_t dwFontStyles) : #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ @@ -164,9 +164,9 @@ bool CFGAS_GEFont::InitFont() { return !!m_pFontEncoding; } -CFX_RetainPtr<CFGAS_GEFont> CFGAS_GEFont::Derive(uint32_t dwFontStyles, - uint16_t wCodePage) { - CFX_RetainPtr<CFGAS_GEFont> pFont(this); +RetainPtr<CFGAS_GEFont> CFGAS_GEFont::Derive(uint32_t dwFontStyles, + uint16_t wCodePage) { + RetainPtr<CFGAS_GEFont> pFont(this); if (GetFontStyles() == dwFontStyles) return pFont; return pdfium::MakeRetain<CFGAS_GEFont>(pFont, dwFontStyles); @@ -223,9 +223,9 @@ bool CFGAS_GEFont::GetCharWidthInternal(wchar_t wUnicode, return true; if (!m_pProvider || - !m_pProvider->GetCharWidth(CFX_RetainPtr<CFGAS_GEFont>(this), wUnicode, + !m_pProvider->GetCharWidth(RetainPtr<CFGAS_GEFont>(this), wUnicode, bCharCode, &iWidth)) { - CFX_RetainPtr<CFGAS_GEFont> pFont; + RetainPtr<CFGAS_GEFont> pFont; int32_t iGlyph = GetGlyphIndex(wUnicode, true, &pFont, bCharCode); if (iGlyph != 0xFFFF && pFont) { if (pFont.Get() == this) { @@ -260,7 +260,7 @@ bool CFGAS_GEFont::GetCharBBoxInternal(wchar_t wUnicode, return true; } - CFX_RetainPtr<CFGAS_GEFont> pFont; + RetainPtr<CFGAS_GEFont> pFont; int32_t iGlyph = GetGlyphIndex(wUnicode, true, &pFont, bCharCode); if (!pFont || iGlyph == 0xFFFF) return false; @@ -296,7 +296,7 @@ int32_t CFGAS_GEFont::GetGlyphIndex(wchar_t wUnicode, bool bCharCode) { int32_t CFGAS_GEFont::GetGlyphIndex(wchar_t wUnicode, bool bRecursive, - CFX_RetainPtr<CFGAS_GEFont>* ppFont, + RetainPtr<CFGAS_GEFont>* ppFont, bool bCharCode) { int32_t iGlyphIndex = m_pFontEncoding->GlyphFromCharCode(wUnicode); if (iGlyphIndex > 0) { @@ -330,7 +330,7 @@ int32_t CFGAS_GEFont::GetGlyphIndex(wchar_t wUnicode, return 0xFFFF; WideString wsFamily = GetFamilyName(); - CFX_RetainPtr<CFGAS_GEFont> pFont = + RetainPtr<CFGAS_GEFont> pFont = m_pFontMgr->GetFontByUnicode(wUnicode, GetFontStyles(), wsFamily.c_str()); #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ if (!pFont) @@ -358,9 +358,9 @@ int32_t CFGAS_GEFont::GetDescent() const { return m_pFont->GetDescent(); } -CFX_RetainPtr<CFGAS_GEFont> CFGAS_GEFont::GetSubstFont(int32_t iGlyphIndex) { +RetainPtr<CFGAS_GEFont> CFGAS_GEFont::GetSubstFont(int32_t iGlyphIndex) { iGlyphIndex = static_cast<uint32_t>(iGlyphIndex) >> 24; if (iGlyphIndex == 0) - return CFX_RetainPtr<CFGAS_GEFont>(this); + return RetainPtr<CFGAS_GEFont>(this); return m_SubstFonts[iGlyphIndex - 1]; } diff --git a/xfa/fgas/font/cfgas_gefont.h b/xfa/fgas/font/cfgas_gefont.h index c83fc4319d..f88f8b4cd9 100644 --- a/xfa/fgas/font/cfgas_gefont.h +++ b/xfa/fgas/font/cfgas_gefont.h @@ -11,9 +11,9 @@ #include <memory> #include <vector> -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_memory.h" +#include "core/fxcrt/retain_ptr.h" #include "xfa/fgas/font/cfgas_fontmgr.h" #include "xfa/fgas/font/cfgas_pdffontmgr.h" @@ -22,25 +22,24 @@ class CFGAS_FontMgr; class CFX_UnicodeEncoding; -class CFGAS_GEFont : public CFX_Retainable { +class CFGAS_GEFont : public Retainable { public: template <typename T> - friend class CFX_RetainPtr; + friend class RetainPtr; template <typename T, typename... Args> - friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args); + friend RetainPtr<T> pdfium::MakeRetain(Args&&... args); - static CFX_RetainPtr<CFGAS_GEFont> LoadFont(const wchar_t* pszFontFamily, - uint32_t dwFontStyles, - uint16_t wCodePage, - CFGAS_FontMgr* pFontMgr); - static CFX_RetainPtr<CFGAS_GEFont> LoadFont(CFX_Font* pExternalFont, - CFGAS_FontMgr* pFontMgr); - static CFX_RetainPtr<CFGAS_GEFont> LoadFont( + static RetainPtr<CFGAS_GEFont> LoadFont(const wchar_t* pszFontFamily, + uint32_t dwFontStyles, + uint16_t wCodePage, + CFGAS_FontMgr* pFontMgr); + static RetainPtr<CFGAS_GEFont> LoadFont(CFX_Font* pExternalFont, + CFGAS_FontMgr* pFontMgr); + static RetainPtr<CFGAS_GEFont> LoadFont( std::unique_ptr<CFX_Font> pInternalFont, CFGAS_FontMgr* pFontMgr); - CFX_RetainPtr<CFGAS_GEFont> Derive(uint32_t dwFontStyles, - uint16_t wCodePage = 0); + RetainPtr<CFGAS_GEFont> Derive(uint32_t dwFontStyles, uint16_t wCodePage = 0); uint32_t GetFontStyles() const; bool GetCharWidth(wchar_t wUnicode, int32_t& iWidth, bool bCharCode); int32_t GetGlyphIndex(wchar_t wUnicode, bool bCharCode = false); @@ -48,7 +47,7 @@ class CFGAS_GEFont : public CFX_Retainable { int32_t GetDescent() const; bool GetCharBBox(wchar_t wUnicode, CFX_Rect* bbox, bool bCharCode = false); bool GetBBox(CFX_Rect* bbox); - CFX_RetainPtr<CFGAS_GEFont> GetSubstFont(int32_t iGlyphIndex); + RetainPtr<CFGAS_GEFont> GetSubstFont(int32_t iGlyphIndex); CFX_Font* GetDevFont() const { return m_pFont; } void SetFontProvider(CFGAS_PDFFontMgr* pProvider) { m_pProvider.Reset(pProvider); @@ -62,7 +61,7 @@ class CFGAS_GEFont : public CFX_Retainable { private: explicit CFGAS_GEFont(CFGAS_FontMgr* pFontMgr); - CFGAS_GEFont(const CFX_RetainPtr<CFGAS_GEFont>& src, uint32_t dwFontStyles); + CFGAS_GEFont(const RetainPtr<CFGAS_GEFont>& src, uint32_t dwFontStyles); ~CFGAS_GEFont() override; #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ @@ -70,9 +69,8 @@ class CFGAS_GEFont : public CFX_Retainable { uint32_t dwFontStyles, uint16_t wCodePage); bool LoadFontInternal(const uint8_t* pBuffer, int32_t length); - bool LoadFontInternal( - const CFX_RetainPtr<CFX_SeekableStreamProxy>& pFontStream, - bool bSaveStream); + bool LoadFontInternal(const RetainPtr<CFX_SeekableStreamProxy>& pFontStream, + bool bSaveStream); #endif bool LoadFontInternal(CFX_Font* pExternalFont); bool LoadFontInternal(std::unique_ptr<CFX_Font> pInternalFont); @@ -87,7 +85,7 @@ class CFGAS_GEFont : public CFX_Retainable { bool bCharCode); int32_t GetGlyphIndex(wchar_t wUnicode, bool bRecursive, - CFX_RetainPtr<CFGAS_GEFont>* ppFont, + RetainPtr<CFGAS_GEFont>* ppFont, bool bCharCode = false); WideString GetFamilyName() const; @@ -97,16 +95,16 @@ class CFGAS_GEFont : public CFX_Retainable { #endif CFX_Font* m_pFont; bool m_bExternalFont; - CFX_RetainPtr<CFGAS_GEFont> m_pSrcFont; // Only set by ctor, so no cycles. + RetainPtr<CFGAS_GEFont> m_pSrcFont; // Only set by ctor, so no cycles. CFGAS_FontMgr::ObservedPtr m_pFontMgr; CFGAS_PDFFontMgr::ObservedPtr m_pProvider; - CFX_RetainPtr<CFX_SeekableStreamProxy> m_pStream; - CFX_RetainPtr<IFX_SeekableReadStream> m_pFileRead; + RetainPtr<CFX_SeekableStreamProxy> m_pStream; + RetainPtr<IFX_SeekableReadStream> m_pFileRead; std::unique_ptr<CFX_UnicodeEncoding> m_pFontEncoding; std::map<wchar_t, int32_t> m_CharWidthMap; std::map<wchar_t, CFX_Rect> m_BBoxMap; - std::vector<CFX_RetainPtr<CFGAS_GEFont>> m_SubstFonts; - std::map<wchar_t, CFX_RetainPtr<CFGAS_GEFont>> m_FontMapper; + std::vector<RetainPtr<CFGAS_GEFont>> m_SubstFonts; + std::map<wchar_t, RetainPtr<CFGAS_GEFont>> m_FontMapper; }; #endif // XFA_FGAS_FONT_CFGAS_GEFONT_H_ diff --git a/xfa/fgas/font/cfgas_pdffontmgr.cpp b/xfa/fgas/font/cfgas_pdffontmgr.cpp index 2b8e30e5ee..0fd18aa9b9 100644 --- a/xfa/fgas/font/cfgas_pdffontmgr.cpp +++ b/xfa/fgas/font/cfgas_pdffontmgr.cpp @@ -32,12 +32,11 @@ CFGAS_PDFFontMgr::CFGAS_PDFFontMgr(CPDF_Document* pDoc, CFGAS_FontMgr* pFontMgr) CFGAS_PDFFontMgr::~CFGAS_PDFFontMgr() {} -CFX_RetainPtr<CFGAS_GEFont> CFGAS_PDFFontMgr::FindFont( - const ByteString& strPsName, - bool bBold, - bool bItalic, - CPDF_Font** pDstPDFFont, - bool bStrictMatch) { +RetainPtr<CFGAS_GEFont> CFGAS_PDFFontMgr::FindFont(const ByteString& strPsName, + bool bBold, + bool bItalic, + CPDF_Font** pDstPDFFont, + bool bStrictMatch) { CPDF_Dictionary* pFontSetDict = m_pDoc->GetRoot()->GetDictFor("AcroForm")->GetDictFor("DR"); if (!pFontSetDict) @@ -73,7 +72,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_PDFFontMgr::FindFont( return nullptr; } -CFX_RetainPtr<CFGAS_GEFont> CFGAS_PDFFontMgr::GetFont( +RetainPtr<CFGAS_GEFont> CFGAS_PDFFontMgr::GetFont( const WideStringView& wsFontFamily, uint32_t dwFontStyles, CPDF_Font** pPDFFont, @@ -89,7 +88,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_PDFFontMgr::GetFont( bool bBold = (dwFontStyles & FX_FONTSTYLE_Bold) == FX_FONTSTYLE_Bold; bool bItalic = (dwFontStyles & FX_FONTSTYLE_Italic) == FX_FONTSTYLE_Italic; ByteString strFontName = PsNameToFontName(bsPsName, bBold, bItalic); - CFX_RetainPtr<CFGAS_GEFont> pFont = + RetainPtr<CFGAS_GEFont> pFont = FindFont(strFontName, bBold, bItalic, pPDFFont, bStrictMatch); if (pFont) m_FontMap[strKey] = pFont; @@ -185,7 +184,7 @@ bool CFGAS_PDFFontMgr::PsNameMatchDRFontName(const ByteStringView& bsPsName, return true; } -bool CFGAS_PDFFontMgr::GetCharWidth(const CFX_RetainPtr<CFGAS_GEFont>& pFont, +bool CFGAS_PDFFontMgr::GetCharWidth(const RetainPtr<CFGAS_GEFont>& pFont, wchar_t wUnicode, bool bCharCode, int32_t* pWidth) { @@ -201,7 +200,7 @@ bool CFGAS_PDFFontMgr::GetCharWidth(const CFX_RetainPtr<CFGAS_GEFont>& pFont, return true; } -void CFGAS_PDFFontMgr::SetFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont, +void CFGAS_PDFFontMgr::SetFont(const RetainPtr<CFGAS_GEFont>& pFont, CPDF_Font* pPDFFont) { m_FDE2PDFFont[pFont] = pPDFFont; } diff --git a/xfa/fgas/font/cfgas_pdffontmgr.h b/xfa/fgas/font/cfgas_pdffontmgr.h index a31d865cec..1f7d49a4e7 100644 --- a/xfa/fgas/font/cfgas_pdffontmgr.h +++ b/xfa/fgas/font/cfgas_pdffontmgr.h @@ -11,9 +11,9 @@ #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_document.h" -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/observable.h" +#include "core/fxcrt/retain_ptr.h" class CFGAS_FontMgr; class CFGAS_GEFont; @@ -25,22 +25,22 @@ class CFGAS_PDFFontMgr : public Observable<CFGAS_PDFFontMgr> { explicit CFGAS_PDFFontMgr(CPDF_Document* pDoc, CFGAS_FontMgr* pFontMgr); ~CFGAS_PDFFontMgr(); - CFX_RetainPtr<CFGAS_GEFont> GetFont(const WideStringView& wsFontFamily, - uint32_t dwFontStyles, - CPDF_Font** pPDFFont, - bool bStrictMatch); - bool GetCharWidth(const CFX_RetainPtr<CFGAS_GEFont>& pFont, + RetainPtr<CFGAS_GEFont> GetFont(const WideStringView& wsFontFamily, + uint32_t dwFontStyles, + CPDF_Font** pPDFFont, + bool bStrictMatch); + bool GetCharWidth(const RetainPtr<CFGAS_GEFont>& pFont, wchar_t wUnicode, bool bCharCode, int32_t* pWidth); - void SetFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont, CPDF_Font* pPDFFont); + void SetFont(const RetainPtr<CFGAS_GEFont>& pFont, CPDF_Font* pPDFFont); private: - CFX_RetainPtr<CFGAS_GEFont> FindFont(const ByteString& strFamilyName, - bool bBold, - bool bItalic, - CPDF_Font** pPDFFont, - bool bStrictMatch); + RetainPtr<CFGAS_GEFont> FindFont(const ByteString& strFamilyName, + bool bBold, + bool bItalic, + CPDF_Font** pPDFFont, + bool bStrictMatch); ByteString PsNameToFontName(const ByteString& strPsName, bool bBold, bool bItalic); @@ -52,8 +52,8 @@ class CFGAS_PDFFontMgr : public Observable<CFGAS_PDFFontMgr> { CFX_UnownedPtr<CPDF_Document> const m_pDoc; CFX_UnownedPtr<CFGAS_FontMgr> const m_pFontMgr; - std::map<CFX_RetainPtr<CFGAS_GEFont>, CPDF_Font*> m_FDE2PDFFont; - std::map<ByteString, CFX_RetainPtr<CFGAS_GEFont>> m_FontMap; + std::map<RetainPtr<CFGAS_GEFont>, CPDF_Font*> m_FDE2PDFFont; + std::map<ByteString, RetainPtr<CFGAS_GEFont>> m_FontMap; }; #endif // XFA_FGAS_FONT_CFGAS_PDFFONTMGR_H_ diff --git a/xfa/fgas/layout/cfx_break.cpp b/xfa/fgas/layout/cfx_break.cpp index 52236f3176..5c5569ad44 100644 --- a/xfa/fgas/layout/cfx_break.cpp +++ b/xfa/fgas/layout/cfx_break.cpp @@ -73,7 +73,7 @@ void CFX_Break::SetVerticalScale(int32_t iScale) { m_iVerticalScale = iScale; } -void CFX_Break::SetFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont) { +void CFX_Break::SetFont(const RetainPtr<CFGAS_GEFont>& pFont) { if (!pFont || pFont == m_pFont) return; diff --git a/xfa/fgas/layout/cfx_break.h b/xfa/fgas/layout/cfx_break.h index b45924e1e7..322fa2be8e 100644 --- a/xfa/fgas/layout/cfx_break.h +++ b/xfa/fgas/layout/cfx_break.h @@ -9,7 +9,7 @@ #include <stdint.h> -#include "core/fxcrt/cfx_retain_ptr.h" +#include "core/fxcrt/retain_ptr.h" #include "xfa/fgas/font/cfgas_gefont.h" #include "xfa/fgas/layout/cfx_breakline.h" @@ -37,7 +37,7 @@ class CFX_Break { void SetLayoutStyles(uint32_t dwLayoutStyles); uint32_t GetLayoutStyles() const { return m_dwLayoutStyles; } - void SetFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont); + void SetFont(const RetainPtr<CFGAS_GEFont>& pFont); void SetFontSize(float fFontSize); void SetTabWidth(float fTabWidth); int32_t GetTabWidth() const { return m_iTabWidth; } @@ -80,7 +80,7 @@ class CFX_Break { int32_t m_iCharSpace; int32_t m_iDefChar; wchar_t m_wDefChar; - CFX_RetainPtr<CFGAS_GEFont> m_pFont; + RetainPtr<CFGAS_GEFont> m_pFont; CFX_BreakLine m_Line[2]; CFX_BreakLine* m_pCurLine; int8_t m_iReadyLineIndex; diff --git a/xfa/fgas/layout/cfx_breakpiece.h b/xfa/fgas/layout/cfx_breakpiece.h index bbf4558eb1..1109e2296b 100644 --- a/xfa/fgas/layout/cfx_breakpiece.h +++ b/xfa/fgas/layout/cfx_breakpiece.h @@ -10,9 +10,9 @@ #include <vector> #include "core/fxcrt/cfx_char.h" -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_string.h" +#include "core/fxcrt/retain_ptr.h" #include "xfa/fxfa/cxfa_textuserdata.h" class CFX_BreakPiece { @@ -41,7 +41,7 @@ class CFX_BreakPiece { uint32_t m_dwIdentity; uint32_t m_dwCharStyles; CFX_UnownedPtr<std::vector<CFX_Char>> m_pChars; - CFX_RetainPtr<CXFA_TextUserData> m_pUserData; + RetainPtr<CXFA_TextUserData> m_pUserData; }; #endif // XFA_FGAS_LAYOUT_CFX_BREAKPIECE_H_ diff --git a/xfa/fgas/layout/cfx_rtfbreak.cpp b/xfa/fgas/layout/cfx_rtfbreak.cpp index be5780fc7a..8768aa34ff 100644 --- a/xfa/fgas/layout/cfx_rtfbreak.cpp +++ b/xfa/fgas/layout/cfx_rtfbreak.cpp @@ -41,8 +41,7 @@ void CFX_RTFBreak::AddPositionedTab(float fTabPos) { m_PositionedTabs.insert(it, iTabPos); } -void CFX_RTFBreak::SetUserData( - const CFX_RetainPtr<CXFA_TextUserData>& pUserData) { +void CFX_RTFBreak::SetUserData(const RetainPtr<CXFA_TextUserData>& pUserData) { if (m_pUserData == pUserData) return; @@ -668,7 +667,7 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText, ASSERT(pText->pFont && pText->pRect); - CFX_RetainPtr<CFGAS_GEFont> pFont = pText->pFont; + RetainPtr<CFGAS_GEFont> pFont = pText->pFont; CFX_RectF rtText(*pText->pRect); bool bRTLPiece = FX_IsOdd(pText->iBidiLevel); float fFontSize = pText->fFontSize; diff --git a/xfa/fgas/layout/cfx_rtfbreak.h b/xfa/fgas/layout/cfx_rtfbreak.h index f5ad90838f..5a3f4313b5 100644 --- a/xfa/fgas/layout/cfx_rtfbreak.h +++ b/xfa/fgas/layout/cfx_rtfbreak.h @@ -10,9 +10,9 @@ #include <deque> #include <vector> -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_unicode.h" +#include "core/fxcrt/retain_ptr.h" #include "core/fxge/cfx_renderdevice.h" #include "xfa/fgas/layout/cfx_break.h" #include "xfa/fxfa/cxfa_textuserdata.h" @@ -33,7 +33,7 @@ struct FX_RTFTEXTOBJ { WideString pStr; std::vector<int32_t> pWidths; - CFX_RetainPtr<CFGAS_GEFont> pFont; + RetainPtr<CFGAS_GEFont> pFont; const CFX_RectF* pRect; wchar_t wLineBreakChar; float fFontSize; @@ -51,7 +51,7 @@ class CFX_RTFBreak : public CFX_Break { void SetLineStartPos(float fLinePos); void SetAlignment(CFX_RTFLineAlignment align) { m_iAlignment = align; } - void SetUserData(const CFX_RetainPtr<CXFA_TextUserData>& pUserData); + void SetUserData(const RetainPtr<CXFA_TextUserData>& pUserData); void AddPositionedTab(float fTabPos); @@ -92,7 +92,7 @@ class CFX_RTFBreak : public CFX_Break { bool m_bPagination; std::vector<int32_t> m_PositionedTabs; CFX_RTFLineAlignment m_iAlignment; - CFX_RetainPtr<CXFA_TextUserData> m_pUserData; + RetainPtr<CXFA_TextUserData> m_pUserData; }; #endif // XFA_FGAS_LAYOUT_CFX_RTFBREAK_H_ diff --git a/xfa/fgas/layout/cfx_rtfbreak_unittest.cpp b/xfa/fgas/layout/cfx_rtfbreak_unittest.cpp index bda52fc76a..5f24631315 100644 --- a/xfa/fgas/layout/cfx_rtfbreak_unittest.cpp +++ b/xfa/fgas/layout/cfx_rtfbreak_unittest.cpp @@ -30,7 +30,7 @@ class CFX_RTFBreakTest : public testing::Test { } private: - CFX_RetainPtr<CFGAS_GEFont> font_; + RetainPtr<CFGAS_GEFont> font_; }; // As soon as you get one of the control characters the break is complete diff --git a/xfa/fgas/layout/cfx_txtbreak.cpp b/xfa/fgas/layout/cfx_txtbreak.cpp index 9fe5a432f6..403b7e6c11 100644 --- a/xfa/fgas/layout/cfx_txtbreak.cpp +++ b/xfa/fgas/layout/cfx_txtbreak.cpp @@ -651,7 +651,7 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun, const wchar_t* pStr = pTxtRun->wsStr.c_str(); int32_t* pWidths = pTxtRun->pWidths; int32_t iLength = pTxtRun->iLength - 1; - CFX_RetainPtr<CFGAS_GEFont> pFont = pTxtRun->pFont; + RetainPtr<CFGAS_GEFont> pFont = pTxtRun->pFont; uint32_t dwStyles = pTxtRun->dwStyles; CFX_RectF rtText(*pTxtRun->pRect); bool bRTLPiece = (pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_OddBidiLevel) != 0; @@ -909,7 +909,7 @@ std::vector<CFX_RectF> CFX_TxtBreak::GetCharRects(const FX_TXTRUN* pTxtRun, float fFontSize = pTxtRun->fFontSize; int32_t iFontSize = FXSYS_round(fFontSize * 20.0f); float fScale = fFontSize / 1000.0f; - CFX_RetainPtr<CFGAS_GEFont> pFont = pTxtRun->pFont; + RetainPtr<CFGAS_GEFont> pFont = pTxtRun->pFont; if (!pFont) bCharBBox = false; diff --git a/xfa/fgas/layout/cfx_txtbreak.h b/xfa/fgas/layout/cfx_txtbreak.h index 959cd8eb48..e6f8da03d2 100644 --- a/xfa/fgas/layout/cfx_txtbreak.h +++ b/xfa/fgas/layout/cfx_txtbreak.h @@ -44,7 +44,7 @@ struct FX_TXTRUN { WideString wsStr; int32_t* pWidths; int32_t iLength; - CFX_RetainPtr<CFGAS_GEFont> pFont; + RetainPtr<CFGAS_GEFont> pFont; float fFontSize; uint32_t dwStyles; int32_t iHorizontalScale; diff --git a/xfa/fwl/cfwl_barcode.cpp b/xfa/fwl/cfwl_barcode.cpp index 1f2a978171..f5d6ea98b2 100644 --- a/xfa/fwl/cfwl_barcode.cpp +++ b/xfa/fwl/cfwl_barcode.cpp @@ -167,7 +167,7 @@ void CFWL_Barcode::GenerateBarcodeImageCache() { if (pTheme) { CFWL_ThemePart part; part.m_pWidget = this; - if (CFX_RetainPtr<CFGAS_GEFont> pFont = pTheme->GetFont(&part)) { + if (RetainPtr<CFGAS_GEFont> pFont = pTheme->GetFont(&part)) { if (CFX_Font* pCXFont = pFont->GetDevFont()) m_pBarcodeEngine->SetFont(pCXFont); } diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp index d1f0c99a39..fa5ee63b77 100644 --- a/xfa/fwl/cfwl_edit.cpp +++ b/xfa/fwl/cfwl_edit.cpp @@ -538,7 +538,7 @@ void CFWL_Edit::RenderText(CFX_RenderDevice* pRenderDev, const CFX_Matrix& mt) { ASSERT(pRenderDev); - CFX_RetainPtr<CFGAS_GEFont> font = m_EdtEngine.GetFont(); + RetainPtr<CFGAS_GEFont> font = m_EdtEngine.GetFont(); if (!font) return; @@ -635,7 +635,7 @@ void CFWL_Edit::UpdateEditParams() { } m_fFontSize = theme->GetFontSize(&part); - CFX_RetainPtr<CFGAS_GEFont> pFont = theme->GetFont(&part); + RetainPtr<CFGAS_GEFont> pFont = theme->GetFont(&part); if (!pFont) return; diff --git a/xfa/fwl/cfwl_themebackground.h b/xfa/fwl/cfwl_themebackground.h index 0141754c1e..65c29ebd7a 100644 --- a/xfa/fwl/cfwl_themebackground.h +++ b/xfa/fwl/cfwl_themebackground.h @@ -21,7 +21,7 @@ class CFWL_ThemeBackground : public CFWL_ThemePart { CXFA_Graphics* m_pGraphics; CXFA_Path* m_pPath; - CFX_RetainPtr<CFX_DIBitmap> m_pImage; + RetainPtr<CFX_DIBitmap> m_pImage; }; inline CFWL_ThemeBackground::CFWL_ThemeBackground() diff --git a/xfa/fwl/cfx_barcode_unittest.cpp b/xfa/fwl/cfx_barcode_unittest.cpp index b66d90495e..fe8aee4709 100644 --- a/xfa/fwl/cfx_barcode_unittest.cpp +++ b/xfa/fwl/cfx_barcode_unittest.cpp @@ -64,7 +64,7 @@ class BarcodeTest : public testing::Test { CFX_Matrix matrix_; std::unique_ptr<CFX_Barcode> barcode_; std::unique_ptr<CFX_RenderDevice> device_; - CFX_RetainPtr<CFX_DIBitmap> bitmap_; + RetainPtr<CFX_DIBitmap> bitmap_; }; TEST_F(BarcodeTest, Code39) { diff --git a/xfa/fwl/ifwl_themeprovider.h b/xfa/fwl/ifwl_themeprovider.h index 03767cfc06..32dc901377 100644 --- a/xfa/fwl/ifwl_themeprovider.h +++ b/xfa/fwl/ifwl_themeprovider.h @@ -7,8 +7,8 @@ #ifndef XFA_FWL_IFWL_THEMEPROVIDER_H_ #define XFA_FWL_IFWL_THEMEPROVIDER_H_ -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_coordinates.h" +#include "core/fxcrt/retain_ptr.h" #include "xfa/fgas/font/cfgas_gefont.h" class CFWL_ThemeBackground; @@ -27,8 +27,7 @@ class IFWL_ThemeProvider { virtual float GetCYBorderSize() const = 0; virtual CFX_RectF GetUIMargin(CFWL_ThemePart* pThemePart) const = 0; virtual float GetFontSize(CFWL_ThemePart* pThemePart) const = 0; - virtual CFX_RetainPtr<CFGAS_GEFont> GetFont( - CFWL_ThemePart* pThemePart) const = 0; + virtual RetainPtr<CFGAS_GEFont> GetFont(CFWL_ThemePart* pThemePart) const = 0; virtual float GetLineHeight(CFWL_ThemePart* pThemePart) const = 0; virtual float GetScrollBarWidth() const = 0; virtual FX_COLORREF GetTextColor(CFWL_ThemePart* pThemePart) const = 0; diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp index 1eade9c70b..630da7793d 100644 --- a/xfa/fwl/theme/cfwl_widgettp.cpp +++ b/xfa/fwl/theme/cfwl_widgettp.cpp @@ -303,7 +303,7 @@ CFWL_FontManager::CFWL_FontManager() {} CFWL_FontManager::~CFWL_FontManager() {} -CFX_RetainPtr<CFGAS_GEFont> CFWL_FontManager::FindFont( +RetainPtr<CFGAS_GEFont> CFWL_FontManager::FindFont( const WideStringView& wsFontFamily, uint32_t dwFontStyles, uint16_t wCodePage) { diff --git a/xfa/fwl/theme/cfwl_widgettp.h b/xfa/fwl/theme/cfwl_widgettp.h index dd36778704..eb1423e602 100644 --- a/xfa/fwl/theme/cfwl_widgettp.h +++ b/xfa/fwl/theme/cfwl_widgettp.h @@ -10,9 +10,9 @@ #include <memory> #include <vector> -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_system.h" +#include "core/fxcrt/retain_ptr.h" #include "xfa/fgas/font/cfgas_gefont.h" #include "xfa/fwl/theme/cfwl_utils.h" #include "xfa/fxgraphics/cxfa_graphics.h" @@ -39,7 +39,7 @@ class CFWL_WidgetTP { virtual void DrawBackground(CFWL_ThemeBackground* pParams); virtual void DrawText(CFWL_ThemeText* pParams); - const CFX_RetainPtr<CFGAS_GEFont>& GetFont() const { return m_pFDEFont; } + const RetainPtr<CFGAS_GEFont>& GetFont() const { return m_pFDEFont; } protected: struct CColorData { @@ -95,7 +95,7 @@ class CFWL_WidgetTP { uint32_t m_dwRefCount; std::unique_ptr<CFDE_TextOut> m_pTextOut; - CFX_RetainPtr<CFGAS_GEFont> m_pFDEFont; + RetainPtr<CFGAS_GEFont> m_pFDEFont; std::unique_ptr<CColorData> m_pColorData; }; @@ -112,7 +112,7 @@ class CFWL_FontData { bool LoadFont(const WideStringView& wsFontFamily, uint32_t dwFontStyles, uint16_t wCodePage); - CFX_RetainPtr<CFGAS_GEFont> GetFont() const { return m_pFont; } + RetainPtr<CFGAS_GEFont> GetFont() const { return m_pFont; } protected: WideString m_wsFamily; @@ -122,7 +122,7 @@ class CFWL_FontData { std::unique_ptr<CFX_FontSourceEnum_File> m_pFontSource; #endif std::unique_ptr<CFGAS_FontMgr> m_pFontMgr; - CFX_RetainPtr<CFGAS_GEFont> m_pFont; + RetainPtr<CFGAS_GEFont> m_pFont; }; class CFWL_FontManager { @@ -130,9 +130,9 @@ class CFWL_FontManager { static CFWL_FontManager* GetInstance(); static void DestroyInstance(); - CFX_RetainPtr<CFGAS_GEFont> FindFont(const WideStringView& wsFontFamily, - uint32_t dwFontStyles, - uint16_t dwCodePage); + RetainPtr<CFGAS_GEFont> FindFont(const WideStringView& wsFontFamily, + uint32_t dwFontStyles, + uint16_t dwCodePage); protected: CFWL_FontManager(); diff --git a/xfa/fxfa/cxfa_ffapp.h b/xfa/fxfa/cxfa_ffapp.h index 6ee9e45a13..857e9c03bb 100644 --- a/xfa/fxfa/cxfa_ffapp.h +++ b/xfa/fxfa/cxfa_ffapp.h @@ -12,8 +12,8 @@ #include "core/fpdfapi/parser/cpdf_stream.h" #include "core/fpdfapi/parser/cpdf_stream_acc.h" -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/cfx_unowned_ptr.h" +#include "core/fxcrt/retain_ptr.h" #include "xfa/fgas/font/cfgas_fontmgr.h" #include "xfa/fwl/cfwl_app.h" #include "xfa/fxfa/fxfa.h" diff --git a/xfa/fxfa/cxfa_ffdoc.cpp b/xfa/fxfa/cxfa_ffdoc.cpp index 316987fcc3..ee31a46f50 100644 --- a/xfa/fxfa/cxfa_ffdoc.cpp +++ b/xfa/fxfa/cxfa_ffdoc.cpp @@ -334,7 +334,7 @@ void CXFA_FFDoc::CloseDoc() { m_pApp->ClearEventTargets(); } -CFX_RetainPtr<CFX_DIBitmap> CXFA_FFDoc::GetPDFNamedImage( +RetainPtr<CFX_DIBitmap> CXFA_FFDoc::GetPDFNamedImage( const WideStringView& wsName, int32_t& iImageXDpi, int32_t& iImageYDpi) { @@ -381,18 +381,18 @@ CFX_RetainPtr<CFX_DIBitmap> CXFA_FFDoc::GetPDFNamedImage( auto pAcc = pdfium::MakeRetain<CPDF_StreamAcc>(pStream); pAcc->LoadAllData(); - CFX_RetainPtr<IFX_SeekableStream> pImageFileRead = + RetainPtr<IFX_SeekableStream> pImageFileRead = pdfium::MakeRetain<CFX_MemoryStream>( const_cast<uint8_t*>(pAcc->GetData()), pAcc->GetSize(), false); - CFX_RetainPtr<CFX_DIBitmap> pDibSource = XFA_LoadImageFromBuffer( + RetainPtr<CFX_DIBitmap> pDibSource = XFA_LoadImageFromBuffer( pImageFileRead, FXCODEC_IMAGE_UNKNOWN, iImageXDpi, iImageYDpi); m_HashToDibDpiMap[dwHash] = {pDibSource, iImageXDpi, iImageYDpi}; return pDibSource; } bool CXFA_FFDoc::SavePackage(XFA_HashCode code, - const CFX_RetainPtr<IFX_SeekableStream>& pFile, + const RetainPtr<IFX_SeekableStream>& pFile, CFX_ChecksumContext* pCSContext) { CXFA_Document* doc = m_pDocumentParser->GetDocument(); auto pExport = pdfium::MakeUnique<CXFA_DataExporter>(doc); @@ -409,7 +409,7 @@ bool CXFA_FFDoc::SavePackage(XFA_HashCode code, pFile, pNode, 0, bsChecksum.GetLength() ? bsChecksum.c_str() : nullptr); } -bool CXFA_FFDoc::ImportData(const CFX_RetainPtr<IFX_SeekableStream>& pStream, +bool CXFA_FFDoc::ImportData(const RetainPtr<IFX_SeekableStream>& pStream, bool bXDP) { auto importer = pdfium::MakeUnique<CXFA_DataImporter>(m_pDocumentParser->GetDocument()); diff --git a/xfa/fxfa/cxfa_ffdoc.h b/xfa/fxfa/cxfa_ffdoc.h index 1d35c669da..ceec91f7db 100644 --- a/xfa/fxfa/cxfa_ffdoc.h +++ b/xfa/fxfa/cxfa_ffdoc.h @@ -24,12 +24,12 @@ class CXFA_FFDocView; struct FX_IMAGEDIB_AND_DPI { FX_IMAGEDIB_AND_DPI(); FX_IMAGEDIB_AND_DPI(const FX_IMAGEDIB_AND_DPI& that); - FX_IMAGEDIB_AND_DPI(const CFX_RetainPtr<CFX_DIBSource>& pDib, + FX_IMAGEDIB_AND_DPI(const RetainPtr<CFX_DIBSource>& pDib, int32_t xDpi, int32_t yDpi); ~FX_IMAGEDIB_AND_DPI(); - CFX_RetainPtr<CFX_DIBSource> pDibSource; + RetainPtr<CFX_DIBSource> pDibSource; int32_t iImageXDpi; int32_t iImageYDpi; }; @@ -39,7 +39,7 @@ inline FX_IMAGEDIB_AND_DPI::FX_IMAGEDIB_AND_DPI( const FX_IMAGEDIB_AND_DPI& that) = default; inline FX_IMAGEDIB_AND_DPI::FX_IMAGEDIB_AND_DPI( - const CFX_RetainPtr<CFX_DIBSource>& pDib, + const RetainPtr<CFX_DIBSource>& pDib, int32_t xDpi, int32_t yDpi) : pDibSource(pDib), iImageXDpi(xDpi), iImageYDpi(yDpi) {} @@ -70,21 +70,21 @@ class CXFA_FFDoc { CPDF_Document* GetPDFDoc() const { return m_pPDFDoc.Get(); } CXFA_FFDocView* GetDocView(CXFA_LayoutProcessor* pLayout); CXFA_FFDocView* GetDocView(); - CFX_RetainPtr<CFX_DIBitmap> GetPDFNamedImage(const WideStringView& wsName, - int32_t& iImageXDpi, - int32_t& iImageYDpi); + RetainPtr<CFX_DIBitmap> GetPDFNamedImage(const WideStringView& wsName, + int32_t& iImageXDpi, + int32_t& iImageYDpi); CFGAS_PDFFontMgr* GetPDFFontMgr() const { return m_pPDFFontMgr.get(); } bool SavePackage(XFA_HashCode code, - const CFX_RetainPtr<IFX_SeekableStream>& pFile, + const RetainPtr<IFX_SeekableStream>& pFile, CFX_ChecksumContext* pCSContext); - bool ImportData(const CFX_RetainPtr<IFX_SeekableStream>& pStream, + bool ImportData(const RetainPtr<IFX_SeekableStream>& pStream, bool bXDP = true); private: CFX_UnownedPtr<IXFA_DocEnvironment> const m_pDocEnvironment; std::unique_ptr<CXFA_DocumentParser> m_pDocumentParser; - CFX_RetainPtr<IFX_SeekableStream> m_pStream; + RetainPtr<IFX_SeekableStream> m_pStream; CFX_UnownedPtr<CXFA_FFApp> m_pApp; std::unique_ptr<CXFA_FFNotify> m_pNotify; CFX_UnownedPtr<CPDF_Document> m_pPDFDoc; diff --git a/xfa/fxfa/cxfa_ffimage.cpp b/xfa/fxfa/cxfa_ffimage.cpp index ec6a29cd28..757867f076 100644 --- a/xfa/fxfa/cxfa_ffimage.cpp +++ b/xfa/fxfa/cxfa_ffimage.cpp @@ -45,7 +45,7 @@ void CXFA_FFImage::RenderWidget(CXFA_Graphics* pGS, CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); - CFX_RetainPtr<CFX_DIBitmap> pDIBitmap = GetDataAcc()->GetImageImage(); + RetainPtr<CFX_DIBitmap> pDIBitmap = GetDataAcc()->GetImageImage(); if (!pDIBitmap) return; diff --git a/xfa/fxfa/cxfa_ffimageedit.cpp b/xfa/fxfa/cxfa_ffimageedit.cpp index 1c9e014256..2189877afb 100644 --- a/xfa/fxfa/cxfa_ffimageedit.cpp +++ b/xfa/fxfa/cxfa_ffimageedit.cpp @@ -64,7 +64,7 @@ void CXFA_FFImageEdit::RenderWidget(CXFA_Graphics* pGS, CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); DrawBorder(pGS, borderUI, m_rtUI, mtRotate); RenderCaption(pGS, &mtRotate); - CFX_RetainPtr<CFX_DIBitmap> pDIBitmap = m_pDataAcc->GetImageEditImage(); + RetainPtr<CFX_DIBitmap> pDIBitmap = m_pDataAcc->GetImageEditImage(); if (!pDIBitmap) return; diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index 0935f56b90..7763a19972 100644 --- a/xfa/fxfa/cxfa_ffwidget.cpp +++ b/xfa/fxfa/cxfa_ffwidget.cpp @@ -1414,7 +1414,7 @@ class CXFA_ImageRenderer { ~CXFA_ImageRenderer(); bool Start(CFX_RenderDevice* pDevice, - const CFX_RetainPtr<CFX_DIBSource>& pDIBSource, + const RetainPtr<CFX_DIBSource>& pDIBSource, FX_ARGB bitmap_argb, int bitmap_alpha, const CFX_Matrix* pImage2Device, @@ -1424,7 +1424,7 @@ class CXFA_ImageRenderer { protected: bool StartDIBSource(); - void CompositeDIBitmap(const CFX_RetainPtr<CFX_DIBitmap>& pDIBitmap, + void CompositeDIBitmap(const RetainPtr<CFX_DIBitmap>& pDIBitmap, int left, int top, FX_ARGB mask_argb, @@ -1435,8 +1435,8 @@ class CXFA_ImageRenderer { CFX_RenderDevice* m_pDevice; int m_Status; CFX_Matrix m_ImageMatrix; - CFX_RetainPtr<CFX_DIBSource> m_pDIBSource; - CFX_RetainPtr<CFX_DIBitmap> m_pCloneConvert; + RetainPtr<CFX_DIBSource> m_pDIBSource; + RetainPtr<CFX_DIBitmap> m_pCloneConvert; int m_BitmapAlpha; FX_ARGB m_FillArgb; uint32_t m_Flags; @@ -1461,7 +1461,7 @@ CXFA_ImageRenderer::CXFA_ImageRenderer() CXFA_ImageRenderer::~CXFA_ImageRenderer() {} bool CXFA_ImageRenderer::Start(CFX_RenderDevice* pDevice, - const CFX_RetainPtr<CFX_DIBSource>& pDIBSource, + const RetainPtr<CFX_DIBSource>& pDIBSource, FX_ARGB bitmap_argb, int bitmap_alpha, const CFX_Matrix* pImage2Device, @@ -1497,7 +1497,7 @@ bool CXFA_ImageRenderer::StartDIBSource() { m_Result = false; return false; } - CFX_RetainPtr<CFX_DIBSource> pDib = m_pDIBSource; + RetainPtr<CFX_DIBSource> pDib = m_pDIBSource; if (m_pDIBSource->HasAlpha() && !(m_pDevice->GetRenderCaps() & FXRC_ALPHA_IMAGE) && !(m_pDevice->GetRenderCaps() & FXRC_GET_BITS)) { @@ -1549,7 +1549,7 @@ bool CXFA_ImageRenderer::StartDIBSource() { FX_RECT dest_clip( dest_rect.left - image_rect.left, dest_rect.top - image_rect.top, dest_rect.right - image_rect.left, dest_rect.bottom - image_rect.top); - CFX_RetainPtr<CFX_DIBitmap> pStretched = + RetainPtr<CFX_DIBitmap> pStretched = m_pDIBSource->StretchTo(dest_width, dest_height, m_Flags, &dest_clip); if (pStretched) { CompositeDIBitmap(pStretched, dest_rect.left, dest_rect.top, m_FillArgb, @@ -1563,7 +1563,7 @@ bool CXFA_ImageRenderer::Continue() { if (m_pTransformer->Continue(nullptr)) return true; - CFX_RetainPtr<CFX_DIBitmap> pBitmap = m_pTransformer->DetachBitmap(); + RetainPtr<CFX_DIBitmap> pBitmap = m_pTransformer->DetachBitmap(); if (!pBitmap) return false; @@ -1589,7 +1589,7 @@ bool CXFA_ImageRenderer::Continue() { } void CXFA_ImageRenderer::CompositeDIBitmap( - const CFX_RetainPtr<CFX_DIBitmap>& pDIBitmap, + const RetainPtr<CFX_DIBitmap>& pDIBitmap, int left, int top, FX_ARGB mask_argb, @@ -1635,10 +1635,10 @@ void CXFA_ImageRenderer::CompositeDIBitmap( FX_RECT rect(left, top, left + pDIBitmap->GetWidth(), top + pDIBitmap->GetHeight()); rect.Intersect(m_pDevice->GetClipBox()); - CFX_RetainPtr<CFX_DIBitmap> pClone; + RetainPtr<CFX_DIBitmap> pClone; if (m_pDevice->GetBackDrop() && m_pDevice->GetBitmap()) { pClone = m_pDevice->GetBackDrop()->Clone(&rect); - CFX_RetainPtr<CFX_DIBitmap> pForeBitmap = m_pDevice->GetBitmap(); + RetainPtr<CFX_DIBitmap> pForeBitmap = m_pDevice->GetBitmap(); pClone->CompositeBitmap(0, 0, pClone->GetWidth(), pClone->GetHeight(), pForeBitmap, rect.left, rect.top); left = left >= 0 ? 0 : left; @@ -1667,8 +1667,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap( (m_pDevice->GetRenderCaps() & FXRC_ALPHA_IMAGE)) { return; } - CFX_RetainPtr<CFX_DIBitmap> pCloneConvert = - pDIBitmap->CloneConvert(FXDIB_Rgb); + RetainPtr<CFX_DIBitmap> pCloneConvert = pDIBitmap->CloneConvert(FXDIB_Rgb); if (!pCloneConvert) return; @@ -1684,7 +1683,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap( void XFA_DrawImage(CXFA_Graphics* pGS, const CFX_RectF& rtImage, const CFX_Matrix& matrix, - const CFX_RetainPtr<CFX_DIBitmap>& pDIBitmap, + const RetainPtr<CFX_DIBitmap>& pDIBitmap, int32_t iAspect, int32_t iImageXDpi, int32_t iImageYDpi, @@ -1885,11 +1884,11 @@ FXCODEC_IMAGE_TYPE XFA_GetImageType(const WideString& wsType) { return FXCODEC_IMAGE_UNKNOWN; } -CFX_RetainPtr<CFX_DIBitmap> XFA_LoadImageData(CXFA_FFDoc* pDoc, - CXFA_Image* pImage, - bool& bNameImage, - int32_t& iImageXDpi, - int32_t& iImageYDpi) { +RetainPtr<CFX_DIBitmap> XFA_LoadImageData(CXFA_FFDoc* pDoc, + CXFA_Image* pImage, + bool& bNameImage, + int32_t& iImageXDpi, + int32_t& iImageYDpi) { WideString wsHref; WideString wsImage; pImage->GetHref(wsHref); @@ -1902,7 +1901,7 @@ CFX_RetainPtr<CFX_DIBitmap> XFA_LoadImageData(CXFA_FFDoc* pDoc, FXCODEC_IMAGE_TYPE type = XFA_GetImageType(wsContentType); ByteString bsContent; uint8_t* pImageBuffer = nullptr; - CFX_RetainPtr<IFX_SeekableReadStream> pImageFileRead; + RetainPtr<IFX_SeekableReadStream> pImageFileRead; if (wsImage.GetLength() > 0) { XFA_ATTRIBUTEENUM iEncoding = (XFA_ATTRIBUTEENUM)pImage->GetTransferEncoding(); @@ -1924,7 +1923,7 @@ CFX_RetainPtr<CFX_DIBitmap> XFA_LoadImageData(CXFA_FFDoc* pDoc, } else { WideString wsURL = wsHref; if (wsURL.Left(7) != L"http://" && wsURL.Left(6) != L"ftp://") { - CFX_RetainPtr<CFX_DIBitmap> pBitmap = + RetainPtr<CFX_DIBitmap> pBitmap = pDoc->GetPDFNamedImage(wsURL.AsStringView(), iImageXDpi, iImageYDpi); if (pBitmap) { bNameImage = true; @@ -1938,7 +1937,7 @@ CFX_RetainPtr<CFX_DIBitmap> XFA_LoadImageData(CXFA_FFDoc* pDoc, return nullptr; } bNameImage = false; - CFX_RetainPtr<CFX_DIBitmap> pBitmap = + RetainPtr<CFX_DIBitmap> pBitmap = XFA_LoadImageFromBuffer(pImageFileRead, type, iImageXDpi, iImageYDpi); FX_Free(pImageBuffer); return pBitmap; @@ -1964,8 +1963,8 @@ static FXDIB_Format XFA_GetDIBFormat(FXCODEC_IMAGE_TYPE type, return dibFormat; } -CFX_RetainPtr<CFX_DIBitmap> XFA_LoadImageFromBuffer( - const CFX_RetainPtr<IFX_SeekableReadStream>& pImageFileRead, +RetainPtr<CFX_DIBitmap> XFA_LoadImageFromBuffer( + const RetainPtr<IFX_SeekableReadStream>& pImageFileRead, FXCODEC_IMAGE_TYPE type, int32_t& iImageXDpi, int32_t& iImageYDpi) { @@ -1998,7 +1997,7 @@ CFX_RetainPtr<CFX_DIBitmap> XFA_LoadImageFromBuffer( int32_t iComponents = pProgressiveDecoder->GetNumComponents(); int32_t iBpc = pProgressiveDecoder->GetBPC(); FXDIB_Format dibFormat = XFA_GetDIBFormat(type, iComponents, iBpc); - CFX_RetainPtr<CFX_DIBitmap> pBitmap = pdfium::MakeRetain<CFX_DIBitmap>(); + RetainPtr<CFX_DIBitmap> pBitmap = pdfium::MakeRetain<CFX_DIBitmap>(); pBitmap->Create(pProgressiveDecoder->GetWidth(), pProgressiveDecoder->GetHeight(), dibFormat); pBitmap->Clear(0xffffffff); diff --git a/xfa/fxfa/cxfa_ffwidget.h b/xfa/fxfa/cxfa_ffwidget.h index 41bb94164b..c743742890 100644 --- a/xfa/fxfa/cxfa_ffwidget.h +++ b/xfa/fxfa/cxfa_ffwidget.h @@ -42,21 +42,21 @@ CFX_GraphStateData::LineCap XFA_LineCapToFXGE(int32_t iLineCap); void XFA_DrawImage(CXFA_Graphics* pGS, const CFX_RectF& rtImage, const CFX_Matrix& matrix, - const CFX_RetainPtr<CFX_DIBitmap>& pDIBitmap, + const RetainPtr<CFX_DIBitmap>& pDIBitmap, int32_t iAspect, int32_t iImageXDpi, int32_t iImageYDpi, int32_t iHorzAlign = XFA_ATTRIBUTEENUM_Left, int32_t iVertAlign = XFA_ATTRIBUTEENUM_Top); -CFX_RetainPtr<CFX_DIBitmap> XFA_LoadImageData(CXFA_FFDoc* pDoc, - CXFA_Image* pImage, - bool& bNameImage, - int32_t& iImageXDpi, - int32_t& iImageYDpi); +RetainPtr<CFX_DIBitmap> XFA_LoadImageData(CXFA_FFDoc* pDoc, + CXFA_Image* pImage, + bool& bNameImage, + int32_t& iImageXDpi, + int32_t& iImageYDpi); -CFX_RetainPtr<CFX_DIBitmap> XFA_LoadImageFromBuffer( - const CFX_RetainPtr<IFX_SeekableReadStream>& pImageFileRead, +RetainPtr<CFX_DIBitmap> XFA_LoadImageFromBuffer( + const RetainPtr<IFX_SeekableReadStream>& pImageFileRead, FXCODEC_IMAGE_TYPE type, int32_t& iImageXDpi, int32_t& iImageYDpi); diff --git a/xfa/fxfa/cxfa_fileread.h b/xfa/fxfa/cxfa_fileread.h index 2dba4d23df..62fa4c67bb 100644 --- a/xfa/fxfa/cxfa_fileread.h +++ b/xfa/fxfa/cxfa_fileread.h @@ -9,8 +9,8 @@ #include <vector> -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_stream.h" +#include "core/fxcrt/retain_ptr.h" class CPDF_Stream; class CPDF_StreamAcc; @@ -30,7 +30,7 @@ class CXFA_FileRead : public IFX_SeekableStream { bool WriteBlock(const void* pData, FX_FILESIZE offset, size_t size) override; private: - std::vector<CFX_RetainPtr<CPDF_StreamAcc>> m_Data; + std::vector<RetainPtr<CPDF_StreamAcc>> m_Data; }; #endif // XFA_FXFA_CXFA_FILEREAD_H_ diff --git a/xfa/fxfa/cxfa_fontmgr.cpp b/xfa/fxfa/cxfa_fontmgr.cpp index 5a11dd5dc0..ddf8ffada4 100644 --- a/xfa/fxfa/cxfa_fontmgr.cpp +++ b/xfa/fxfa/cxfa_fontmgr.cpp @@ -23,7 +23,7 @@ CXFA_FontMgr::CXFA_FontMgr() {} CXFA_FontMgr::~CXFA_FontMgr() {} -CFX_RetainPtr<CFGAS_GEFont> CXFA_FontMgr::GetFont( +RetainPtr<CFGAS_GEFont> CXFA_FontMgr::GetFont( CXFA_FFDoc* hDoc, const WideStringView& wsFontFamily, uint32_t dwFontStyles, @@ -39,7 +39,7 @@ CFX_RetainPtr<CFGAS_GEFont> CXFA_FontMgr::GetFont( CFGAS_PDFFontMgr* pMgr = hDoc->GetPDFFontMgr(); CPDF_Font* pPDFFont = nullptr; - CFX_RetainPtr<CFGAS_GEFont> pFont; + RetainPtr<CFGAS_GEFont> pFont; if (pMgr) { pFont = pMgr->GetFont(wsEnglishName.AsStringView(), dwFontStyles, &pPDFFont, true); diff --git a/xfa/fxfa/cxfa_fontmgr.h b/xfa/fxfa/cxfa_fontmgr.h index b7d1f51ff2..55ee6bbc4d 100644 --- a/xfa/fxfa/cxfa_fontmgr.h +++ b/xfa/fxfa/cxfa_fontmgr.h @@ -11,9 +11,9 @@ #include <memory> #include <vector> -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_extension.h" #include "core/fxcrt/fx_system.h" +#include "core/fxcrt/retain_ptr.h" #include "xfa/fgas/font/cfgas_defaultfontmanager.h" #include "xfa/fgas/font/cfgas_fontmgr.h" #include "xfa/fgas/font/cfgas_pdffontmgr.h" @@ -26,15 +26,15 @@ class CXFA_FontMgr { CXFA_FontMgr(); ~CXFA_FontMgr(); - CFX_RetainPtr<CFGAS_GEFont> GetFont(CXFA_FFDoc* hDoc, - const WideStringView& wsFontFamily, - uint32_t dwFontStyles, - uint16_t wCodePage = 0xFFFF); + RetainPtr<CFGAS_GEFont> GetFont(CXFA_FFDoc* hDoc, + const WideStringView& wsFontFamily, + uint32_t dwFontStyles, + uint16_t wCodePage = 0xFFFF); void SetDefFontMgr(std::unique_ptr<CFGAS_DefaultFontManager> pFontMgr); private: std::unique_ptr<CFGAS_DefaultFontManager> m_pDefFontMgr; - std::map<ByteString, CFX_RetainPtr<CFGAS_GEFont>> m_FontMap; + std::map<ByteString, RetainPtr<CFGAS_GEFont>> m_FontMap; }; #endif // XFA_FXFA_CXFA_FONTMGR_H_ diff --git a/xfa/fxfa/cxfa_fwltheme.cpp b/xfa/fxfa/cxfa_fwltheme.cpp index 35456eff16..f27b5ddef5 100644 --- a/xfa/fxfa/cxfa_fwltheme.cpp +++ b/xfa/fxfa/cxfa_fwltheme.cpp @@ -185,7 +185,7 @@ float CXFA_FWLTheme::GetFontSize(CFWL_ThemePart* pThemePart) const { return FWLTHEME_CAPACITY_FontSize; } -CFX_RetainPtr<CFGAS_GEFont> CXFA_FWLTheme::GetFont( +RetainPtr<CFGAS_GEFont> CXFA_FWLTheme::GetFont( CFWL_ThemePart* pThemePart) const { if (CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pThemePart->m_pWidget)) return pWidget->GetDataAcc()->GetFDEFont(); diff --git a/xfa/fxfa/cxfa_fwltheme.h b/xfa/fxfa/cxfa_fwltheme.h index 48fb744cb2..7813545447 100644 --- a/xfa/fxfa/cxfa_fwltheme.h +++ b/xfa/fxfa/cxfa_fwltheme.h @@ -37,8 +37,7 @@ class CXFA_FWLTheme final : public IFWL_ThemeProvider { float GetCYBorderSize() const override; CFX_RectF GetUIMargin(CFWL_ThemePart* pThemePart) const override; float GetFontSize(CFWL_ThemePart* pThemePart) const override; - CFX_RetainPtr<CFGAS_GEFont> GetFont( - CFWL_ThemePart* pThemePart) const override; + RetainPtr<CFGAS_GEFont> GetFont(CFWL_ThemePart* pThemePart) const override; float GetLineHeight(CFWL_ThemePart* pThemePart) const override; float GetScrollBarWidth() const override; FX_COLORREF GetTextColor(CFWL_ThemePart* pThemePart) const override; @@ -59,7 +58,7 @@ class CXFA_FWLTheme final : public IFWL_ThemeProvider { std::unique_ptr<CFWL_CaretTP> m_pCaretTP; std::unique_ptr<CFWL_BarcodeTP> m_pBarcodeTP; std::unique_ptr<CFDE_TextOut> m_pTextOut; - CFX_RetainPtr<CFGAS_GEFont> m_pCalendarFont; + RetainPtr<CFGAS_GEFont> m_pCalendarFont; WideString m_wsResource; CFX_UnownedPtr<CXFA_FFApp> const m_pApp; CFX_RectF m_Rect; diff --git a/xfa/fxfa/cxfa_linkuserdata.h b/xfa/fxfa/cxfa_linkuserdata.h index 7a9648c9b5..3d0f95e91c 100644 --- a/xfa/fxfa/cxfa_linkuserdata.h +++ b/xfa/fxfa/cxfa_linkuserdata.h @@ -7,14 +7,14 @@ #ifndef XFA_FXFA_CXFA_LINKUSERDATA_H_ #define XFA_FXFA_CXFA_LINKUSERDATA_H_ -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" +#include "core/fxcrt/retain_ptr.h" -class CXFA_LinkUserData : public CFX_Retainable { +class CXFA_LinkUserData : public Retainable { public: template <typename T, typename... Args> - friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args); + friend RetainPtr<T> pdfium::MakeRetain(Args&&... args); const wchar_t* GetLinkURL() const { return m_wsURLContent.c_str(); } diff --git a/xfa/fxfa/cxfa_loadercontext.h b/xfa/fxfa/cxfa_loadercontext.h index 64ab50696b..06e3f117d8 100644 --- a/xfa/fxfa/cxfa_loadercontext.h +++ b/xfa/fxfa/cxfa_loadercontext.h @@ -31,7 +31,7 @@ class CXFA_LoaderContext { uint32_t m_dwFlags; CFX_XMLNode* m_pXMLNode; CXFA_Node* m_pNode; - CFX_RetainPtr<CFX_CSSComputedStyle> m_pParentStyle; + RetainPtr<CFX_CSSComputedStyle> m_pParentStyle; std::vector<float> m_lineHeights; std::vector<float> m_BlocksHeight; }; diff --git a/xfa/fxfa/cxfa_textlayout.cpp b/xfa/fxfa/cxfa_textlayout.cpp index bbc61d40f2..038f451ad9 100644 --- a/xfa/fxfa/cxfa_textlayout.cpp +++ b/xfa/fxfa/cxfa_textlayout.cpp @@ -689,9 +689,9 @@ bool CXFA_TextLayout::LoadRichText( CFX_XMLNode* pXMLNode, const CFX_SizeF& szText, float& fLinePos, - const CFX_RetainPtr<CFX_CSSComputedStyle>& pParentStyle, + const RetainPtr<CFX_CSSComputedStyle>& pParentStyle, bool bSavePieces, - CFX_RetainPtr<CXFA_LinkUserData> pLinkData, + RetainPtr<CXFA_LinkUserData> pLinkData, bool bEndBreak, bool bIsOl, int32_t iLiCount) { @@ -703,7 +703,7 @@ bool CXFA_TextLayout::LoadRichText( CFX_CSSDisplay eDisplay = CFX_CSSDisplay::None; bool bContentNode = false; float fSpaceBelow = 0; - CFX_RetainPtr<CFX_CSSComputedStyle> pStyle; + RetainPtr<CFX_CSSComputedStyle> pStyle; WideString wsName; if (bEndBreak) { bool bCurOl = false; @@ -1008,7 +1008,7 @@ void CXFA_TextLayout::AppendTextLine(CFX_BreakType dwStatus, if (iPieces < 1) return; - CFX_RetainPtr<CFX_CSSComputedStyle> pStyle; + RetainPtr<CFX_CSSComputedStyle> pStyle; if (bSavePieces) { auto pNew = pdfium::MakeUnique<CXFA_PieceLine>(); CXFA_PieceLine* pPieceLine = pNew.get(); diff --git a/xfa/fxfa/cxfa_textlayout.h b/xfa/fxfa/cxfa_textlayout.h index 50ee83fd75..5856826166 100644 --- a/xfa/fxfa/cxfa_textlayout.h +++ b/xfa/fxfa/cxfa_textlayout.h @@ -79,9 +79,9 @@ class CXFA_TextLayout { bool LoadRichText(CFX_XMLNode* pXMLNode, const CFX_SizeF& szText, float& fLinePos, - const CFX_RetainPtr<CFX_CSSComputedStyle>& pParentStyle, + const RetainPtr<CFX_CSSComputedStyle>& pParentStyle, bool bSavePieces, - CFX_RetainPtr<CXFA_LinkUserData> pLinkData, + RetainPtr<CXFA_LinkUserData> pLinkData, bool bEndBreak = true, bool bIsOl = false, int32_t iLiCount = 0); diff --git a/xfa/fxfa/cxfa_textparsecontext.h b/xfa/fxfa/cxfa_textparsecontext.h index 3cd5710728..20d914bc59 100644 --- a/xfa/fxfa/cxfa_textparsecontext.h +++ b/xfa/fxfa/cxfa_textparsecontext.h @@ -29,7 +29,7 @@ class CXFA_TextParseContext { } const std::vector<const CFX_CSSDeclaration*>& GetDecls() { return decls_; } - CFX_RetainPtr<CFX_CSSComputedStyle> m_pParentStyle; + RetainPtr<CFX_CSSComputedStyle> m_pParentStyle; private: std::vector<const CFX_CSSDeclaration*> decls_; diff --git a/xfa/fxfa/cxfa_textparser.cpp b/xfa/fxfa/cxfa_textparser.cpp index 3c78a8686d..9cbb72aa19 100644 --- a/xfa/fxfa/cxfa_textparser.cpp +++ b/xfa/fxfa/cxfa_textparser.cpp @@ -88,7 +88,7 @@ std::unique_ptr<CFX_CSSStyleSheet> CXFA_TextParser::LoadDefaultSheetStyle() { : nullptr; } -CFX_RetainPtr<CFX_CSSComputedStyle> CXFA_TextParser::CreateRootStyle( +RetainPtr<CFX_CSSComputedStyle> CXFA_TextParser::CreateRootStyle( CXFA_TextProvider* pTextProvider) { CXFA_Font font = pTextProvider->GetFontNode(); CXFA_Para para = pTextProvider->GetParaNode(); @@ -150,7 +150,7 @@ CFX_RetainPtr<CFX_CSSComputedStyle> CXFA_TextParser::CreateRootStyle( return pStyle; } -CFX_RetainPtr<CFX_CSSComputedStyle> CXFA_TextParser::CreateStyle( +RetainPtr<CFX_CSSComputedStyle> CXFA_TextParser::CreateStyle( CFX_CSSComputedStyle* pParentStyle) { auto pNewStyle = m_pSelector->CreateComputedStyle(pParentStyle); ASSERT(pNewStyle); @@ -171,7 +171,7 @@ CFX_RetainPtr<CFX_CSSComputedStyle> CXFA_TextParser::CreateStyle( return pNewStyle; } -CFX_RetainPtr<CFX_CSSComputedStyle> CXFA_TextParser::ComputeStyle( +RetainPtr<CFX_CSSComputedStyle> CXFA_TextParser::ComputeStyle( CFX_XMLNode* pXMLNode, CFX_CSSComputedStyle* pParentStyle) { auto it = m_mapXMLNodeToParseContext.find(pXMLNode); @@ -215,7 +215,7 @@ void CXFA_TextParser::ParseRichText(CFX_XMLNode* pXMLNode, if (!tagProvider->m_bTagAvailable) return; - CFX_RetainPtr<CFX_CSSComputedStyle> pNewStyle; + RetainPtr<CFX_CSSComputedStyle> pNewStyle; if ((tagProvider->GetTagName() != L"body") || (tagProvider->GetTagName() != L"html")) { auto pTextContext = pdfium::MakeUnique<CXFA_TextParseContext>(); @@ -315,7 +315,7 @@ bool CXFA_TextParser::IsSpaceRun(CFX_CSSComputedStyle* pStyle) const { return false; } -CFX_RetainPtr<CFGAS_GEFont> CXFA_TextParser::GetFont( +RetainPtr<CFGAS_GEFont> CXFA_TextParser::GetFont( CXFA_TextProvider* pTextProvider, CFX_CSSComputedStyle* pStyle) const { WideStringView wsFamily = L"Courier"; diff --git a/xfa/fxfa/cxfa_textparser.h b/xfa/fxfa/cxfa_textparser.h index ee5c38d2af..9a2232efa1 100644 --- a/xfa/fxfa/cxfa_textparser.h +++ b/xfa/fxfa/cxfa_textparser.h @@ -10,9 +10,9 @@ #include <map> #include <memory> -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" +#include "core/fxcrt/retain_ptr.h" #include "core/fxge/fx_dib.h" #include "xfa/fgas/font/cfgas_gefont.h" @@ -32,9 +32,9 @@ class CXFA_TextParser { void Reset(); void DoParse(CFX_XMLNode* pXMLContainer, CXFA_TextProvider* pTextProvider); - CFX_RetainPtr<CFX_CSSComputedStyle> CreateRootStyle( + RetainPtr<CFX_CSSComputedStyle> CreateRootStyle( CXFA_TextProvider* pTextProvider); - CFX_RetainPtr<CFX_CSSComputedStyle> ComputeStyle( + RetainPtr<CFX_CSSComputedStyle> ComputeStyle( CFX_XMLNode* pXMLNode, CFX_CSSComputedStyle* pParentStyle); @@ -49,8 +49,8 @@ class CXFA_TextParser { bool GetTabstops(CFX_CSSComputedStyle* pStyle, CXFA_TextTabstopsContext* pTabstopContext); - CFX_RetainPtr<CFGAS_GEFont> GetFont(CXFA_TextProvider* pTextProvider, - CFX_CSSComputedStyle* pStyle) const; + RetainPtr<CFGAS_GEFont> GetFont(CXFA_TextProvider* pTextProvider, + CFX_CSSComputedStyle* pStyle) const; float GetFontSize(CXFA_TextProvider* pTextProvider, CFX_CSSComputedStyle* pStyle) const; @@ -113,7 +113,7 @@ class CXFA_TextParser { void ParseRichText(CFX_XMLNode* pXMLNode, CFX_CSSComputedStyle* pParentStyle); std::unique_ptr<TagProvider> ParseTagInfo(CFX_XMLNode* pXMLNode); std::unique_ptr<CFX_CSSStyleSheet> LoadDefaultSheetStyle(); - CFX_RetainPtr<CFX_CSSComputedStyle> CreateStyle( + RetainPtr<CFX_CSSComputedStyle> CreateStyle( CFX_CSSComputedStyle* pParentStyle); bool m_bParsed; diff --git a/xfa/fxfa/cxfa_textpiece.h b/xfa/fxfa/cxfa_textpiece.h index 4ea5a4158c..b5025d2970 100644 --- a/xfa/fxfa/cxfa_textpiece.h +++ b/xfa/fxfa/cxfa_textpiece.h @@ -33,8 +33,8 @@ class CXFA_TextPiece { FX_ARGB dwColor; float fFontSize; CFX_RectF rtPiece; - CFX_RetainPtr<CFGAS_GEFont> pFont; - CFX_RetainPtr<CXFA_LinkUserData> pLinkData; + RetainPtr<CFGAS_GEFont> pFont; + RetainPtr<CXFA_LinkUserData> pLinkData; }; #endif // XFA_FXFA_CXFA_TEXTPIECE_H_ diff --git a/xfa/fxfa/cxfa_textuserdata.cpp b/xfa/fxfa/cxfa_textuserdata.cpp index 51a2f43194..6c46978609 100644 --- a/xfa/fxfa/cxfa_textuserdata.cpp +++ b/xfa/fxfa/cxfa_textuserdata.cpp @@ -12,12 +12,12 @@ #include "xfa/fxfa/cxfa_linkuserdata.h" CXFA_TextUserData::CXFA_TextUserData( - const CFX_RetainPtr<CFX_CSSComputedStyle>& pStyle) + const RetainPtr<CFX_CSSComputedStyle>& pStyle) : m_pStyle(pStyle) {} CXFA_TextUserData::CXFA_TextUserData( - const CFX_RetainPtr<CFX_CSSComputedStyle>& pStyle, - const CFX_RetainPtr<CXFA_LinkUserData>& pLinkData) + const RetainPtr<CFX_CSSComputedStyle>& pStyle, + const RetainPtr<CXFA_LinkUserData>& pLinkData) : m_pStyle(pStyle), m_pLinkData(pLinkData) {} CXFA_TextUserData::~CXFA_TextUserData() {} diff --git a/xfa/fxfa/cxfa_textuserdata.h b/xfa/fxfa/cxfa_textuserdata.h index 442e6318c0..c1af217bf1 100644 --- a/xfa/fxfa/cxfa_textuserdata.h +++ b/xfa/fxfa/cxfa_textuserdata.h @@ -7,23 +7,23 @@ #ifndef XFA_FXFA_CXFA_TEXTUSERDATA_H_ #define XFA_FXFA_CXFA_TEXTUSERDATA_H_ -#include "core/fxcrt/cfx_retain_ptr.h" +#include "core/fxcrt/retain_ptr.h" class CFX_CSSComputedStyle; class CXFA_LinkUserData; -class CXFA_TextUserData : public CFX_Retainable { +class CXFA_TextUserData : public Retainable { public: template <typename T, typename... Args> - friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args); + friend RetainPtr<T> pdfium::MakeRetain(Args&&... args); - CFX_RetainPtr<CFX_CSSComputedStyle> m_pStyle; - CFX_RetainPtr<CXFA_LinkUserData> m_pLinkData; + RetainPtr<CFX_CSSComputedStyle> m_pStyle; + RetainPtr<CXFA_LinkUserData> m_pLinkData; private: - explicit CXFA_TextUserData(const CFX_RetainPtr<CFX_CSSComputedStyle>& pStyle); - CXFA_TextUserData(const CFX_RetainPtr<CFX_CSSComputedStyle>& pStyle, - const CFX_RetainPtr<CXFA_LinkUserData>& pLinkData); + explicit CXFA_TextUserData(const RetainPtr<CFX_CSSComputedStyle>& pStyle); + CXFA_TextUserData(const RetainPtr<CFX_CSSComputedStyle>& pStyle, + const RetainPtr<CXFA_LinkUserData>& pLinkData); ~CXFA_TextUserData() override; }; diff --git a/xfa/fxfa/cxfa_widgetacc.cpp b/xfa/fxfa/cxfa_widgetacc.cpp index 791b814d9e..260581e73b 100644 --- a/xfa/fxfa/cxfa_widgetacc.cpp +++ b/xfa/fxfa/cxfa_widgetacc.cpp @@ -91,7 +91,7 @@ class CXFA_ImageLayoutData : public CXFA_WidgetLayoutData { return !!m_pDIBitmap; } - CFX_RetainPtr<CFX_DIBitmap> m_pDIBitmap; + RetainPtr<CFX_DIBitmap> m_pDIBitmap; bool m_bNamedImage; int32_t m_iImageXDpi; int32_t m_iImageYDpi; @@ -147,7 +147,7 @@ class CXFA_ImageEditData : public CXFA_FieldLayoutData { return !!m_pDIBitmap; } - CFX_RetainPtr<CFX_DIBitmap> m_pDIBitmap; + RetainPtr<CFX_DIBitmap> m_pDIBitmap; bool m_bNamedImage; int32_t m_iImageXDpi; int32_t m_iImageYDpi; @@ -919,7 +919,7 @@ bool CXFA_WidgetAcc::CalculateImageAutoSize(CFX_SizeF& size) { LoadImageImage(); size.clear(); - CFX_RetainPtr<CFX_DIBitmap> pBitmap = GetImageImage(); + RetainPtr<CFX_DIBitmap> pBitmap = GetImageImage(); if (pBitmap) { int32_t iImageXDpi = 0; int32_t iImageYDpi = 0; @@ -949,7 +949,7 @@ bool CXFA_WidgetAcc::CalculateImageEditAutoSize(CFX_SizeF& size) { LoadImageEditImage(); size.clear(); - CFX_RetainPtr<CFX_DIBitmap> pBitmap = GetImageEditImage(); + RetainPtr<CFX_DIBitmap> pBitmap = GetImageEditImage(); if (pBitmap) { int32_t iImageXDpi = 0; int32_t iImageYDpi = 0; @@ -1459,22 +1459,21 @@ CXFA_TextLayout* CXFA_WidgetAcc::GetTextLayout() { : nullptr; } -CFX_RetainPtr<CFX_DIBitmap> CXFA_WidgetAcc::GetImageImage() { +RetainPtr<CFX_DIBitmap> CXFA_WidgetAcc::GetImageImage() { return m_pLayoutData ? static_cast<CXFA_ImageLayoutData*>(m_pLayoutData.get()) ->m_pDIBitmap : nullptr; } -CFX_RetainPtr<CFX_DIBitmap> CXFA_WidgetAcc::GetImageEditImage() { +RetainPtr<CFX_DIBitmap> CXFA_WidgetAcc::GetImageEditImage() { return m_pLayoutData ? static_cast<CXFA_ImageEditData*>(m_pLayoutData.get()) ->m_pDIBitmap : nullptr; } -void CXFA_WidgetAcc::SetImageImage( - const CFX_RetainPtr<CFX_DIBitmap>& newImage) { +void CXFA_WidgetAcc::SetImageImage(const RetainPtr<CFX_DIBitmap>& newImage) { CXFA_ImageLayoutData* pData = static_cast<CXFA_ImageLayoutData*>(m_pLayoutData.get()); if (pData->m_pDIBitmap != newImage) @@ -1482,7 +1481,7 @@ void CXFA_WidgetAcc::SetImageImage( } void CXFA_WidgetAcc::SetImageEditImage( - const CFX_RetainPtr<CFX_DIBitmap>& newImage) { + const RetainPtr<CFX_DIBitmap>& newImage) { CXFA_ImageEditData* pData = static_cast<CXFA_ImageEditData*>(m_pLayoutData.get()); if (pData->m_pDIBitmap != newImage) @@ -1493,7 +1492,7 @@ CXFA_WidgetLayoutData* CXFA_WidgetAcc::GetWidgetLayoutData() { return m_pLayoutData.get(); } -CFX_RetainPtr<CFGAS_GEFont> CXFA_WidgetAcc::GetFDEFont() { +RetainPtr<CFGAS_GEFont> CXFA_WidgetAcc::GetFDEFont() { WideStringView wsFontName = L"Courier"; uint32_t dwFontStyle = 0; if (CXFA_Font font = GetFont(false)) { diff --git a/xfa/fxfa/cxfa_widgetacc.h b/xfa/fxfa/cxfa_widgetacc.h index 54fd36077d..be26b94806 100644 --- a/xfa/fxfa/cxfa_widgetacc.h +++ b/xfa/fxfa/cxfa_widgetacc.h @@ -9,8 +9,8 @@ #include <memory> -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_coordinates.h" +#include "core/fxcrt/retain_ptr.h" #include "core/fxge/dib/cfx_dibitmap.h" #include "core/fxge/fx_dib.h" #include "xfa/fxfa/parser/cxfa_box.h" @@ -70,14 +70,14 @@ class CXFA_WidgetAcc : public CXFA_WidgetData { void GetImageEditDpi(int32_t& iImageXDpi, int32_t& iImageYDpi); CXFA_TextLayout* GetCaptionTextLayout(); CXFA_TextLayout* GetTextLayout(); - CFX_RetainPtr<CFX_DIBitmap> GetImageImage(); - CFX_RetainPtr<CFX_DIBitmap> GetImageEditImage(); - void SetImageImage(const CFX_RetainPtr<CFX_DIBitmap>& newImage); - void SetImageEditImage(const CFX_RetainPtr<CFX_DIBitmap>& newImage); + RetainPtr<CFX_DIBitmap> GetImageImage(); + RetainPtr<CFX_DIBitmap> GetImageEditImage(); + void SetImageImage(const RetainPtr<CFX_DIBitmap>& newImage); + void SetImageEditImage(const RetainPtr<CFX_DIBitmap>& newImage); void UpdateUIDisplay(CXFA_FFWidget* pExcept = nullptr); CXFA_Node* GetDatasets(); - CFX_RetainPtr<CFGAS_GEFont> GetFDEFont(); + RetainPtr<CFGAS_GEFont> GetFDEFont(); float GetFontSize(); FX_ARGB GetTextColor(); float GetLineHeight(); diff --git a/xfa/fxfa/fm2js/cxfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/cxfa_fm2jscontext.cpp index 6af7bb7445..0b38fd1fab 100644 --- a/xfa/fxfa/fm2js/cxfa_fm2jscontext.cpp +++ b/xfa/fxfa/fm2js/cxfa_fm2jscontext.cpp @@ -4591,7 +4591,7 @@ void CXFA_FM2JSContext::Get(CFXJSE_Value* pThis, std::unique_ptr<CFXJSE_Value> argOne = GetSimpleValue(pThis, args, 0); ByteString urlString = ValueToUTF8String(argOne.get()); - CFX_RetainPtr<IFX_SeekableReadStream> pFile = + RetainPtr<IFX_SeekableReadStream> pFile = pAppProvider->DownloadURL(WideString::FromUTF8(urlString.AsStringView())); if (!pFile) return; diff --git a/xfa/fxfa/fxfa.h b/xfa/fxfa/fxfa.h index b8595d41dd..929594ff38 100644 --- a/xfa/fxfa/fxfa.h +++ b/xfa/fxfa/fxfa.h @@ -9,7 +9,7 @@ #include <vector> -#include "core/fxcrt/cfx_retain_ptr.h" +#include "core/fxcrt/retain_ptr.h" #include "xfa/fxfa/cxfa_widgetacc.h" #include "xfa/fxfa/fxfa_basic.h" @@ -170,7 +170,7 @@ class IXFA_AppProvider { * @param[in] wsURL - http, ftp, such as * "http://www.w3.org/TR/REC-xml-names/". */ - virtual CFX_RetainPtr<IFX_SeekableReadStream> DownloadURL( + virtual RetainPtr<IFX_SeekableReadStream> DownloadURL( const WideString& wsURL) = 0; /** @@ -259,7 +259,7 @@ class IXFA_DocEnvironment { virtual bool SetGlobalProperty(CXFA_FFDoc* hDoc, const ByteStringView& szPropName, CFXJSE_Value* pValue) = 0; - virtual CFX_RetainPtr<IFX_SeekableReadStream> OpenLinkedFile( + virtual RetainPtr<IFX_SeekableReadStream> OpenLinkedFile( CXFA_FFDoc* hDoc, const WideString& wsLink) = 0; }; diff --git a/xfa/fxfa/parser/cxfa_dataexporter.cpp b/xfa/fxfa/parser/cxfa_dataexporter.cpp index edc7b23b6b..b0de057e2a 100644 --- a/xfa/fxfa/parser/cxfa_dataexporter.cpp +++ b/xfa/fxfa/parser/cxfa_dataexporter.cpp @@ -328,7 +328,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode, void RegenerateFormFile_Container( CXFA_Node* pNode, - const CFX_RetainPtr<CFX_SeekableStreamProxy>& pStream, + const RetainPtr<CFX_SeekableStreamProxy>& pStream, bool bSaveXML) { XFA_Element eType = pNode->GetElementType(); if (eType == XFA_Element::Field || eType == XFA_Element::Draw || @@ -385,7 +385,7 @@ void RegenerateFormFile_Container( void XFA_DataExporter_RegenerateFormFile( CXFA_Node* pNode, - const CFX_RetainPtr<CFX_SeekableStreamProxy>& pStream, + const RetainPtr<CFX_SeekableStreamProxy>& pStream, const char* pChecksum, bool bSaveXML) { if (pNode->IsModelNode()) { @@ -460,12 +460,11 @@ CXFA_DataExporter::CXFA_DataExporter(CXFA_Document* pDocument) CXFA_DataExporter::~CXFA_DataExporter() {} -bool CXFA_DataExporter::Export( - const CFX_RetainPtr<IFX_SeekableStream>& pWrite) { +bool CXFA_DataExporter::Export(const RetainPtr<IFX_SeekableStream>& pWrite) { return Export(pWrite, m_pDocument->GetRoot(), 0, nullptr); } -bool CXFA_DataExporter::Export(const CFX_RetainPtr<IFX_SeekableStream>& pWrite, +bool CXFA_DataExporter::Export(const RetainPtr<IFX_SeekableStream>& pWrite, CXFA_Node* pNode, uint32_t dwFlag, const char* pChecksum) { @@ -479,7 +478,7 @@ bool CXFA_DataExporter::Export(const CFX_RetainPtr<IFX_SeekableStream>& pWrite, } bool CXFA_DataExporter::Export( - const CFX_RetainPtr<CFX_SeekableStreamProxy>& pStream, + const RetainPtr<CFX_SeekableStreamProxy>& pStream, CXFA_Node* pNode, uint32_t dwFlag, const char* pChecksum) { diff --git a/xfa/fxfa/parser/cxfa_dataexporter.h b/xfa/fxfa/parser/cxfa_dataexporter.h index 4c0d90af9e..0820560c87 100644 --- a/xfa/fxfa/parser/cxfa_dataexporter.h +++ b/xfa/fxfa/parser/cxfa_dataexporter.h @@ -7,8 +7,8 @@ #ifndef XFA_FXFA_PARSER_CXFA_DATAEXPORTER_H_ #define XFA_FXFA_PARSER_CXFA_DATAEXPORTER_H_ -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_string.h" +#include "core/fxcrt/retain_ptr.h" class CXFA_Document; class CXFA_Node; @@ -20,14 +20,14 @@ class CXFA_DataExporter { explicit CXFA_DataExporter(CXFA_Document* pDocument); ~CXFA_DataExporter(); - bool Export(const CFX_RetainPtr<IFX_SeekableStream>& pWrite); - bool Export(const CFX_RetainPtr<IFX_SeekableStream>& pWrite, + bool Export(const RetainPtr<IFX_SeekableStream>& pWrite); + bool Export(const RetainPtr<IFX_SeekableStream>& pWrite, CXFA_Node* pNode, uint32_t dwFlag, const char* pChecksum); private: - bool Export(const CFX_RetainPtr<CFX_SeekableStreamProxy>& pStream, + bool Export(const RetainPtr<CFX_SeekableStreamProxy>& pStream, CXFA_Node* pNode, uint32_t dwFlag, const char* pChecksum); diff --git a/xfa/fxfa/parser/cxfa_dataimporter.cpp b/xfa/fxfa/parser/cxfa_dataimporter.cpp index e4ae3d0796..ab18f6182d 100644 --- a/xfa/fxfa/parser/cxfa_dataimporter.cpp +++ b/xfa/fxfa/parser/cxfa_dataimporter.cpp @@ -25,7 +25,7 @@ CXFA_DataImporter::CXFA_DataImporter(CXFA_Document* pDocument) CXFA_DataImporter::~CXFA_DataImporter() {} bool CXFA_DataImporter::ImportData( - const CFX_RetainPtr<IFX_SeekableStream>& pDataDocument) { + const RetainPtr<IFX_SeekableStream>& pDataDocument) { auto pDataDocumentParser = pdfium::MakeUnique<CXFA_SimpleParser>(m_pDocument.Get(), false); if (pDataDocumentParser->StartParse(pDataDocument, XFA_XDPPACKET_Datasets) != diff --git a/xfa/fxfa/parser/cxfa_dataimporter.h b/xfa/fxfa/parser/cxfa_dataimporter.h index d3af1de517..dc7764ccad 100644 --- a/xfa/fxfa/parser/cxfa_dataimporter.h +++ b/xfa/fxfa/parser/cxfa_dataimporter.h @@ -7,9 +7,9 @@ #ifndef XFA_FXFA_PARSER_CXFA_DATAIMPORTER_H_ #define XFA_FXFA_PARSER_CXFA_DATAIMPORTER_H_ -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_system.h" +#include "core/fxcrt/retain_ptr.h" class CXFA_Document; class IFX_SeekableStream; @@ -19,7 +19,7 @@ class CXFA_DataImporter { explicit CXFA_DataImporter(CXFA_Document* pDocument); ~CXFA_DataImporter(); - bool ImportData(const CFX_RetainPtr<IFX_SeekableStream>& pDataDocument); + bool ImportData(const RetainPtr<IFX_SeekableStream>& pDataDocument); private: CFX_UnownedPtr<CXFA_Document> const m_pDocument; diff --git a/xfa/fxfa/parser/cxfa_document_parser.cpp b/xfa/fxfa/parser/cxfa_document_parser.cpp index 99b36749d1..b8ff8f860c 100644 --- a/xfa/fxfa/parser/cxfa_document_parser.cpp +++ b/xfa/fxfa/parser/cxfa_document_parser.cpp @@ -18,7 +18,7 @@ CXFA_DocumentParser::~CXFA_DocumentParser() { } int32_t CXFA_DocumentParser::StartParse( - const CFX_RetainPtr<IFX_SeekableStream>& pStream, + const RetainPtr<IFX_SeekableStream>& pStream, XFA_XDPPACKET ePacketID) { m_pDocument.reset(); m_nodeParser.CloseParser(); diff --git a/xfa/fxfa/parser/cxfa_document_parser.h b/xfa/fxfa/parser/cxfa_document_parser.h index ad3f17f8e8..e788480751 100644 --- a/xfa/fxfa/parser/cxfa_document_parser.h +++ b/xfa/fxfa/parser/cxfa_document_parser.h @@ -22,7 +22,7 @@ class CXFA_DocumentParser { explicit CXFA_DocumentParser(CXFA_FFNotify* pNotify); ~CXFA_DocumentParser(); - int32_t StartParse(const CFX_RetainPtr<IFX_SeekableStream>& pStream, + int32_t StartParse(const RetainPtr<IFX_SeekableStream>& pStream, XFA_XDPPACKET ePacketID); int32_t DoParse(); diff --git a/xfa/fxfa/parser/cxfa_simple_parser.cpp b/xfa/fxfa/parser/cxfa_simple_parser.cpp index 5b58761712..4574ae48d7 100644 --- a/xfa/fxfa/parser/cxfa_simple_parser.cpp +++ b/xfa/fxfa/parser/cxfa_simple_parser.cpp @@ -273,7 +273,7 @@ void CXFA_SimpleParser::SetFactory(CXFA_Document* pFactory) { } int32_t CXFA_SimpleParser::StartParse( - const CFX_RetainPtr<IFX_SeekableStream>& pStream, + const RetainPtr<IFX_SeekableStream>& pStream, XFA_XDPPACKET ePacketID) { CloseParser(); m_pFileRead = pStream; diff --git a/xfa/fxfa/parser/cxfa_simple_parser.h b/xfa/fxfa/parser/cxfa_simple_parser.h index 91bfb054b5..00250e7257 100644 --- a/xfa/fxfa/parser/cxfa_simple_parser.h +++ b/xfa/fxfa/parser/cxfa_simple_parser.h @@ -25,7 +25,7 @@ class CXFA_SimpleParser { CXFA_SimpleParser(CXFA_Document* pFactory, bool bDocumentParser); ~CXFA_SimpleParser(); - int32_t StartParse(const CFX_RetainPtr<IFX_SeekableStream>& pStream, + int32_t StartParse(const RetainPtr<IFX_SeekableStream>& pStream, XFA_XDPPACKET ePacketID); int32_t DoParse(); CFX_XMLNode* ParseXMLData(const ByteString& wsXML); @@ -77,8 +77,8 @@ class CXFA_SimpleParser { CFX_XMLParser* m_pXMLParser; std::unique_ptr<CFX_XMLDoc> m_pXMLDoc; - CFX_RetainPtr<CFX_SeekableStreamProxy> m_pStream; - CFX_RetainPtr<IFX_SeekableStream> m_pFileRead; + RetainPtr<CFX_SeekableStreamProxy> m_pStream; + RetainPtr<IFX_SeekableStream> m_pFileRead; CXFA_Document* m_pFactory; CXFA_Node* m_pRootNode; XFA_XDPPACKET m_ePacketID; diff --git a/xfa/fxfa/parser/xfa_utils.h b/xfa/fxfa/parser/xfa_utils.h index 404586bd56..b6839ef708 100644 --- a/xfa/fxfa/parser/xfa_utils.h +++ b/xfa/fxfa/parser/xfa_utils.h @@ -155,7 +155,7 @@ bool XFA_FieldIsMultiListBox(CXFA_Node* pFieldNode); void XFA_DataExporter_DealWithDataGroupNode(CXFA_Node* pDataNode); void XFA_DataExporter_RegenerateFormFile( CXFA_Node* pNode, - const CFX_RetainPtr<CFX_SeekableStreamProxy>& pStream, + const RetainPtr<CFX_SeekableStreamProxy>& pStream, const char* pChecksum = nullptr, bool bSaveXML = false); diff --git a/xfa/fxgraphics/cxfa_graphics.cpp b/xfa/fxgraphics/cxfa_graphics.cpp index a94e99e200..7cb83e10aa 100644 --- a/xfa/fxgraphics/cxfa_graphics.cpp +++ b/xfa/fxgraphics/cxfa_graphics.cpp @@ -194,7 +194,7 @@ void CXFA_Graphics::FillPath(CXFA_Path* path, RenderDeviceFillPath(path, fillMode, matrix); } -void CXFA_Graphics::StretchImage(const CFX_RetainPtr<CFX_DIBSource>& source, +void CXFA_Graphics::StretchImage(const RetainPtr<CFX_DIBSource>& source, const CFX_RectF& rect, const CFX_Matrix& matrix) { if (!source) @@ -305,14 +305,14 @@ void CXFA_Graphics::RenderDeviceFillPath(const CXFA_Path* path, } void CXFA_Graphics::RenderDeviceStretchImage( - const CFX_RetainPtr<CFX_DIBSource>& source, + const RetainPtr<CFX_DIBSource>& source, const CFX_RectF& rect, const CFX_Matrix& matrix) { CFX_Matrix m1(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, m_info.CTM.e, m_info.CTM.f); m1.Concat(matrix); - CFX_RetainPtr<CFX_DIBitmap> bmp1 = + RetainPtr<CFX_DIBitmap> bmp1 = source->StretchTo(static_cast<int32_t>(rect.Width()), static_cast<int32_t>(rect.Height()), 0, nullptr); CFX_Matrix m2(rect.Width(), 0.0, 0.0, rect.Height(), rect.left, rect.top); @@ -320,10 +320,10 @@ void CXFA_Graphics::RenderDeviceStretchImage( int32_t left; int32_t top; - CFX_RetainPtr<CFX_DIBitmap> bmp2 = bmp1->FlipImage(false, true); - CFX_RetainPtr<CFX_DIBitmap> bmp3 = bmp2->TransformTo(&m2, &left, &top); + RetainPtr<CFX_DIBitmap> bmp2 = bmp1->FlipImage(false, true); + RetainPtr<CFX_DIBitmap> bmp3 = bmp2->TransformTo(&m2, &left, &top); CFX_RectF r = GetClipRect(); - CFX_RetainPtr<CFX_DIBitmap> bitmap = m_renderDevice->GetBitmap(); + RetainPtr<CFX_DIBitmap> bitmap = m_renderDevice->GetBitmap(); bitmap->CompositeBitmap(FXSYS_round(r.left), FXSYS_round(r.top), FXSYS_round(r.Width()), FXSYS_round(r.Height()), bmp3, FXSYS_round(r.left - left), FXSYS_round(r.top - top)); @@ -333,7 +333,7 @@ void CXFA_Graphics::FillPathWithPattern(const CXFA_Path* path, FX_FillMode fillMode, const CFX_Matrix& matrix) { CXFA_Pattern* pattern = m_info.fillColor.GetPattern(); - CFX_RetainPtr<CFX_DIBitmap> bitmap = m_renderDevice->GetBitmap(); + RetainPtr<CFX_DIBitmap> bitmap = m_renderDevice->GetBitmap(); int32_t width = bitmap->GetWidth(); int32_t height = bitmap->GetHeight(); auto bmp = pdfium::MakeRetain<CFX_DIBitmap>(); @@ -366,7 +366,7 @@ void CXFA_Graphics::FillPathWithPattern(const CXFA_Path* path, void CXFA_Graphics::FillPathWithShading(const CXFA_Path* path, FX_FillMode fillMode, const CFX_Matrix& matrix) { - CFX_RetainPtr<CFX_DIBitmap> bitmap = m_renderDevice->GetBitmap(); + RetainPtr<CFX_DIBitmap> bitmap = m_renderDevice->GetBitmap(); int32_t width = bitmap->GetWidth(); int32_t height = bitmap->GetHeight(); float start_x = m_info.fillColor.GetShading()->m_beginPoint.x; @@ -481,9 +481,8 @@ void CXFA_Graphics::FillPathWithShading(const CXFA_Path* path, } } -void CXFA_Graphics::SetDIBitsWithMatrix( - const CFX_RetainPtr<CFX_DIBSource>& source, - const CFX_Matrix& matrix) { +void CXFA_Graphics::SetDIBitsWithMatrix(const RetainPtr<CFX_DIBSource>& source, + const CFX_Matrix& matrix) { if (matrix.IsIdentity()) { m_renderDevice->SetDIBits(source, 0, 0); } else { @@ -492,8 +491,8 @@ void CXFA_Graphics::SetDIBitsWithMatrix( m.Concat(matrix); int32_t left; int32_t top; - CFX_RetainPtr<CFX_DIBitmap> bmp1 = source->FlipImage(false, true); - CFX_RetainPtr<CFX_DIBitmap> bmp2 = bmp1->TransformTo(&m, &left, &top); + RetainPtr<CFX_DIBitmap> bmp1 = source->FlipImage(false, true); + RetainPtr<CFX_DIBitmap> bmp2 = bmp1->TransformTo(&m, &left, &top); m_renderDevice->SetDIBits(bmp2, left, top); } } diff --git a/xfa/fxgraphics/cxfa_graphics.h b/xfa/fxgraphics/cxfa_graphics.h index 99f86870c3..6b9dcb9a86 100644 --- a/xfa/fxgraphics/cxfa_graphics.h +++ b/xfa/fxgraphics/cxfa_graphics.h @@ -65,7 +65,7 @@ class CXFA_Graphics { void FillPath(CXFA_Path* path, FX_FillMode fillMode, const CFX_Matrix* matrix); - void StretchImage(const CFX_RetainPtr<CFX_DIBSource>& source, + void StretchImage(const RetainPtr<CFX_DIBSource>& source, const CFX_RectF& rect, const CFX_Matrix& matrix); void ConcatMatrix(const CFX_Matrix* matrix); @@ -91,7 +91,7 @@ class CXFA_Graphics { void RenderDeviceFillPath(const CXFA_Path* path, FX_FillMode fillMode, const CFX_Matrix* matrix); - void RenderDeviceStretchImage(const CFX_RetainPtr<CFX_DIBSource>& source, + void RenderDeviceStretchImage(const RetainPtr<CFX_DIBSource>& source, const CFX_RectF& rect, const CFX_Matrix& matrix); @@ -102,7 +102,7 @@ class CXFA_Graphics { FX_FillMode fillMode, const CFX_Matrix& matrix); - void SetDIBitsWithMatrix(const CFX_RetainPtr<CFX_DIBSource>& source, + void SetDIBitsWithMatrix(const RetainPtr<CFX_DIBSource>& source, const CFX_Matrix& matrix); CFX_RenderDevice* const m_renderDevice; // Not owned. |