mirror of
https://github.com/qpdf/qpdf.git
synced 2024-06-03 19:00:51 +00:00
Format code
This commit is contained in:
parent
532cc58d7e
commit
7caa9ddf5a
|
@ -711,8 +711,9 @@ QPDF::read_xref(qpdf_offset_t xref_offset)
|
||||||
QPDFObjGen last_og{-1, 0};
|
QPDFObjGen last_og{-1, 0};
|
||||||
for (auto const& item: m->xref_table) {
|
for (auto const& item: m->xref_table) {
|
||||||
auto id = item.first.getObj();
|
auto id = item.first.getObj();
|
||||||
if (id == last_og.getObj() && id > 0)
|
if (id == last_og.getObj() && id > 0) {
|
||||||
removeObject(last_og);
|
removeObject(last_og);
|
||||||
|
}
|
||||||
last_og = item.first;
|
last_og = item.first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2413,9 +2414,10 @@ QPDF::getCompressibleObjGens()
|
||||||
if (obj.getObjectID() > 0) {
|
if (obj.getObjectID() > 0) {
|
||||||
QPDFObjGen og = obj.getObjGen();
|
QPDFObjGen og = obj.getObjGen();
|
||||||
const size_t id = toS(og.getObj() - 1);
|
const size_t id = toS(og.getObj() - 1);
|
||||||
if (id >= max_obj)
|
if (id >= max_obj) {
|
||||||
throw std::logic_error(
|
throw std::logic_error(
|
||||||
"unexpected object id encountered in getCompressibleObjGens");
|
"unexpected object id encountered in getCompressibleObjGens");
|
||||||
|
}
|
||||||
if (visited[id]) {
|
if (visited[id]) {
|
||||||
QTC::TC("qpdf", "QPDF loop detected traversing objects");
|
QTC::TC("qpdf", "QPDF loop detected traversing objects");
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -3097,9 +3097,8 @@ QPDFJob::writeOutfile(QPDF& pdf)
|
||||||
try {
|
try {
|
||||||
QUtil::remove_file(backup.c_str());
|
QUtil::remove_file(backup.c_str());
|
||||||
} catch (QPDFSystemError& e) {
|
} catch (QPDFSystemError& e) {
|
||||||
*m->log->getError()
|
*m->log->getError() << m->message_prefix << ": unable to delete original file ("
|
||||||
<< m->message_prefix << ": unable to delete original file (" << e.what() << ");"
|
<< e.what() << ");" << " original file left in " << backup
|
||||||
<< " original file left in " << backup
|
|
||||||
<< ", but the input was successfully replaced\n";
|
<< ", but the input was successfully replaced\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -253,8 +253,9 @@ QPDFParser::parseRemainder(bool content_stream)
|
||||||
dict[frame->key] = QPDF_Null::create();
|
dict[frame->key] = QPDF_Null::create();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!frame->olist.empty())
|
if (!frame->olist.empty()) {
|
||||||
fixMissingKeys();
|
fixMissingKeys();
|
||||||
|
}
|
||||||
|
|
||||||
if (!frame->contents_string.empty() && dict.count("/Type") &&
|
if (!frame->contents_string.empty() && dict.count("/Type") &&
|
||||||
dict["/Type"].isNameAndEquals("/Sig") && dict.count("/ByteRange") &&
|
dict["/Type"].isNameAndEquals("/Sig") && dict.count("/ByteRange") &&
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#include <qpdf/QPDF_Array.hh>
|
#include <qpdf/QPDF_Array.hh>
|
||||||
|
|
||||||
#include <qpdf/QTC.hh>
|
|
||||||
#include <qpdf/QPDFObjectHandle.hh>
|
#include <qpdf/QPDFObjectHandle.hh>
|
||||||
#include <qpdf/QPDFObject_private.hh>
|
#include <qpdf/QPDFObject_private.hh>
|
||||||
|
#include <qpdf/QTC.hh>
|
||||||
|
|
||||||
static const QPDFObjectHandle null_oh = QPDFObjectHandle::newNull();
|
static const QPDFObjectHandle null_oh = QPDFObjectHandle::newNull();
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include <qpdf/Pipeline.hh>
|
#include <qpdf/Pipeline.hh>
|
||||||
|
|
||||||
#include<vector>
|
#include <vector>
|
||||||
|
|
||||||
class Pl_TIFFPredictor: public Pipeline
|
class Pl_TIFFPredictor: public Pipeline
|
||||||
{
|
{
|
||||||
|
|
|
@ -137,7 +137,7 @@ test_main()
|
||||||
// Check default constructed JSON object (order as per JSON.hh).
|
// Check default constructed JSON object (order as per JSON.hh).
|
||||||
JSON uninitialized;
|
JSON uninitialized;
|
||||||
std::string ws;
|
std::string ws;
|
||||||
auto pl = Pl_String ("", nullptr, ws);
|
auto pl = Pl_String("", nullptr, ws);
|
||||||
uninitialized.write(&pl);
|
uninitialized.write(&pl);
|
||||||
assert(ws == "null");
|
assert(ws == "null");
|
||||||
assert(uninitialized.unparse() == "null");
|
assert(uninitialized.unparse() == "null");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user