From 12f1eb15ca3fed6310402847559a7c99d3c77847 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 2 Apr 2022 17:14:10 -0400 Subject: Programmatically apply new formatting to code Run this: for i in **/*.cc **/*.c **/*.h **/*.hh; do clang-format < $i >| $i.new && mv $i.new $i done --- libqpdf/QPDF_Name.cc | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'libqpdf/QPDF_Name.cc') diff --git a/libqpdf/QPDF_Name.cc b/libqpdf/QPDF_Name.cc index 7972210c..85ca3059 100644 --- a/libqpdf/QPDF_Name.cc +++ b/libqpdf/QPDF_Name.cc @@ -1,8 +1,8 @@ #include -#include -#include #include +#include +#include QPDF_Name::QPDF_Name(std::string const& name) : name(name) @@ -16,28 +16,21 @@ QPDF_Name::~QPDF_Name() std::string QPDF_Name::normalizeName(std::string const& name) { - if (name.empty()) - { + if (name.empty()) { return name; } std::string result; result += name.at(0); - for (size_t i = 1; i < name.length(); ++i) - { + for (size_t i = 1; i < name.length(); ++i) { char ch = name.at(i); // Don't use locale/ctype here; follow PDF spec guidelines. - if (ch == '\0') - { + if (ch == '\0') { // QPDFTokenizer embeds a null character to encode an // invalid #. result += "#"; - } - else if (strchr("#()<>[]{}/%", ch) || (ch < 33) || (ch > 126)) - { + } else if (strchr("#()<>[]{}/%", ch) || (ch < 33) || (ch > 126)) { result += "#" + QUtil::hex_encode(std::string(&ch, 1)); - } - else - { + } else { result += ch; } } -- cgit v1.2.3-54-g00ecf