From f62bec3ee53a377548ec197423efc20d4f4dc206 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Mon, 9 Mar 2009 16:27:13 +0000 Subject: update test suite to handle original object ID comments git-svn-id: svn+q:///qpdf/trunk@663 71b93d88-0707-0410-a8cf-f5a4172ac649 --- libqpdf/QPDFWriter.cc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'libqpdf/QPDFWriter.cc') diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc index 18f420b5..acaf52a8 100644 --- a/libqpdf/QPDFWriter.cc +++ b/libqpdf/QPDFWriter.cc @@ -32,6 +32,7 @@ QPDFWriter::QPDFWriter(QPDF& pdf, char const* filename) : stream_data_mode(s_compress), qdf_mode(false), static_id(false), + suppress_original_object_ids(false), direct_stream_lengths(true), encrypted(false), preserve_encryption(true), @@ -104,6 +105,12 @@ QPDFWriter::setStaticID(bool val) this->static_id = val; } +void +QPDFWriter::setSuppressOriginalObjectIDs(bool val) +{ + this->suppress_original_object_ids = val; +} + void QPDFWriter::setPreserveEncryption(bool val) { @@ -932,9 +939,13 @@ QPDFWriter::writeObjectStream(QPDFObjectHandle object) { writeString("%% Object stream: object " + QUtil::int_to_string(new_obj) + ", index " + - QUtil::int_to_string(count) + - "; original object ID: " + - QUtil::int_to_string(obj) + "\n"); + QUtil::int_to_string(count)); + if (! this->suppress_original_object_ids) + { + writeString("; original object ID: " + + QUtil::int_to_string(obj)); + } + writeString("\n"); } if (pass == 1) { @@ -1028,7 +1039,7 @@ QPDFWriter::writeObject(QPDFObjectHandle object, int object_stream_index) } if (object_stream_index == -1) { - if (this->qdf_mode) + if (this->qdf_mode && (! this->suppress_original_object_ids)) { writeString("%% Original object ID: " + QUtil::int_to_string(object.getObjectID()) + " " + -- cgit v1.2.3-54-g00ecf