From cb769c62e55599e9f980001830bc61d9fcaa64a9 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Tue, 8 Feb 2022 09:18:08 -0500 Subject: WHITESPACE ONLY -- expand tabs in source code This comment expands all tabs using an 8-character tab-width. You should ignore this commit when using git blame or use git blame -w. In the early days, I used to use tabs where possible for indentation, since emacs did this automatically. In recent years, I have switched to only using spaces, which means qpdf source code has been a mixture of spaces and tabs. I have avoided cleaning this up because of not wanting gratuitous whitespaces change to cloud the output of git blame, but I changed my mind after discussing with users who view qpdf source code in editors/IDEs that have other tab widths by default and in light of the fact that I am planning to start applying automatic code formatting soon. --- libqpdf/QPDF_Name.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'libqpdf/QPDF_Name.cc') diff --git a/libqpdf/QPDF_Name.cc b/libqpdf/QPDF_Name.cc index ffd21af2..7972210c 100644 --- a/libqpdf/QPDF_Name.cc +++ b/libqpdf/QPDF_Name.cc @@ -18,28 +18,28 @@ QPDF_Name::normalizeName(std::string const& name) { if (name.empty()) { - return name; + return name; } std::string result; result += name.at(0); for (size_t i = 1; i < name.length(); ++i) { - char ch = name.at(i); - // Don't use locale/ctype here; follow PDF spec guidelines. + char ch = name.at(i); + // Don't use locale/ctype here; follow PDF spec guidelines. 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 - { - result += ch; - } + } + else + { + result += ch; + } } return result; } -- cgit v1.2.3-70-g09d2