summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2019-04-02 23:03:01 +0200
committerAshod Nakashian <ashnakash@gmail.com>2019-08-25 13:42:52 +0200
commit5c5ab9c1291235671261db39503e239117a952dd (patch)
treebe4d05f4be8a90e2b39786ccd8a5a7e09612c6fc /vcl
parenteb581eff6ac41b938299b4c154ded6891bdd0c11 (diff)
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@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/impgraph.hxx2
-rw-r--r--vcl/source/gdi/graph.cxx4
-rw-r--r--vcl/source/gdi/impgraph.cxx2
3 files changed, 4 insertions, 4 deletions
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();