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

Jan Holesovsky (via logerrit) logerrit at kemper.freedesktop.org
Sun Aug 25 11:44:12 UTC 2019


 include/svx/svdograf.hxx        |    2 +-
 include/vcl/graph.hxx           |    2 +-
 svx/source/svdraw/svdograf.cxx  |    2 +-
 svx/source/xml/xmlgrhlp.cxx     |    2 +-
 svx/source/xoutdev/_xoutbmp.cxx |    2 +-
 vcl/inc/impgraph.hxx            |    2 +-
 vcl/source/gdi/graph.cxx        |    4 ++--
 vcl/source/gdi/impgraph.cxx     |    2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 5c5ab9c1291235671261db39503e239117a952dd
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Tue Apr 2 23:03:01 2019 +0200
Commit:     Ashod Nakashian <ashnakash at gmail.com>
CommitDate: Sun Aug 25 13:42:52 2019 +0200

    pdfium: Returning a const std::shared_ptr<...>& is not recommended.
    
    Change-Id: Iff6acef712c5b95c8cc222fc5293c9304b1c03ec
    (cherry picked from commit c0a3f61ef5c42d6cfa7484a2c759e7638da2c096)
    Reviewed-on: https://gerrit.libreoffice.org/77692
    Tested-by: Jenkins
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx
index 02bcc83357fd..a61144ced8d3 100644
--- a/include/svx/svdograf.hxx
+++ b/include/svx/svdograf.hxx
@@ -202,7 +202,7 @@ public:
     GDIMetaFile getMetafileFromEmbeddedVectorGraphicData() const;
 
     bool isEmbeddedPdfData() const;
-    std::shared_ptr<std::vector<sal_Int8>> const & getEmbeddedPdfData() const;
+    std::shared_ptr<std::vector<sal_Int8>> const getEmbeddedPdfData() const;
     /// Returns the page number of the embedded data (typically to re-render or import it).
     sal_Int32 getEmbeddedPageNumber() const;
 
diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx
index 91371a82beeb..b7cd1eb10438 100644
--- a/include/vcl/graph.hxx
+++ b/include/vcl/graph.hxx
@@ -224,7 +224,7 @@ public:
     const VectorGraphicDataPtr& getVectorGraphicData() const;
 
     void setPdfData(const std::shared_ptr<std::vector<sal_Int8>>& rPdfData);
-    const std::shared_ptr<std::vector<sal_Int8>>& getPdfData() const;
+    std::shared_ptr<std::vector<sal_Int8>> getPdfData() const;
     bool hasPdfData() const;
 
     /// Set the page number of the multi-page source this Graphic is rendered from.
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 8ac19ae1525a..a51758add1f0 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -907,7 +907,7 @@ bool SdrGrafObj::isEmbeddedPdfData() const
    return mpGraphicObject->GetGraphic().hasPdfData();
 }
 
-std::shared_ptr<std::vector<sal_Int8>> const & SdrGrafObj::getEmbeddedPdfData() const
+std::shared_ptr<std::vector<sal_Int8>> const SdrGrafObj::getEmbeddedPdfData() const
 {
    return mpGraphicObject->GetGraphic().getPdfData();
 }
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 1c64d13566d6..cf16f49be84c 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -760,7 +760,7 @@ OUString SvXMLGraphicHelper::implSaveGraphic(css::uno::Reference<css::graphic::X
             std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(aStream.xStream));
             if (bUseGfxLink && aGfxLink.GetDataSize() && aGfxLink.GetData())
             {
-                const std::shared_ptr<std::vector<sal_Int8>>& rPdfData = aGraphic.getPdfData();
+                const std::shared_ptr<std::vector<sal_Int8>> rPdfData = aGraphic.getPdfData();
                 if (rPdfData && !rPdfData->empty())
                 {
                     // See if we have this PDF already, and avoid duplicate storage.
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index 6aeca72a6eb1..f55d3ffa0f57 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -185,7 +185,7 @@ 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())
             {
-                const std::shared_ptr<std::vector<sal_Int8>>& rPdfData = rGraphic.getPdfData();
+                const std::shared_ptr<std::vector<sal_Int8>> rPdfData(rGraphic.getPdfData());
                 pOutStream->WriteBytes(rPdfData->data(), rPdfData->size());
                 aMedium.Commit();
                 if (!aMedium.GetError())
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index 1a1d2f283f1c..e34cbedffddc 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -227,7 +227,7 @@ private:
 
     const VectorGraphicDataPtr& getVectorGraphicData() const;
 
-    const std::shared_ptr<std::vector<sal_Int8>>& getPdfData() const;
+    std::shared_ptr<std::vector<sal_Int8>> getPdfData() const;
 
     void setPdfData(const std::shared_ptr<std::vector<sal_Int8>>& rPdfData);
 
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 5159145cb055..a106eccb2910 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -553,14 +553,14 @@ void Graphic::setPdfData(const std::shared_ptr<std::vector<sal_Int8>>& rPdfData)
     mxImpGraphic->setPdfData(rPdfData);
 }
 
-const std::shared_ptr<std::vector<sal_Int8>>& Graphic::getPdfData() const
+std::shared_ptr<std::vector<sal_Int8>> Graphic::getPdfData() const
 {
     return mxImpGraphic->getPdfData();
 }
 
 bool Graphic::hasPdfData() const
 {
-    std::shared_ptr<std::vector<sal_Int8>> pPdfData = getPdfData();
+    std::shared_ptr<std::vector<sal_Int8>> pPdfData(getPdfData());
     return pPdfData && !pPdfData->empty();
 }
 
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 8a1936020051..904ef2677e37 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -477,7 +477,7 @@ void ImpGraphic::setPdfData(const std::shared_ptr<std::vector<sal_Int8>>& rPdfDa
     mpPdfData = rPdfData;
 }
 
-const std::shared_ptr<std::vector<sal_Int8>>& ImpGraphic::getPdfData() const
+std::shared_ptr<std::vector<sal_Int8>> ImpGraphic::getPdfData() const
 {
     ensureAvailable();
 


More information about the Libreoffice-commits mailing list