diff options
author | Jan Holesovsky <kendy@collabora.com> | 2019-04-02 23:07:59 +0200 |
---|---|---|
committer | Ashod Nakashian <ashnakash@gmail.com> | 2019-08-26 14:38:34 +0200 |
commit | 254fd20dd5cb8206c7eac19f11dec0369c12d366 (patch) | |
tree | 5c053dcb2bc11f8cfcbd2d5269ed8c8ee8ef8d8f /vcl/source/gdi | |
parent | 77f633a9a10ef3847643c85503e16427a137291d (diff) |
Embedded PDF: It is a shared_ptr, no need to copy.
Change-Id: Iedb31bbe0e81dc9568e84858d8d26eac03c47ffb
Reviewed-on: https://gerrit.libreoffice.org/70208
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit ff2c5e766517bbc23409f04335c418bb6fcad6eb)
Reviewed-on: https://gerrit.libreoffice.org/77694
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.hxx | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index dc9e4f249b6a..cb7070c78021 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -4516,12 +4516,12 @@ bool PDFWriterImpl::emitEmbeddedFiles() aLine.append(rEmbeddedFile.m_nObject); aLine.append(" 0 obj\n"); aLine.append("<< /Type /EmbeddedFile /Length "); - aLine.append(static_cast<sal_Int64>(rEmbeddedFile.m_aData.size())); + aLine.append(static_cast<sal_Int64>(rEmbeddedFile.m_pData->size())); aLine.append(" >>\nstream\n"); CHECK_RETURN(writeBuffer(aLine.getStr(), aLine.getLength())); aLine.setLength(0); - CHECK_RETURN(writeBuffer(rEmbeddedFile.m_aData.data(), rEmbeddedFile.m_aData.size())); + CHECK_RETURN(writeBuffer(rEmbeddedFile.m_pData->data(), rEmbeddedFile.m_pData->size())); aLine.append("\nendstream\nendobj\n\n"); CHECK_RETURN(writeBuffer(aLine.getStr(), aLine.getLength())); @@ -9347,7 +9347,7 @@ void PDFWriterImpl::createEmbeddedFile(const Graphic& rGraphic, ReferenceXObject // Store the original PDF data as an embedded file. m_aEmbeddedFiles.emplace_back(); m_aEmbeddedFiles.back().m_nObject = createObject(); - m_aEmbeddedFiles.back().m_aData = *rGraphic.getPdfData(); + m_aEmbeddedFiles.back().m_pData = rGraphic.getPdfData(); rEmit.m_nEmbeddedObject = m_aEmbeddedFiles.back().m_nObject; } diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index 68d2cbce80e9..7e07d9e0d472 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -423,7 +423,7 @@ public: /// ID of the file. sal_Int32 m_nObject; /// Contents of the file. - std::vector<sal_Int8> m_aData; + std::shared_ptr<std::vector<sal_Int8>> m_pData; PDFEmbeddedFile() : m_nObject(0) |