diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-02-26 14:16:12 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-02-26 14:16:12 +0100 |
commit | ae17402c52a3a04ae173d6fe5a6e383d5115c88a (patch) | |
tree | f9bed97f14236490ad14c0aac9aaed50bea28e7d /libqpdf/QPDFJob.cc | |
parent | a531418964d8f3116f5c7d5f7a7966e963e75a70 (diff) | |
download | qpdf-ae17402c52a3a04ae173d6fe5a6e383d5115c88a.tar.zst |
Move default values to constexpr
This was mainly to get comments about defaults out of constructor
initializer lists where their fragile when a code formatter is being
used.
Diffstat (limited to 'libqpdf/QPDFJob.cc')
-rw-r--r-- | libqpdf/QPDFJob.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libqpdf/QPDFJob.cc b/libqpdf/QPDFJob.cc index c23b950b..1d0811ef 100644 --- a/libqpdf/QPDFJob.cc +++ b/libqpdf/QPDFJob.cc @@ -335,6 +335,13 @@ ProgressReporter::reportProgress(int percentage) << percentage << "%" << std::endl; } +// These default values are duplicated in help and docs. +static int constexpr DEFAULT_KEEP_FILES_OPEN_THRESHOLD = 200; +static int constexpr DEFAULT_OI_MIN_WIDTH = 128; +static int constexpr DEFAULT_OI_MIN_HEIGHT = 128; +static int constexpr DEFAULT_OI_MIN_AREA = 16384; +static int constexpr DEFAULT_II_MIN_BYTES = 1024; + QPDFJob::Members::Members() : message_prefix("qpdf"), warnings(false), @@ -393,7 +400,7 @@ QPDFJob::Members::Members() : remove_unreferenced_page_resources(re_auto), keep_files_open(true), keep_files_open_set(false), - keep_files_open_threshold(200), // default known in help and docs + keep_files_open_threshold(DEFAULT_KEEP_FILES_OPEN_THRESHOLD), newline_before_endstream(false), coalesce_contents(false), flatten_annotations(false), @@ -426,10 +433,10 @@ QPDFJob::Members::Members() : externalize_inline_images(false), keep_inline_images(false), remove_page_labels(false), - oi_min_width(128), // Default values for these - oi_min_height(128), // oi and ii flags are in --help - oi_min_area(16384), // and in the manual. - ii_min_bytes(1024), // + oi_min_width(DEFAULT_OI_MIN_WIDTH), + oi_min_height(DEFAULT_OI_MIN_HEIGHT), + oi_min_area(DEFAULT_OI_MIN_AREA), + ii_min_bytes(DEFAULT_II_MIN_BYTES), underlay("underlay"), overlay("overlay"), under_overlay(0), |