include/vcl/embeddedfontshelper.hxx | 9 --------- vcl/source/gdi/embeddedfontshelper.cxx | 9 ++------- 2 files changed, 2 insertions(+), 16 deletions(-)
New commits: commit 999355dad717dc1d18a8ce115845e7265b8126b5 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Fri Aug 1 13:53:03 2025 +0500 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Fri Aug 1 20:35:52 2025 +0200 Inline EmbeddedFontsHelper::activateFont It is trivial, and used in only one place Change-Id: I8d72ba525b76368fe6b24fb0c097e777c19a9ed9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188748 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/include/vcl/embeddedfontshelper.hxx b/include/vcl/embeddedfontshelper.hxx index 6082144a3c30..e61d0823a05b 100644 --- a/include/vcl/embeddedfontshelper.hxx +++ b/include/vcl/embeddedfontshelper.hxx @@ -28,15 +28,6 @@ class VCL_DLLPUBLIC EmbeddedFontsHelper private: std::vector<std::pair<OUString, OUString>> m_aAccumulatedFonts; - /** - Adds the given font to the list of known fonts. The font is used only until application - exit. - - @param fontName name of the font (e.g. 'Times New Roman') - @param fileUrl URL of the font file - */ - static void activateFont( const OUString& fontName, const OUString& fileUrl ); - public: /// Specification of what kind of operation is allowed when embedding a font enum class FontRights diff --git a/vcl/source/gdi/embeddedfontshelper.cxx b/vcl/source/gdi/embeddedfontshelper.cxx index e30244ce0a33..3a2191dfa8a2 100644 --- a/vcl/source/gdi/embeddedfontshelper.cxx +++ b/vcl/source/gdi/embeddedfontshelper.cxx @@ -219,8 +219,9 @@ void EmbeddedFontsHelper::activateFonts() if (m_aAccumulatedFonts.empty()) return; UpdateFontsGuard aUpdateFontsGuard; + OutputDevice *pDevice = Application::GetDefaultDevice(); for (const auto& rEntry : m_aAccumulatedFonts) - EmbeddedFontsHelper::activateFont(rEntry.first, rEntry.second); + pDevice->AddTempDevFont(rEntry.second, rEntry.first); m_aAccumulatedFonts.clear(); } @@ -247,12 +248,6 @@ OUString EmbeddedFontsHelper::fileUrlForTemporaryFont( const OUString& fontName, return path + filename; } -void EmbeddedFontsHelper::activateFont( const OUString& fontName, const OUString& fileUrl ) -{ - OutputDevice *pDevice = Application::GetDefaultDevice(); - pDevice->AddTempDevFont(fileUrl, fontName); -} - // Check if it's (legally) allowed to embed the font file into a document // (ttf has a flag allowing this). PhysicalFontFace::IsEmbeddable() appears // to have a different meaning (guessing from code, IsSubsettable() might