include/vcl/graph.hxx | 1 + sd/qa/unit/data/pdf/multipage.pdf |binary sd/qa/unit/import-tests.cxx | 11 +++++++++-- vcl/inc/impgraph.hxx | 1 + vcl/source/gdi/graph.cxx | 5 +++++ vcl/source/gdi/impgraph.cxx | 5 +++++ 6 files changed, 21 insertions(+), 2 deletions(-)
New commits: commit a81e009846058918046ea8f89b8b403db79d5dc7 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> AuthorDate: Tue Apr 2 11:32:42 2019 -0400 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Mon Mar 23 17:18:28 2020 +0100 sd: unit-test to check that PDF stream is shared among Graphic instances Reviewed-on: https://gerrit.libreoffice.org/70162 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> (cherry picked from commit d3a9bdd982ad1ed17cb6fef91885fc4dcf442fdb) Reviewed-on: https://gerrit.libreoffice.org/77693 Tested-by: Jenkins Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> (cherry picked from commit 5a3f794219dade812ec29ea9971680058b4bade9) Change-Id: Iebd85e5e60c76e6d0756d15e1fa6107a3fcc837d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90845 Tested-by: Tomaž Vajngerl <qui...@gmail.com> Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx index af77fc9cad1f..5f80a8c4ccd3 100644 --- a/include/vcl/graph.hxx +++ b/include/vcl/graph.hxx @@ -215,6 +215,7 @@ private: public: void SetGfxLink(const std::shared_ptr<GfxLink>& rGfxLink); + std::shared_ptr<GfxLink> GetSharedGfxLink() const; GfxLink GetGfxLink() const; bool IsGfxLink() const; diff --git a/sd/qa/unit/data/pdf/multipage.pdf b/sd/qa/unit/data/pdf/multipage.pdf new file mode 100644 index 000000000000..5cd8b4e4e569 Binary files /dev/null and b/sd/qa/unit/data/pdf/multipage.pdf differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 69a945281e95..615ee2736d4e 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -82,6 +82,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/graphicmimetype.hxx> +#include <comphelper/lok.hxx> #include <vcl/pngread.hxx> #include <vcl/bitmapaccess.hxx> #include <vcl/dibtools.hxx> @@ -140,9 +141,12 @@ public: void testTableBorderLineStyle(); void testBnc862510_6(); void testBnc862510_7(); -#if ENABLE_PDFIMPORT && defined(IMPORT_PDF_ELEMENTS) +#if ENABLE_PDFIMPORT + void testPDFImportShared(); +#if defined(IMPORT_PDF_ELEMENTS) void testPDFImport(); void testPDFImportSkipImages(); +#endif #endif void testBulletSuffix(); void testBnc910045(); @@ -232,9 +236,12 @@ public: CPPUNIT_TEST(testTableBorderLineStyle); CPPUNIT_TEST(testBnc862510_6); CPPUNIT_TEST(testBnc862510_7); -#if ENABLE_PDFIMPORT && defined(IMPORT_PDF_ELEMENTS) +#if ENABLE_PDFIMPORT + CPPUNIT_TEST(testPDFImportShared); +#if defined(IMPORT_PDF_ELEMENTS) CPPUNIT_TEST(testPDFImport); CPPUNIT_TEST(testPDFImportSkipImages); +#endif #endif CPPUNIT_TEST(testBulletSuffix); CPPUNIT_TEST(testBnc910045); diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index c01b28334ce5..4b13463c949f 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -199,6 +199,7 @@ private: bool ImplIsSwapOut() const { return mbSwapOut;} bool ImplIsDummyContext() const { return mbDummyContext; } void ImplSetLink( const std::shared_ptr<GfxLink>& ); + std::shared_ptr<GfxLink> ImplGetSharedGfxLink() const; GfxLink ImplGetLink(); bool ImplIsLink() const; diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index 0599091f8996..421ef1a0b09e 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -534,6 +534,11 @@ void Graphic::SetGfxLink( const std::shared_ptr<GfxLink>& rGfxLink ) mxImpGraphic->ImplSetLink( rGfxLink ); } +std::shared_ptr<GfxLink> Graphic::GetSharedGfxLink() const +{ + return mxImpGraphic->ImplGetSharedGfxLink(); +} + GfxLink Graphic::GetGfxLink() const { return mxImpGraphic->ImplGetLink(); diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index c700358312c5..e885e2a103e5 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -1620,6 +1620,11 @@ void ImpGraphic::ImplSetLink(const std::shared_ptr<GfxLink>& rGfxLink) mpGfxLink->SwapOut(); } +std::shared_ptr<GfxLink> ImpGraphic::ImplGetSharedGfxLink() const +{ + return mpGfxLink; +} + GfxLink ImpGraphic::ImplGetLink() { ensureAvailable(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits