aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2024-02-04 22:11:53 +0100
committerJay Berkenbilt <ejb@ql.org>2024-02-04 22:12:01 +0100
commit7caa9ddf5a8b272c94fa5d4c079f2be8eabff983 (patch)
tree64451d1714bb5625cc45cbcbef96175756fee457
parent532cc58d7e1ad73d2e724abb0bb21af90e791d30 (diff)
downloadqpdf-7caa9ddf5a8b272c94fa5d4c079f2be8eabff983.tar.zst
Format code
-rw-r--r--libqpdf/QPDF.cc6
-rw-r--r--libqpdf/QPDFJob.cc7
-rw-r--r--libqpdf/QPDFParser.cc3
-rw-r--r--libqpdf/QPDF_Array.cc2
-rw-r--r--libqpdf/qpdf/Pl_TIFFPredictor.hh2
-rw-r--r--libtests/json.cc2
6 files changed, 12 insertions, 10 deletions
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc
index 01158ce2..fdd75359 100644
--- a/libqpdf/QPDF.cc
+++ b/libqpdf/QPDF.cc
@@ -711,8 +711,9 @@ QPDF::read_xref(qpdf_offset_t xref_offset)
QPDFObjGen last_og{-1, 0};
for (auto const& item: m->xref_table) {
auto id = item.first.getObj();
- if (id == last_og.getObj() && id > 0)
+ if (id == last_og.getObj() && id > 0) {
removeObject(last_og);
+ }
last_og = item.first;
}
}
@@ -2413,9 +2414,10 @@ QPDF::getCompressibleObjGens()
if (obj.getObjectID() > 0) {
QPDFObjGen og = obj.getObjGen();
const size_t id = toS(og.getObj() - 1);
- if (id >= max_obj)
+ if (id >= max_obj) {
throw std::logic_error(
"unexpected object id encountered in getCompressibleObjGens");
+ }
if (visited[id]) {
QTC::TC("qpdf", "QPDF loop detected traversing objects");
continue;
diff --git a/libqpdf/QPDFJob.cc b/libqpdf/QPDFJob.cc
index 07abaa49..a699e38d 100644
--- a/libqpdf/QPDFJob.cc
+++ b/libqpdf/QPDFJob.cc
@@ -3097,10 +3097,9 @@ QPDFJob::writeOutfile(QPDF& pdf)
try {
QUtil::remove_file(backup.c_str());
} catch (QPDFSystemError& e) {
- *m->log->getError()
- << m->message_prefix << ": unable to delete original file (" << e.what() << ");"
- << " original file left in " << backup
- << ", but the input was successfully replaced\n";
+ *m->log->getError() << m->message_prefix << ": unable to delete original file ("
+ << e.what() << ");" << " original file left in " << backup
+ << ", but the input was successfully replaced\n";
}
}
}
diff --git a/libqpdf/QPDFParser.cc b/libqpdf/QPDFParser.cc
index 2551cf93..56448364 100644
--- a/libqpdf/QPDFParser.cc
+++ b/libqpdf/QPDFParser.cc
@@ -253,8 +253,9 @@ QPDFParser::parseRemainder(bool content_stream)
dict[frame->key] = QPDF_Null::create();
}
- if (!frame->olist.empty())
+ if (!frame->olist.empty()) {
fixMissingKeys();
+ }
if (!frame->contents_string.empty() && dict.count("/Type") &&
dict["/Type"].isNameAndEquals("/Sig") && dict.count("/ByteRange") &&
diff --git a/libqpdf/QPDF_Array.cc b/libqpdf/QPDF_Array.cc
index 7d6f4539..789acc35 100644
--- a/libqpdf/QPDF_Array.cc
+++ b/libqpdf/QPDF_Array.cc
@@ -1,8 +1,8 @@
#include <qpdf/QPDF_Array.hh>
-#include <qpdf/QTC.hh>
#include <qpdf/QPDFObjectHandle.hh>
#include <qpdf/QPDFObject_private.hh>
+#include <qpdf/QTC.hh>
static const QPDFObjectHandle null_oh = QPDFObjectHandle::newNull();
diff --git a/libqpdf/qpdf/Pl_TIFFPredictor.hh b/libqpdf/qpdf/Pl_TIFFPredictor.hh
index 276ed54d..3f448f16 100644
--- a/libqpdf/qpdf/Pl_TIFFPredictor.hh
+++ b/libqpdf/qpdf/Pl_TIFFPredictor.hh
@@ -6,7 +6,7 @@
#include <qpdf/Pipeline.hh>
-#include<vector>
+#include <vector>
class Pl_TIFFPredictor: public Pipeline
{
diff --git a/libtests/json.cc b/libtests/json.cc
index 67c8534f..e84ef0a0 100644
--- a/libtests/json.cc
+++ b/libtests/json.cc
@@ -137,7 +137,7 @@ test_main()
// Check default constructed JSON object (order as per JSON.hh).
JSON uninitialized;
std::string ws;
- auto pl = Pl_String ("", nullptr, ws);
+ auto pl = Pl_String("", nullptr, ws);
uninitialized.write(&pl);
assert(ws == "null");
assert(uninitialized.unparse() == "null");