diff options
author | Tobias Hoffmann <thobi@worker> | 2012-06-27 06:00:58 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2012-06-27 16:19:57 +0200 |
commit | 43c404b45ab54583a33492adc93f54fa349c2f94 (patch) | |
tree | da195c74239078c5a52b3f7be4c2477d6eea9f0b /qpdf/test_large_file.cc | |
parent | 75054c0b9404572f2c1477858fe47a61404b72f5 (diff) | |
download | qpdf-43c404b45ab54583a33492adc93f54fa349c2f94.tar.zst |
Add QPDFObjectHandle::newStream(QPDF *, std::string const&)
This makes the code simpler than having to create a buffer of a fixed
size and copy the string to it.
Diffstat (limited to 'qpdf/test_large_file.cc')
-rw-r--r-- | qpdf/test_large_file.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/qpdf/test_large_file.cc b/qpdf/test_large_file.cc index ec346514..fc2c7bbc 100644 --- a/qpdf/test_large_file.cc +++ b/qpdf/test_large_file.cc @@ -173,11 +173,7 @@ std::string generate_page_contents(int pageno) static QPDFObjectHandle create_page_contents(QPDF& pdf, int pageno) { - std::string contents = generate_page_contents(pageno); - PointerHolder<Buffer> b = new Buffer(contents.length()); - unsigned char* bp = b->getBuffer(); - memcpy(bp, (char*)contents.c_str(), contents.length()); - return QPDFObjectHandle::newStream(&pdf, b); + return QPDFObjectHandle::newStream(&pdf, generate_page_contents(pageno)); } QPDFObjectHandle newName(std::string const& name) |