Commit 6c4537885e89f69b9368251759f75127e6dcc4d6
1 parent
7836e197
Reformat code
Showing
5 changed files
with
19 additions
and
18 deletions
examples/qpdfjob-c-save-attachment.c
| ... | ... | @@ -88,8 +88,7 @@ main(int argc, char* argv[]) |
| 88 | 88 | l, qpdf_log_dest_custom, save_to_file, (void*)outfile, 0); |
| 89 | 89 | qpdflogger_cleanup(&l); |
| 90 | 90 | j = qpdfjob_init(); |
| 91 | - status = (qpdfjob_initialize_from_argv(j, j_argv) || | |
| 92 | - qpdfjob_run(j)); | |
| 91 | + status = (qpdfjob_initialize_from_argv(j, j_argv) || qpdfjob_run(j)); | |
| 93 | 92 | qpdfjob_cleanup(&j); |
| 94 | 93 | free(attachment_arg); |
| 95 | 94 | fclose(outfile); | ... | ... |
libqpdf/QPDFJob.cc
| ... | ... | @@ -465,7 +465,8 @@ QPDFJob::setOutputStreams(std::ostream* out, std::ostream* err) |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | void |
| 468 | -QPDFJob::registerProgressReporter(std::function<void(int)> handler) { | |
| 468 | +QPDFJob::registerProgressReporter(std::function<void(int)> handler) | |
| 469 | +{ | |
| 469 | 470 | this->m->progress_handler = handler; |
| 470 | 471 | } |
| 471 | 472 | |
| ... | ... | @@ -1239,8 +1240,8 @@ QPDFJob::doJSONPageLabels(Pipeline* p, bool& first, QPDF& pdf) |
| 1239 | 1240 | { |
| 1240 | 1241 | JSON j_labels = JSON::makeArray(); |
| 1241 | 1242 | QPDFPageLabelDocumentHelper pldh(pdf); |
| 1242 | - long long npages = QIntC::to_longlong( | |
| 1243 | - QPDFPageDocumentHelper(pdf).getAllPages().size()); | |
| 1243 | + long long npages = | |
| 1244 | + QIntC::to_longlong(QPDFPageDocumentHelper(pdf).getAllPages().size()); | |
| 1244 | 1245 | if (pldh.hasPageLabels()) { |
| 1245 | 1246 | std::vector<QPDFObjectHandle> labels; |
| 1246 | 1247 | pldh.getLabelsForPageRange(0, npages - 1, 0, labels); | ... | ... |
libqpdf/QPDFObjectHandle.cc
| ... | ... | @@ -1552,7 +1552,7 @@ QPDFObjectHandle::getObjGen() const |
| 1552 | 1552 | std::string |
| 1553 | 1553 | QPDFObjectHandle::getObjGenAsStr() const |
| 1554 | 1554 | { |
| 1555 | - return QUtil::int_to_string(this->objid) + " " + | |
| 1555 | + return QUtil::int_to_string(this->objid) + " " + | |
| 1556 | 1556 | QUtil::int_to_string(this->generation); |
| 1557 | 1557 | } |
| 1558 | 1558 | ... | ... |
libqpdf/qpdfjob-c.cc
| ... | ... | @@ -85,7 +85,8 @@ qpdfjob_run(qpdfjob_handle j) |
| 85 | 85 | }); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | -static int run_with_handle(std::function<int(qpdfjob_handle)> fn) | |
| 88 | +static int | |
| 89 | +run_with_handle(std::function<int(qpdfjob_handle)> fn) | |
| 89 | 90 | { |
| 90 | 91 | auto j = qpdfjob_init(); |
| 91 | 92 | int status = fn(j); |
| ... | ... | @@ -96,7 +97,8 @@ static int run_with_handle(std::function<int(qpdfjob_handle)> fn) |
| 96 | 97 | return status; |
| 97 | 98 | } |
| 98 | 99 | |
| 99 | -int qpdfjob_run_from_argv(char const* const argv[]) | |
| 100 | +int | |
| 101 | +qpdfjob_run_from_argv(char const* const argv[]) | |
| 100 | 102 | { |
| 101 | 103 | return run_with_handle([argv](qpdfjob_handle j) { |
| 102 | 104 | return qpdfjob_initialize_from_argv(j, argv); |
| ... | ... | @@ -113,7 +115,8 @@ qpdfjob_run_from_wide_argv(wchar_t const* const argv[]) |
| 113 | 115 | } |
| 114 | 116 | #endif /* QPDF_NO_WCHAR_T */ |
| 115 | 117 | |
| 116 | -int qpdfjob_run_from_json(char const* json) | |
| 118 | +int | |
| 119 | +qpdfjob_run_from_json(char const* json) | |
| 117 | 120 | { |
| 118 | 121 | return run_with_handle([json](qpdfjob_handle j) { |
| 119 | 122 | return qpdfjob_initialize_from_json(j, json); | ... | ... |
libtests/pl_function.cc
| 1 | 1 | #include <qpdf/assert_test.h> |
| 2 | 2 | |
| 3 | +#include <qpdf/Pl_Base64.hh> | |
| 3 | 4 | #include <qpdf/Pl_Function.hh> |
| 4 | 5 | #include <qpdf/Pl_String.hh> |
| 5 | -#include <qpdf/Pl_Base64.hh> | |
| 6 | 6 | #include <iostream> |
| 7 | 7 | |
| 8 | 8 | int |
| 9 | 9 | main(int argc, char* argv[]) |
| 10 | 10 | { |
| 11 | - Pl_Function p1( | |
| 12 | - "p1", nullptr, [](unsigned char const* data, size_t len) { | |
| 13 | - std::cout << "p1: " << len << ": " << data << std::endl; | |
| 14 | - }); | |
| 11 | + Pl_Function p1("p1", nullptr, [](unsigned char const* data, size_t len) { | |
| 12 | + std::cout << "p1: " << len << ": " << data << std::endl; | |
| 13 | + }); | |
| 15 | 14 | p1.write(reinterpret_cast<unsigned char const*>("potato"), 6); |
| 16 | 15 | |
| 17 | 16 | std::string s; |
| 18 | 17 | Pl_String ps("string", nullptr, s); |
| 19 | 18 | Pl_Base64 b("base64", &ps, Pl_Base64::a_encode); |
| 20 | - Pl_Function p2( | |
| 21 | - "p2", &b, [](unsigned char const* data, size_t len) { | |
| 22 | - std::cout << "p2: " << len << ": " << data << std::endl; | |
| 23 | - }); | |
| 19 | + Pl_Function p2("p2", &b, [](unsigned char const* data, size_t len) { | |
| 20 | + std::cout << "p2: " << len << ": " << data << std::endl; | |
| 21 | + }); | |
| 24 | 22 | p2.write(reinterpret_cast<unsigned char const*>("salad"), 5); |
| 25 | 23 | p2.finish(); |
| 26 | 24 | assert(s == "c2FsYWQ="); | ... | ... |