From 60965d5f4d608bdccc2ffd4e8753e12cbbbd71d2 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sun, 21 May 2023 13:35:09 -0400 Subject: Rerun clang-format --- examples/pdf-filter-tokens.cc | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'examples/pdf-filter-tokens.cc') diff --git a/examples/pdf-filter-tokens.cc b/examples/pdf-filter-tokens.cc index 9cfd3949..68d6e149 100644 --- a/examples/pdf-filter-tokens.cc +++ b/examples/pdf-filter-tokens.cc @@ -22,8 +22,7 @@ void usage() { std::cerr << "Usage: " << whoami << " infile outfile" << std::endl - << "Applies token filters to infile and writes outfile" - << std::endl; + << "Applies token filters to infile and writes outfile" << std::endl; exit(2); } @@ -82,17 +81,13 @@ class ColorToGray: public QPDFObjectHandle::TokenFilter bool ColorToGray::isNumeric(QPDFTokenizer::token_type_e token_type) { - return ( - (token_type == QPDFTokenizer::tt_integer) || - (token_type == QPDFTokenizer::tt_real)); + return ((token_type == QPDFTokenizer::tt_integer) || (token_type == QPDFTokenizer::tt_real)); } bool ColorToGray::isIgnorable(QPDFTokenizer::token_type_e token_type) { - return ( - (token_type == QPDFTokenizer::tt_space) || - (token_type == QPDFTokenizer::tt_comment)); + return ((token_type == QPDFTokenizer::tt_space) || (token_type == QPDFTokenizer::tt_comment)); } double @@ -128,8 +123,7 @@ ColorToGray::handleToken(QPDFTokenizer::Token const& token) // kinds of operands, replace the command. Flush any additional // accumulated tokens to keep the stack only four tokens deep. - while ((!this->all_stack.empty()) && - isIgnorable(this->all_stack.at(0).getType())) { + while ((!this->all_stack.empty()) && isIgnorable(this->all_stack.at(0).getType())) { writeToken(this->all_stack.at(0)); this->all_stack.pop_front(); } @@ -138,8 +132,7 @@ ColorToGray::handleToken(QPDFTokenizer::Token const& token) if (!isIgnorable(token_type)) { this->stack.push_back(token); if ((this->stack.size() == 4) && token.isWord("rg") && - (isNumeric(this->stack.at(0).getType())) && - (isNumeric(this->stack.at(1).getType())) && + (isNumeric(this->stack.at(0).getType())) && (isNumeric(this->stack.at(1).getType())) && (isNumeric(this->stack.at(2).getType()))) { double r = numericValue(this->stack.at(0)); double g = numericValue(this->stack.at(1)); @@ -195,11 +188,9 @@ main(int argc, char* argv[]) // applied. See comments on the filters for additional // details. page.addContentTokenFilter( - std::shared_ptr( - new StringReverser)); + std::shared_ptr(new StringReverser)); page.addContentTokenFilter( - std::shared_ptr( - new ColorToGray)); + std::shared_ptr(new ColorToGray)); } QPDFWriter w(pdf, outfilename); -- cgit v1.2.3-54-g00ecf