aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--libqpdf/QPDF_linearization.cc10
2 files changed, 15 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index ec165929..ad86b396 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2012-09-06 Jay Berkenbilt <ejb@ql.org>
+ * Make it possible to write the same QPDF object with two
+ different QPDFWriter objects that have both called
+ setLinearization(true) by making private method
+ QPDF::calculateLinearizationData() properly initialize its state.
+
* Bug fix: Writing after calling QPDFWriter::setOutputMemory()
would cause a segmentation fault because of an internal field not
being initialized, rendering that method useless. This has been
diff --git a/libqpdf/QPDF_linearization.cc b/libqpdf/QPDF_linearization.cc
index fdd0d702..65f2b99e 100644
--- a/libqpdf/QPDF_linearization.cc
+++ b/libqpdf/QPDF_linearization.cc
@@ -1241,6 +1241,16 @@ QPDF::calculateLinearizationData(std::map<int, int> const& object_stream_data)
// * outlines: part 6 or 9
+ this->part4.clear();
+ this->part6.clear();
+ this->part7.clear();
+ this->part8.clear();
+ this->part9.clear();
+ this->c_linp = LinParameters();
+ this->c_page_offset_data = CHPageOffset();
+ this->c_shared_object_data = CHSharedObject();
+ this->c_outline_data = HGeneric();
+
QPDFObjectHandle root = getRoot();
bool outlines_in_first_page = false;
QPDFObjectHandle pagemode = root.getKey("/PageMode");