Commit 5769414b4a9eed75ec786d7a655ac8b8ea7098a0

Authored by m-holger
Committed by GitHub
2 parents 6434e09d 7d10a8ab

Merge pull request #1418 from m-holger/opt

Deprecate QPDF::optimize
include/qpdf/QPDF.hh
@@ -674,8 +674,7 @@ class QPDF @@ -674,8 +674,7 @@ class QPDF
674 // /Length, /Filter, and /DecodeParms; 1 if it should discard /Length, and 0 if it should 674 // /Length, /Filter, and /DecodeParms; 1 if it should discard /Length, and 0 if it should
675 // preserve all keys. This is used by QPDFWriter to avoid creation of dangling objects for 675 // preserve all keys. This is used by QPDFWriter to avoid creation of dangling objects for
676 // stream dictionary keys it will be regenerating. 676 // stream dictionary keys it will be regenerating.
677 - QPDF_DLL  
678 - void optimize( 677 + [[deprecated("Unused - see release notes for qpdf 12.1.0")]] QPDF_DLL void optimize(
679 std::map<int, int> const& object_stream_data, 678 std::map<int, int> const& object_stream_data,
680 bool allow_changes = true, 679 bool allow_changes = true,
681 std::function<int(QPDFObjectHandle&)> skip_stream_parameters = nullptr); 680 std::function<int(QPDFObjectHandle&)> skip_stream_parameters = nullptr);
libqpdf/QPDF_linearization.cc
@@ -483,7 +483,7 @@ QPDF::checkLinearizationInternal() @@ -483,7 +483,7 @@ QPDF::checkLinearizationInternal()
483 object_stream_data[og.getObj()] = entry.getObjStreamNumber(); 483 object_stream_data[og.getObj()] = entry.getObjStreamNumber();
484 } 484 }
485 } 485 }
486 - optimize(object_stream_data, false); 486 + optimize_internal(object_stream_data, false, nullptr);
487 calculateLinearizationData(object_stream_data); 487 calculateLinearizationData(object_stream_data);
488 } 488 }
489 489
manual/release-notes.rst
@@ -41,6 +41,9 @@ more detail. @@ -41,6 +41,9 @@ more detail.
41 41
42 - Other changes 42 - Other changes
43 43
  44 + - The ``QPDF::optimize`` method is believed to be not in use and has been
  45 + deprecated. If you are relying on it please open a ticket_.
  46 +
44 - The parsing of object streams including the creation of error/warning 47 - The parsing of object streams including the creation of error/warning
45 messages and object descriptions has been refactored with some 48 messages and object descriptions has been refactored with some
46 improvement both in runtime and memory usage. 49 improvement both in runtime and memory usage.