[Libreoffice-commits] core.git: vcl/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 26 08:42:13 UTC 2019


 vcl/source/filter/ipdf/pdfread.cxx |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit 28bf81694aaeacd260a3b7d8ba2f6be172eb08c3
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Aug 26 10:40:31 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Aug 26 10:40:31 2019 +0200

    vcl: fix --disable-pdfium build
    
    Which is not covered by Jenkins, but used implicitly by the Android
    build e.g.
    
    Change-Id: Id1ffab54a619fc94bcc3d8bea9eba6301d3d7381

diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx
index bd406deac93e..80557c1091e2 100644
--- a/vcl/source/filter/ipdf/pdfread.cxx
+++ b/vcl/source/filter/ipdf/pdfread.cxx
@@ -153,6 +153,7 @@ namespace vcl
 size_t RenderPDFBitmaps(const void* pBuffer, int nSize, std::vector<Bitmap>& rBitmaps,
                         const size_t nFirstPage, int nPages, const double fResolutionDPI)
 {
+#if HAVE_FEATURE_PDFIUM
     FPDF_LIBRARY_CONFIG aConfig;
     aConfig.version = 2;
     aConfig.m_pUserFontPaths = nullptr;
@@ -211,6 +212,15 @@ size_t RenderPDFBitmaps(const void* pBuffer, int nSize, std::vector<Bitmap>& rBi
     FPDF_DestroyLibrary();
 
     return rBitmaps.size();
+#else
+    (void)pBuffer;
+    (void)nSize;
+    (void)rBitmaps;
+    (void)nFirstPage;
+    (void)nPages;
+    (void)fResolutionDPI;
+    return 0;
+#endif // HAVE_FEATURE_PDFIUM
 }
 
 bool ImportPDF(SvStream& rStream, Bitmap& rBitmap, size_t nPageIndex,
@@ -275,6 +285,7 @@ size_t ImportPDF(const OUString& rURL, std::vector<Bitmap>& rBitmaps,
 size_t ImportPDFUnloaded(const OUString& rURL, std::vector<std::pair<Graphic, Size>>& rGraphics,
                          const double fResolutionDPI)
 {
+#if HAVE_FEATURE_PDFIUM
     std::unique_ptr<SvStream> xStream(
         ::utl::UcbStreamHelper::CreateStream(rURL, StreamMode::READ | StreamMode::SHARE_DENYNONE));
 
@@ -342,6 +353,12 @@ size_t ImportPDFUnloaded(const OUString& rURL, std::vector<std::pair<Graphic, Si
     FPDF_DestroyLibrary();
 
     return rGraphics.size();
+#else
+    (void)rURL;
+    (void)rGraphics;
+    (void)fResolutionDPI;
+    return 0;
+#endif // HAVE_FEATURE_PDFIUM
 }
 }
 


More information about the Libreoffice-commits mailing list