[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - include/vcl svx/source vcl/source

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Tue Mar 26 10:21:42 UTC 2019


 include/vcl/graph.hxx           |    2 +-
 include/vcl/pdfread.hxx         |    8 +++-----
 svx/source/xoutdev/_xoutbmp.cxx |    4 ++--
 vcl/source/gdi/graph.cxx        |    2 +-
 4 files changed, 7 insertions(+), 9 deletions(-)

New commits:
commit d81dc3f780a1c059c4c4525435502731781233ed
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Wed Jun 6 00:51:10 2018 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Mar 26 11:21:18 2019 +0100

    vcl: svx: misc improvements to pdfium importing
    
    Change-Id: I58f2fd973a731b148f40b37139cd74bac097a7d2
    Reviewed-on: https://gerrit.libreoffice.org/69621
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx
index 72032931704b..45268462155a 100644
--- a/include/vcl/graph.hxx
+++ b/include/vcl/graph.hxx
@@ -229,7 +229,7 @@ public:
     const VectorGraphicDataPtr& getVectorGraphicData() const;
 
     void setPdfData(const std::shared_ptr<css::uno::Sequence<sal_Int8>>& rPdfData);
-    std::shared_ptr<css::uno::Sequence<sal_Int8>> getPdfData() const;
+    const std::shared_ptr<css::uno::Sequence<sal_Int8>>& getPdfData() const;
     bool hasPdfData() const;
 
     /// Set the page number of the multi-page source this Graphic is rendered from.
diff --git a/include/vcl/pdfread.hxx b/include/vcl/pdfread.hxx
index d239a087cf91..1a1ff0d680cb 100644
--- a/include/vcl/pdfread.hxx
+++ b/include/vcl/pdfread.hxx
@@ -10,15 +10,14 @@
 #ifndef INCLUDED_VCL_SOURCE_FILTER_IPDF_PDFREAD_HXX
 #define INCLUDED_VCL_SOURCE_FILTER_IPDF_PDFREAD_HXX
 
+#include <vector>
 #include <tools/stream.hxx>
 #include <vcl/graph.hxx>
 
 namespace vcl
 {
-
 /// Imports a PDF stream into rGraphic as a GDIMetaFile.
-VCL_DLLPUBLIC bool ImportPDF(SvStream& rStream, Bitmap& rBitmap,
-                             size_t nPageIndex,
+VCL_DLLPUBLIC bool ImportPDF(SvStream& rStream, Bitmap& rBitmap, size_t nPageIndex,
                              css::uno::Sequence<sal_Int8>& rPdfData,
                              sal_uInt64 nPos = STREAM_SEEK_TO_BEGIN,
                              sal_uInt64 nSize = STREAM_SEEK_TO_END,
@@ -27,8 +26,7 @@ VCL_DLLPUBLIC bool ImportPDF(SvStream& rStream, Bitmap& rBitmap,
 VCL_DLLPUBLIC bool ImportPDF(SvStream& rStream, Graphic& rGraphic,
                              const double fResolutionDPI = 96.);
 
-VCL_DLLPUBLIC size_t ImportPDF(const OUString& rURL,
-                               std::vector<Bitmap>& rBitmaps,
+VCL_DLLPUBLIC size_t ImportPDF(const OUString& rURL, std::vector<Bitmap>& rBitmaps,
                                css::uno::Sequence<sal_Int8>& rPdfData,
                                const double fResolutionDPI = 96.);
 }
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index 8e00f37959aa..3b7b5045b42b 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -192,8 +192,8 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName,
             SfxMedium aMedium(aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), StreamMode::WRITE|StreamMode::SHARE_DENYNONE|StreamMode::TRUNC);
             if (SvStream* pOutStream = aMedium.GetOutStream())
             {
-                std::shared_ptr<uno::Sequence<sal_Int8>> pPdfData = rGraphic.getPdfData();
-                pOutStream->WriteBytes(pPdfData->getConstArray(), pPdfData->getLength());
+                const std::shared_ptr<uno::Sequence<sal_Int8>>& rPdfData = rGraphic.getPdfData();
+                pOutStream->WriteBytes(rPdfData->getConstArray(), rPdfData->getLength());
                 aMedium.Commit();
                 if (!aMedium.GetError())
                     nErr = ERRCODE_NONE;
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 73f623071a74..1fc7897ac90b 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -611,7 +611,7 @@ void Graphic::setPdfData(const std::shared_ptr<uno::Sequence<sal_Int8>>& rPdfDat
     mxImpGraphic->setPdfData(rPdfData);
 }
 
-std::shared_ptr<uno::Sequence<sal_Int8>> Graphic::getPdfData() const
+const std::shared_ptr<uno::Sequence<sal_Int8>>& Graphic::getPdfData() const
 {
     return mxImpGraphic->getPdfData();
 }


More information about the Libreoffice-commits mailing list