mirror of
https://github.com/qpdf/qpdf.git
synced 2024-12-22 10:58:58 +00:00
Update some code manually to get better formatting results
Add comments to force line breaks, parenthesize function arguments that are contatenated strings, etc. -- these kinds of changes improve clang-format's results and also cause emacs cc-mode to match clang-format. After this type of change, most of the time, when clang-format and emacs disagree, clang-format is better.
This commit is contained in:
parent
12f1eb15ca
commit
77e889495f
2
TODO
2
TODO
@ -51,7 +51,7 @@ Use clang-format-15.
|
||||
done
|
||||
|
||||
* Carefully inspect the diff. There are some places where a comment to
|
||||
force a line break might be in order.
|
||||
force a line break might be in order. Document use of // line-break
|
||||
|
||||
* Update README-maintainer about formatting. Mention
|
||||
|
||||
|
@ -45,7 +45,9 @@ process(
|
||||
|
||||
// Create an indirect object for the built-in Helvetica font. This
|
||||
// uses the qpdf literal syntax introduced in qpdf 10.6.
|
||||
auto f1 = q.makeIndirectObject("<<"
|
||||
auto f1 = q.makeIndirectObject(
|
||||
// force line-break
|
||||
"<<"
|
||||
" /Type /Font"
|
||||
" /Subtype /Type1"
|
||||
" /Name /F1"
|
||||
@ -56,14 +58,16 @@ process(
|
||||
// Create a resources dictionary with fonts. This uses the new
|
||||
// parse introduced in qpdf 10.2 that takes a QPDF* and allows
|
||||
// indirect object references.
|
||||
auto resources = q.makeIndirectObject(QPDFObjectHandle::parse(
|
||||
auto resources = q.makeIndirectObject(
|
||||
// line-break
|
||||
QPDFObjectHandle::parse(
|
||||
&q,
|
||||
"<<"
|
||||
("<<"
|
||||
" /Font <<"
|
||||
" /F1 " +
|
||||
f1.unparse() +
|
||||
" >>"
|
||||
">>"));
|
||||
">>")));
|
||||
|
||||
// Create a file spec.
|
||||
std::string key = QUtil::path_basename(attachment);
|
||||
@ -108,35 +112,35 @@ process(
|
||||
apdict.replaceKey("/BBox", "[ 0 0 20 20 ]"_qpdf);
|
||||
auto annot = q.makeIndirectObject(QPDFObjectHandle::parse(
|
||||
&q,
|
||||
"<<"
|
||||
("<<"
|
||||
" /AP <<"
|
||||
" /N " +
|
||||
ap.unparse() +
|
||||
" >>"
|
||||
" /Contents " +
|
||||
QPDFObjectHandle::newUnicodeString(attachment).unparse() +
|
||||
" /FS " + fs.getObjectHandle().unparse() + " /NM " +
|
||||
QPDFObjectHandle::newUnicodeString(attachment).unparse() + " /FS " +
|
||||
fs.getObjectHandle().unparse() + " /NM " +
|
||||
QPDFObjectHandle::newUnicodeString(attachment).unparse() +
|
||||
" /Rect [ 72 700 92 720 ]"
|
||||
" /Subtype /FileAttachment"
|
||||
" /Type /Annot"
|
||||
">>"));
|
||||
">>")));
|
||||
|
||||
// Generate contents for the page.
|
||||
auto contents = QPDFObjectHandle::newStream(
|
||||
&q,
|
||||
"q\n"
|
||||
("q\n"
|
||||
"BT\n"
|
||||
" 102 700 Td\n"
|
||||
" /F1 16 Tf\n"
|
||||
" (Here is an attachment.) Tj\n"
|
||||
"ET\n"
|
||||
"Q\n");
|
||||
"Q\n"));
|
||||
|
||||
// Create the page object.
|
||||
auto page = QPDFObjectHandle::parse(
|
||||
&q,
|
||||
"<<"
|
||||
("<<"
|
||||
" /Annots [ " +
|
||||
annot.unparse() +
|
||||
" ]"
|
||||
@ -146,7 +150,7 @@ process(
|
||||
" /Resources " +
|
||||
resources.unparse() +
|
||||
" /Type /Page"
|
||||
">>");
|
||||
">>"));
|
||||
|
||||
// Add the page.
|
||||
q.addPage(page, true);
|
||||
|
@ -180,7 +180,9 @@ add_page(
|
||||
size_t width = p->getWidth();
|
||||
size_t height = p->getHeight();
|
||||
QPDFObjectHandle image = QPDFObjectHandle::newStream(&pdf);
|
||||
auto image_dict = "<<"
|
||||
auto image_dict =
|
||||
// line-break
|
||||
"<<"
|
||||
" /Type /XObject"
|
||||
" /Subtype /Image"
|
||||
" /BitsPerComponent 8"
|
||||
@ -352,7 +354,9 @@ create_pdf(char const* filename)
|
||||
|
||||
// Add an indirect object to contain a font descriptor for the
|
||||
// built-in Helvetica font.
|
||||
QPDFObjectHandle font = pdf.makeIndirectObject("<<"
|
||||
QPDFObjectHandle font = pdf.makeIndirectObject(
|
||||
// line-break
|
||||
"<<"
|
||||
" /Type /Font"
|
||||
" /Subtype /Type1"
|
||||
" /Name /F1"
|
||||
|
@ -47,7 +47,9 @@ BitStream::getBitsSigned(size_t nbits)
|
||||
int
|
||||
BitStream::getBitsInt(size_t nbits)
|
||||
{
|
||||
return static_cast<int>(QIntC::to_uint(
|
||||
return static_cast<int>(
|
||||
// line-break
|
||||
QIntC::to_uint(
|
||||
read_bits(this->p, this->bit_offset, this->bits_available, nbits)));
|
||||
}
|
||||
|
||||
|
@ -96,9 +96,9 @@ void
|
||||
FileInputSource::seek(qpdf_offset_t offset, int whence)
|
||||
{
|
||||
QUtil::os_wrapper(
|
||||
std::string("seek to ") + this->m->filename + ", offset " +
|
||||
(std::string("seek to ") + this->m->filename + ", offset " +
|
||||
QUtil::int_to_string(offset) + " (" + QUtil::int_to_string(whence) +
|
||||
")",
|
||||
")"),
|
||||
QUtil::seek(this->m->file, offset, whence));
|
||||
}
|
||||
|
||||
@ -120,8 +120,8 @@ FileInputSource::read(char* buffer, size_t length)
|
||||
this->m->filename,
|
||||
"",
|
||||
this->last_offset,
|
||||
std::string("read ") + QUtil::uint_to_string(length) +
|
||||
" bytes");
|
||||
(std::string("read ") + QUtil::uint_to_string(length) +
|
||||
" bytes"));
|
||||
} else if (length > 0) {
|
||||
this->seek(0, SEEK_END);
|
||||
this->last_offset = this->tell();
|
||||
|
@ -121,9 +121,12 @@ InputSource::findFirst(
|
||||
}
|
||||
|
||||
// Search for the first character.
|
||||
if ((p = static_cast<char*>(memchr(
|
||||
p, start_chars[0], bytes_read - QIntC::to_size(p - buf)))) !=
|
||||
0) {
|
||||
if ((p = static_cast<char*>(
|
||||
// line-break
|
||||
memchr(
|
||||
p,
|
||||
start_chars[0],
|
||||
bytes_read - QIntC::to_size(p - buf)))) != 0) {
|
||||
if (p == buf) {
|
||||
QTC::TC("libtests", "InputSource found match at buf[0]");
|
||||
}
|
||||
|
@ -21,7 +21,9 @@ warn(QPDF* qpdf, QPDFObjectHandle& node, std::string const& msg)
|
||||
// ABI: in qpdf 11, change to a reference.
|
||||
|
||||
if (qpdf) {
|
||||
qpdf->warn(QPDFExc(
|
||||
qpdf->warn(
|
||||
// line-break
|
||||
QPDFExc(
|
||||
qpdf_e_damaged_pdf,
|
||||
qpdf->getFilename(),
|
||||
get_description(node),
|
||||
@ -122,8 +124,8 @@ NNTreeIterator::getNextKid(PathElement& pe, bool backward)
|
||||
warn(
|
||||
impl.qpdf,
|
||||
pe.node,
|
||||
"skipping over invalid kid at index " +
|
||||
QUtil::int_to_string(pe.kid_number));
|
||||
("skipping over invalid kid at index " +
|
||||
QUtil::int_to_string(pe.kid_number)));
|
||||
}
|
||||
} else {
|
||||
result = QPDFObjectHandle::newNull();
|
||||
@ -179,8 +181,8 @@ NNTreeIterator::increment(bool backward)
|
||||
warn(
|
||||
impl.qpdf,
|
||||
this->node,
|
||||
"item " + QUtil::int_to_string(this->item_number) +
|
||||
" has the wrong type");
|
||||
("item " + QUtil::int_to_string(this->item_number) +
|
||||
" has the wrong type"));
|
||||
} else {
|
||||
found_valid_key = true;
|
||||
}
|
||||
@ -708,9 +710,9 @@ NNTreeIterator::deepen(QPDFObjectHandle node, bool first, bool allow_empty)
|
||||
warn(
|
||||
impl.qpdf,
|
||||
node,
|
||||
"converting kid number " +
|
||||
("converting kid number " +
|
||||
QUtil::int_to_string(kid_number) +
|
||||
" to an indirect object");
|
||||
" to an indirect object"));
|
||||
next = impl.qpdf->makeIndirectObject(next);
|
||||
kids.setArrayItem(kid_number, next);
|
||||
} else {
|
||||
@ -718,8 +720,8 @@ NNTreeIterator::deepen(QPDFObjectHandle node, bool first, bool allow_empty)
|
||||
warn(
|
||||
impl.qpdf,
|
||||
node,
|
||||
"kid number " + QUtil::int_to_string(kid_number) +
|
||||
" is not an indirect object");
|
||||
("kid number " + QUtil::int_to_string(kid_number) +
|
||||
" is not an indirect object"));
|
||||
}
|
||||
}
|
||||
node = next;
|
||||
@ -732,8 +734,8 @@ NNTreeIterator::deepen(QPDFObjectHandle node, bool first, bool allow_empty)
|
||||
warn(
|
||||
impl.qpdf,
|
||||
node,
|
||||
"name/number tree node has neither non-empty " +
|
||||
impl.details.itemsKey() + " nor /Kids");
|
||||
("name/number tree node has neither non-empty " +
|
||||
impl.details.itemsKey() + " nor /Kids"));
|
||||
failed = true;
|
||||
break;
|
||||
}
|
||||
@ -876,8 +878,8 @@ NNTreeImpl::compareKeyItem(
|
||||
error(
|
||||
qpdf,
|
||||
this->oh,
|
||||
"item at index " + QUtil::int_to_string(2 * idx) +
|
||||
" is not the right type");
|
||||
("item at index " + QUtil::int_to_string(2 * idx) +
|
||||
" is not the right type"));
|
||||
}
|
||||
return details.compareKeys(key, items.getArrayItem(2 * idx));
|
||||
}
|
||||
|
@ -185,8 +185,9 @@ static void
|
||||
jpeg_pipeline_dest(
|
||||
j_compress_ptr cinfo, unsigned char* outbuffer, size_t size, Pipeline* next)
|
||||
{
|
||||
cinfo->dest =
|
||||
static_cast<struct jpeg_destination_mgr*>((*cinfo->mem->alloc_small)(
|
||||
cinfo->dest = static_cast<struct jpeg_destination_mgr*>(
|
||||
// line-break
|
||||
(*cinfo->mem->alloc_small)(
|
||||
reinterpret_cast<j_common_ptr>(cinfo),
|
||||
JPOOL_PERMANENT,
|
||||
sizeof(dct_pipeline_dest)));
|
||||
@ -239,7 +240,9 @@ term_buffer_source(j_decompress_ptr)
|
||||
static void
|
||||
jpeg_buffer_src(j_decompress_ptr cinfo, Buffer* buffer)
|
||||
{
|
||||
cinfo->src = reinterpret_cast<jpeg_source_mgr*>((*cinfo->mem->alloc_small)(
|
||||
cinfo->src = reinterpret_cast<jpeg_source_mgr*>(
|
||||
// line-break
|
||||
(*cinfo->mem->alloc_small)(
|
||||
reinterpret_cast<j_common_ptr>(cinfo),
|
||||
JPOOL_PERMANENT,
|
||||
sizeof(jpeg_source_mgr)));
|
||||
|
@ -44,7 +44,9 @@ void
|
||||
Pl_QPDFTokenizer::finish()
|
||||
{
|
||||
this->m->buf.finish();
|
||||
auto input = PointerHolder<InputSource>(new BufferInputSource(
|
||||
auto input = PointerHolder<InputSource>(
|
||||
// line-break
|
||||
new BufferInputSource(
|
||||
"tokenizer data", this->m->buf.getBuffer(), true));
|
||||
|
||||
while (true) {
|
||||
@ -59,7 +61,9 @@ Pl_QPDFTokenizer::finish()
|
||||
// Read the space after the ID.
|
||||
char ch = ' ';
|
||||
input->read(&ch, 1);
|
||||
this->m->filter->handleToken(QPDFTokenizer::Token(
|
||||
this->m->filter->handleToken(
|
||||
// line-break
|
||||
QPDFTokenizer::Token(
|
||||
QPDFTokenizer::tt_space, std::string(1, ch)));
|
||||
QTC::TC("qpdf", "Pl_QPDFTokenizer found ID");
|
||||
this->m->tokenizer.expectInlineImage(input);
|
||||
|
@ -31,7 +31,9 @@
|
||||
// it, and the C API relies on its being static as well.
|
||||
std::string const QPDF::qpdf_version(QPDF_VERSION);
|
||||
|
||||
static char const* EMPTY_PDF = "%PDF-1.3\n"
|
||||
static char const* EMPTY_PDF = (
|
||||
// force line break
|
||||
"%PDF-1.3\n"
|
||||
"1 0 obj\n"
|
||||
"<< /Type /Catalog /Pages 2 0 R >>\n"
|
||||
"endobj\n"
|
||||
@ -46,7 +48,7 @@ static char const* EMPTY_PDF = "%PDF-1.3\n"
|
||||
"trailer << /Size 3 /Root 1 0 R >>\n"
|
||||
"startxref\n"
|
||||
"110\n"
|
||||
"%%EOF\n";
|
||||
"%%EOF\n");
|
||||
|
||||
class InvalidInputSource: public InputSource
|
||||
{
|
||||
@ -292,7 +294,9 @@ QPDF::processMemoryFile(
|
||||
char const* password)
|
||||
{
|
||||
processInputSource(
|
||||
PointerHolder<InputSource>(new BufferInputSource(
|
||||
PointerHolder<InputSource>(
|
||||
// line-break
|
||||
new BufferInputSource(
|
||||
description,
|
||||
new Buffer(QUtil::unsigned_char_pointer(buf), length),
|
||||
true)),
|
||||
@ -753,10 +757,10 @@ QPDF::read_xref(qpdf_offset_t xref_offset)
|
||||
this->m->file->getName(),
|
||||
"",
|
||||
0,
|
||||
std::string("reported number of objects (") +
|
||||
(std::string("reported number of objects (") +
|
||||
QUtil::int_to_string(size) +
|
||||
") is not one plus the highest object number (" +
|
||||
QUtil::int_to_string(max_obj) + ")"));
|
||||
QUtil::int_to_string(max_obj) + ")")));
|
||||
}
|
||||
|
||||
// We no longer need the deleted_objects table, so go ahead and
|
||||
@ -1145,8 +1149,8 @@ QPDF::processXRefStream(qpdf_offset_t xref_offset, QPDFObjectHandle& xref_obj)
|
||||
this->m->file->getName(),
|
||||
"xref stream",
|
||||
xref_offset,
|
||||
"Cross-reference stream's /Index's item " +
|
||||
QUtil::int_to_string(i) + " is not an integer");
|
||||
("Cross-reference stream's /Index's item " +
|
||||
QUtil::int_to_string(i) + " is not an integer"));
|
||||
}
|
||||
}
|
||||
QTC::TC("qpdf", "QPDF xref /Index is array", n_index == 2 ? 0 : 1);
|
||||
@ -1165,11 +1169,11 @@ QPDF::processXRefStream(qpdf_offset_t xref_offset, QPDFObjectHandle& xref_obj)
|
||||
this->m->file->getName(),
|
||||
"xref stream",
|
||||
xref_offset,
|
||||
"Cross-reference stream claims to contain"
|
||||
("Cross-reference stream claims to contain"
|
||||
" too many entries: " +
|
||||
QUtil::int_to_string(indx.at(i)) + " " +
|
||||
QUtil::uint_to_string(max_num_entries) + " " +
|
||||
QUtil::uint_to_string(num_entries));
|
||||
QUtil::uint_to_string(num_entries)));
|
||||
}
|
||||
num_entries += toS(indx.at(i));
|
||||
}
|
||||
@ -1187,10 +1191,10 @@ QPDF::processXRefStream(qpdf_offset_t xref_offset, QPDFObjectHandle& xref_obj)
|
||||
this->m->file->getName(),
|
||||
"xref stream",
|
||||
xref_offset,
|
||||
"Cross-reference stream data has the wrong size;"
|
||||
("Cross-reference stream data has the wrong size;"
|
||||
" expected = " +
|
||||
QUtil::uint_to_string(expected_size) +
|
||||
"; actual = " + QUtil::uint_to_string(actual_size));
|
||||
"; actual = " + QUtil::uint_to_string(actual_size)));
|
||||
if (expected_size > actual_size) {
|
||||
throw x;
|
||||
} else {
|
||||
@ -1484,7 +1488,9 @@ QPDF::getAllObjects()
|
||||
iter != this->m->obj_cache.end();
|
||||
++iter) {
|
||||
QPDFObjGen const& og = (*iter).first;
|
||||
result.push_back(QPDFObjectHandle::Factory::newIndirect(
|
||||
result.push_back(
|
||||
// line-break
|
||||
QPDFObjectHandle::Factory::newIndirect(
|
||||
this, og.getObj(), og.getGen()));
|
||||
}
|
||||
return result;
|
||||
@ -1860,8 +1866,8 @@ QPDF::readObjectAtOffset(
|
||||
this->m->file->getName(),
|
||||
this->m->last_object_description,
|
||||
offset,
|
||||
std::string("expected ") + QUtil::int_to_string(exp_objid) +
|
||||
" " + QUtil::int_to_string(exp_generation) + " obj");
|
||||
(std::string("expected ") + QUtil::int_to_string(exp_objid) +
|
||||
" " + QUtil::int_to_string(exp_generation) + " obj"));
|
||||
if (try_recovery) {
|
||||
// Will be retried below
|
||||
throw e;
|
||||
@ -2003,8 +2009,8 @@ QPDF::resolve(int objid, int generation)
|
||||
this->m->file->getName(),
|
||||
"",
|
||||
this->m->file->getLastOffset(),
|
||||
"loop detected resolving object " + QUtil::int_to_string(objid) +
|
||||
" " + QUtil::int_to_string(generation)));
|
||||
("loop detected resolving object " + QUtil::int_to_string(objid) +
|
||||
" " + QUtil::int_to_string(generation))));
|
||||
return PointerHolder<QPDFObject>(new QPDF_Null);
|
||||
}
|
||||
ResolveRecorder rr(this, og);
|
||||
@ -2040,9 +2046,9 @@ QPDF::resolve(int objid, int generation)
|
||||
this->m->file->getName(),
|
||||
"",
|
||||
0,
|
||||
"object " + QUtil::int_to_string(objid) + "/" +
|
||||
("object " + QUtil::int_to_string(objid) + "/" +
|
||||
QUtil::int_to_string(generation) +
|
||||
" has unexpected xref entry type");
|
||||
" has unexpected xref entry type"));
|
||||
}
|
||||
} catch (QPDFExc& e) {
|
||||
warn(e);
|
||||
@ -2052,9 +2058,9 @@ QPDF::resolve(int objid, int generation)
|
||||
this->m->file->getName(),
|
||||
"",
|
||||
0,
|
||||
"object " + QUtil::int_to_string(objid) + "/" +
|
||||
("object " + QUtil::int_to_string(objid) + "/" +
|
||||
QUtil::int_to_string(generation) +
|
||||
": error reading object: " + e.what()));
|
||||
": error reading object: " + e.what())));
|
||||
}
|
||||
}
|
||||
if (this->m->obj_cache.count(og) == 0) {
|
||||
@ -2069,8 +2075,8 @@ QPDF::resolve(int objid, int generation)
|
||||
if (!result->hasDescription()) {
|
||||
result->setDescription(
|
||||
this,
|
||||
"object " + QUtil::int_to_string(objid) + " " +
|
||||
QUtil::int_to_string(generation));
|
||||
("object " + QUtil::int_to_string(objid) + " " +
|
||||
QUtil::int_to_string(generation)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -2090,8 +2096,8 @@ QPDF::resolveObjectsInStream(int obj_stream_number)
|
||||
this->m->file->getName(),
|
||||
this->m->last_object_description,
|
||||
this->m->file->getLastOffset(),
|
||||
"supposed object stream " +
|
||||
QUtil::int_to_string(obj_stream_number) + " is not a stream");
|
||||
("supposed object stream " +
|
||||
QUtil::int_to_string(obj_stream_number) + " is not a stream"));
|
||||
}
|
||||
|
||||
// For linearization data in the object, use the data from the
|
||||
@ -2110,8 +2116,8 @@ QPDF::resolveObjectsInStream(int obj_stream_number)
|
||||
this->m->file->getName(),
|
||||
this->m->last_object_description,
|
||||
this->m->file->getLastOffset(),
|
||||
"supposed object stream " +
|
||||
QUtil::int_to_string(obj_stream_number) + " has wrong type"));
|
||||
("supposed object stream " +
|
||||
QUtil::int_to_string(obj_stream_number) + " has wrong type")));
|
||||
}
|
||||
|
||||
if (!(dict.getKey("/N").isInteger() && dict.getKey("/First").isInteger())) {
|
||||
@ -2120,8 +2126,8 @@ QPDF::resolveObjectsInStream(int obj_stream_number)
|
||||
this->m->file->getName(),
|
||||
this->m->last_object_description,
|
||||
this->m->file->getLastOffset(),
|
||||
"object stream " + QUtil::int_to_string(obj_stream_number) +
|
||||
" has incorrect keys");
|
||||
("object stream " + QUtil::int_to_string(obj_stream_number) +
|
||||
" has incorrect keys"));
|
||||
}
|
||||
|
||||
int n = dict.getKey("/N").getIntValueAsInt();
|
||||
@ -2130,9 +2136,11 @@ QPDF::resolveObjectsInStream(int obj_stream_number)
|
||||
std::map<int, int> offsets;
|
||||
|
||||
PointerHolder<Buffer> bp = obj_stream.getStreamData(qpdf_dl_specialized);
|
||||
auto input = PointerHolder<InputSource>(new BufferInputSource(
|
||||
this->m->file->getName() + " object stream " +
|
||||
QUtil::int_to_string(obj_stream_number),
|
||||
auto input = PointerHolder<InputSource>(
|
||||
// line-break
|
||||
new BufferInputSource(
|
||||
(this->m->file->getName() + " object stream " +
|
||||
QUtil::int_to_string(obj_stream_number)),
|
||||
bp.get()));
|
||||
|
||||
for (int i = 0; i < n; ++i) {
|
||||
@ -2428,7 +2436,9 @@ QPDF::replaceForeignIndirectObjects(
|
||||
result = QPDFObjectHandle::newArray();
|
||||
int n = foreign.getArrayNItems();
|
||||
for (int i = 0; i < n; ++i) {
|
||||
result.appendItem(replaceForeignIndirectObjects(
|
||||
result.appendItem(
|
||||
// line-break
|
||||
replaceForeignIndirectObjects(
|
||||
foreign.getArrayItem(i), obj_copier, false));
|
||||
}
|
||||
} else if (foreign.isDictionary()) {
|
||||
@ -2800,16 +2810,20 @@ QPDF::pipeStreamData(
|
||||
} catch (std::exception& e) {
|
||||
if (!suppress_warnings) {
|
||||
QTC::TC("qpdf", "QPDF decoding error warning");
|
||||
qpdf_for_warning.warn(QPDFExc(
|
||||
qpdf_for_warning.warn(
|
||||
// line-break
|
||||
QPDFExc(
|
||||
qpdf_e_damaged_pdf,
|
||||
file->getName(),
|
||||
"",
|
||||
file->getLastOffset(),
|
||||
"error decoding stream data for object " +
|
||||
("error decoding stream data for object " +
|
||||
QUtil::int_to_string(objid) + " " +
|
||||
QUtil::int_to_string(generation) + ": " + e.what()));
|
||||
QUtil::int_to_string(generation) + ": " + e.what())));
|
||||
if (will_retry) {
|
||||
qpdf_for_warning.warn(QPDFExc(
|
||||
qpdf_for_warning.warn(
|
||||
// line-break
|
||||
QPDFExc(
|
||||
qpdf_e_damaged_pdf,
|
||||
file->getName(),
|
||||
"",
|
||||
|
@ -1110,7 +1110,9 @@ QPDFAcroFormDocumentHelper::transformAnnotations(
|
||||
} else if (ap.second.isDictionary()) {
|
||||
for (auto& ap2 : ap.second.ditems()) {
|
||||
if (ap2.second.isStream()) {
|
||||
streams.push_back(replace_stream(
|
||||
streams.push_back(
|
||||
// line-break
|
||||
replace_stream(
|
||||
ap.second, ap2.first, ap2.second));
|
||||
}
|
||||
}
|
||||
|
@ -208,7 +208,9 @@ QPDFCrypto_openssl::rijndael_init(
|
||||
}
|
||||
|
||||
check_openssl(EVP_CIPHER_CTX_reset(cipher_ctx));
|
||||
check_openssl(EVP_CipherInit_ex(
|
||||
check_openssl(
|
||||
// line-break
|
||||
EVP_CipherInit_ex(
|
||||
cipher_ctx, cipher, nullptr, key_data, cbc_block, encrypt));
|
||||
check_openssl(EVP_CIPHER_CTX_set_padding(cipher_ctx, 0));
|
||||
}
|
||||
|
@ -913,6 +913,8 @@ QPDFFormFieldObjectHelper::generateTextAppearance(
|
||||
opt.at(i) = (*encoder)(opt.at(i), '?');
|
||||
}
|
||||
|
||||
AS.addTokenFilter(PointerHolder<QPDFObjectHandle::TokenFilter>(
|
||||
AS.addTokenFilter(
|
||||
// line-break
|
||||
PointerHolder<QPDFObjectHandle::TokenFilter>(
|
||||
new ValueSetter(DA, V, opt, tf, bbox)));
|
||||
}
|
||||
|
@ -2519,7 +2519,9 @@ QPDFJob::handlePageSpecs(
|
||||
|
||||
// Read original pages from the PDF, and parse the page range
|
||||
// associated with this occurrence of the file.
|
||||
parsed_specs.push_back(QPDFPageData(
|
||||
parsed_specs.push_back(
|
||||
// line-break
|
||||
QPDFPageData(
|
||||
page_spec.filename,
|
||||
page_spec_qpdfs[page_spec.filename],
|
||||
page_spec.range));
|
||||
@ -2581,7 +2583,9 @@ QPDFJob::handlePageSpecs(
|
||||
for (size_t j = 0; j < m->collate; ++j) {
|
||||
if (cur_page + j < page_data.selected_pages.size()) {
|
||||
got_pages = true;
|
||||
new_parsed_specs.push_back(QPDFPageData(
|
||||
new_parsed_specs.push_back(
|
||||
// line-break
|
||||
QPDFPageData(
|
||||
page_data,
|
||||
page_data.selected_pages.at(cur_page + j)));
|
||||
}
|
||||
@ -2684,9 +2688,9 @@ QPDFJob::handlePageSpecs(
|
||||
pdf.getFilename(),
|
||||
"",
|
||||
0,
|
||||
"Exception caught while fixing copied"
|
||||
("Exception caught while fixing copied"
|
||||
" annotations. This may be a qpdf bug. " +
|
||||
std::string("Exception: ") + e.what()));
|
||||
std::string("Exception: ") + e.what())));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3060,8 +3064,9 @@ QPDFJob::setWriterOptions(QPDF& pdf, QPDFWriter& w)
|
||||
w.forcePDFVersion(version, extension_level);
|
||||
}
|
||||
if (m->progress && m->outfilename) {
|
||||
w.registerProgressReporter(
|
||||
PointerHolder<QPDFWriter::ProgressReporter>(new ProgressReporter(
|
||||
w.registerProgressReporter(PointerHolder<QPDFWriter::ProgressReporter>(
|
||||
// line-break
|
||||
new ProgressReporter(
|
||||
*(this->m->cout),
|
||||
this->m->message_prefix,
|
||||
m->outfilename.get())));
|
||||
|
@ -257,8 +257,8 @@ QPDFObjectHandle::setObjectDescriptionFromInput(
|
||||
{
|
||||
object.setObjectDescription(
|
||||
context,
|
||||
input->getName() + ", " + description + " at offset " +
|
||||
QUtil::int_to_string(offset));
|
||||
(input->getName() + ", " + description + " at offset " +
|
||||
QUtil::int_to_string(offset)));
|
||||
}
|
||||
|
||||
bool
|
||||
@ -1018,8 +1018,8 @@ QPDFObjectHandle::getKey(std::string const& key)
|
||||
if (this->obj->getDescription(qpdf, description)) {
|
||||
result.setObjectDescription(
|
||||
qpdf,
|
||||
description + " -> null returned from getting key " + key +
|
||||
" from non-Dictionary");
|
||||
(description + " -> null returned from getting key " + key +
|
||||
" from non-Dictionary"));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user