include/vcl/embeddedfontsmanager.hxx | 3 +++ svx/source/inc/svdpdf.hxx | 5 +++++ svx/source/svdraw/svdpdf.cxx | 11 +++++++++++ vcl/source/gdi/embeddedfontsafdko.cxx | 8 ++++++++ 4 files changed, 27 insertions(+)
New commits: commit 71ba3817eb8cf2ac55b5c726b1c14e6e7cd597f1 Author: Stephan Bergmann <[email protected]> AuthorDate: Tue Sep 30 15:54:19 2025 +0200 Commit: Stephan Bergmann <[email protected]> CommitDate: Tue Sep 30 17:10:16 2025 +0200 Fix --disable-pdfimport builds ...like the Emscripten one, which started to fail with > In file included from vcl/source/gdi/embeddedfontsafdko.cxx:18: > vcl/source/gdi/afdko.hxx:18:10: fatal error: 'tx_shared.h' file not found > 18 | #include <tx_shared.h> > | ^~~~~~~~~~~~~ after fe9e639b38e6b6a07e0a37e215d1fc75e62e537b "add apis for font format conversion and merging" Change-Id: Ida6d97dbb1ab5ddc204e0421736d9ecf06c98a2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191669 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/include/vcl/embeddedfontsmanager.hxx b/include/vcl/embeddedfontsmanager.hxx index c502146631fa..069aaca80585 100644 --- a/include/vcl/embeddedfontsmanager.hxx +++ b/include/vcl/embeddedfontsmanager.hxx @@ -13,6 +13,7 @@ #include <com/sun/star/uno/Reference.hxx> +#include <config_features.h> #include <rtl/ustring.hxx> #include <tools/fontenum.hxx> #include <tools/long.hxx> @@ -126,6 +127,7 @@ public: static OUString getFileUrlForTemporaryFont(std::u16string_view name, std::u16string_view suffix); +#if HAVE_FEATURE_PDFIMPORT // write text dump static bool tx_dump(const OUString& srcFontUrl, const OUString& destFileUrl); // write Type 1 font @@ -138,6 +140,7 @@ public: static bool makeotf(const OUString& srcFontUrl, const OUString& destFileUrl, const OUString& fontMenuNameDBUrl, const OUString& charMapUrl, const OUString& featuresUrl); +#endif }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/inc/svdpdf.hxx b/svx/source/inc/svdpdf.hxx index ffc080752fb1..3a98846da494 100644 --- a/svx/source/inc/svdpdf.hxx +++ b/svx/source/inc/svdpdf.hxx @@ -25,6 +25,7 @@ #include <memory> #include <map> +#include <config_features.h> #include <tools/fract.hxx> #include <vcl/virdev.hxx> #include <vcl/graph.hxx> @@ -170,6 +171,8 @@ class ImpSdrPdfImport final void DoObjects(SvdProgressInfo* pProgrInfo, sal_uInt32* pActionsToReport, int nPageIndex); +#if HAVE_FEATURE_PDFIMPORT + void CollectFonts(); static EmbeddedFontInfo convertToOTF(SubSetInfo& rSubSetInfo, const OUString& fileUrl, @@ -177,6 +180,8 @@ class ImpSdrPdfImport final std::u16string_view fontFileName, const std::vector<uint8_t>& toUnicodeData); +#endif + // Copy assignment is forbidden and not implemented. ImpSdrPdfImport(const ImpSdrPdfImport&) = delete; ImpSdrPdfImport& operator=(const ImpSdrPdfImport&) = delete; diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index d9da0ba88ed1..f0983375045d 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -19,6 +19,7 @@ #include <svdpdf.hxx> +#include <config_features.h> #include <tools/UnitConversion.hxx> #include <vcl/embeddedfontsmanager.hxx> #include <vcl/graph.hxx> @@ -117,7 +118,9 @@ ImpSdrPdfImport::ImpSdrPdfImport(SdrModel& rModel, SdrLayerID nLay, const tools: mnPageCount = mpPdfDocument->getPageCount(); +#if HAVE_FEATURE_PDFIMPORT CollectFonts(); +#endif // Same as SdModule mpVD = VclPtr<VirtualDevice>::Create(); @@ -138,6 +141,8 @@ ImpSdrPdfImport::ImpSdrPdfImport(SdrModel& rModel, SdrLayerID nLay, const tools: ImpSdrPdfImport::~ImpSdrPdfImport() = default; +#if HAVE_FEATURE_PDFIMPORT + namespace { OUString GetPostScriptName(const OUString& rBaseFontName) @@ -302,6 +307,8 @@ void ImpSdrPdfImport::CollectFonts() } } +#endif + void ImpSdrPdfImport::DoObjects(SvdProgressInfo* pProgrInfo, sal_uInt32* pActionsToReport, int nPageIndex) { @@ -876,6 +883,8 @@ void ImpSdrPdfImport::ImportForm(std::unique_ptr<vcl::pdf::PDFiumPageObject> con maCurrentMatrix = aOldMatrix; } +#if HAVE_FEATURE_PDFIMPORT + static bool extractEntry(std::string_view line, std::string_view key, OString& ret) { std::string_view result; @@ -1441,6 +1450,8 @@ EmbeddedFontInfo ImpSdrPdfImport::convertToOTF(SubSetInfo& rSubSetInfo, const OU return EmbeddedFontInfo(); } +#endif + void ImpSdrPdfImport::ImportText(std::unique_ptr<vcl::pdf::PDFiumPageObject> const& pPageObject, std::unique_ptr<vcl::pdf::PDFiumTextPage> const& pTextPage, int /*nPageObjectIndex*/) diff --git a/vcl/source/gdi/embeddedfontsafdko.cxx b/vcl/source/gdi/embeddedfontsafdko.cxx index cbac66a0aa38..ca274acb6327 100644 --- a/vcl/source/gdi/embeddedfontsafdko.cxx +++ b/vcl/source/gdi/embeddedfontsafdko.cxx @@ -13,6 +13,12 @@ * This license is available at: http://opensource.org/licenses/Apache-2.0. */ +#include <sal/config.h> + +#include <config_features.h> + +#if HAVE_FEATURE_PDFIMPORT + #include <vcl/embeddedfontsmanager.hxx> #include <osl/file.hxx> #include "afdko.hxx" @@ -237,4 +243,6 @@ bool EmbeddedFontsManager::makeotf(const OUString& srcFontUrl, const OUString& d return true; } +#endif + /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
