From f6893242148460170253ef0ae51a6cd4b5ec8f95 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Wed, 25 Jul 2012 22:32:14 -0400 Subject: Restore coverage case Previous commit lost coverage case for buffer-based replaceStreamData. --- examples/pdf-double-page-size.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'examples') diff --git a/examples/pdf-double-page-size.cc b/examples/pdf-double-page-size.cc index c2eb48a3..8a1867aa 100644 --- a/examples/pdf-double-page-size.cc +++ b/examples/pdf-double-page-size.cc @@ -61,12 +61,7 @@ int main(int argc, char* argv[]) char const* password = (argc == 4) ? argv[3] : ""; // Text to prepend to each page's contents - char const* content = "2 0 0 2 0 0 cm\n"; - - // Copy text into a buffer without the null terminator - PointerHolder b = new Buffer(strlen(content)); - unsigned char* bp = b->getBuffer(); - memcpy(bp, (unsigned char*)content, strlen(content)); + std::string content = "2 0 0 2 0 0 cm\n"; try { @@ -80,7 +75,8 @@ int main(int argc, char* argv[]) QPDFObjectHandle& page = *iter; // Prepend the buffer to the page's contents - page.addPageContents(QPDFObjectHandle::newStream(&qpdf, b), true); + page.addPageContents( + QPDFObjectHandle::newStream(&qpdf, content), true); // Double the size of each of the content boxes doubleBoxSize(page, "/MediaBox"); -- cgit v1.2.3-54-g00ecf