summaryrefslogtreecommitdiff
path: root/vcl/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-04-11 17:39:10 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-04-11 20:34:50 +0200
commit54a4121f2040bd11f3d6056767f2d7ad6c7745ac (patch)
tree66d5d8ce38438d7fcd8cad5ec154de8792118844 /vcl/qa
parentaa4e06c67dbe414ae26b757d6968eb27b5ebeb99 (diff)
PDF export of PDF images: compress page stream if requested
compressStream() automatically takes care of VCL_DEBUG_DISABLE_PDFCOMPRESSION, so this also simplifies code. Change-Id: I7661123e6ba73f8f064ec0543a03e2ec15fd2468 Reviewed-on: https://gerrit.libreoffice.org/36415 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'vcl/qa')
-rw-r--r--vcl/qa/cppunit/pdfexport/pdfexport.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 76cad0f2a9af..36b5134bdaf3 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -481,10 +481,16 @@ void PdfExportTest::testTdf107089()
// Make sure 'Hello' is part of the form object's stream.
vcl::filter::PDFStreamElement* pStream = pForm->GetStream();
CPPUNIT_ASSERT(pStream);
- SvMemoryStream& rObjectStream = pStream->GetMemory();
+ SvMemoryStream aObjectStream;
+ ZCodec aZCodec;
+ aZCodec.BeginCompression();
+ pStream->GetMemory().Seek(0);
+ aZCodec.Decompress(pStream->GetMemory(), aObjectStream);
+ CPPUNIT_ASSERT(aZCodec.EndCompression());
+ aObjectStream.Seek(0);
OString aHello("Hello");
- auto pStart = static_cast<const char*>(rObjectStream.GetData());
- const char* pEnd = pStart + rObjectStream.GetSize();
+ auto pStart = static_cast<const char*>(aObjectStream.GetData());
+ const char* pEnd = pStart + aObjectStream.GetSize();
auto it = std::search(pStart, pEnd, aHello.getStr(), aHello.getStr() + aHello.getLength());
// This failed, 'Hello' was part only a mixed compressed/uncompressed stream, i.e. garbage.
CPPUNIT_ASSERT(it != pEnd);