diff --git a/libqpdf/ContentNormalizer.cc b/libqpdf/ContentNormalizer.cc index 9da6fa1c..2582e729 100644 --- a/libqpdf/ContentNormalizer.cc +++ b/libqpdf/ContentNormalizer.cc @@ -1,5 +1,6 @@ #include +#include #include ContentNormalizer::ContentNormalizer() : @@ -43,11 +44,11 @@ ContentNormalizer::handleToken(QPDFTokenizer::Token const& token) case QPDFTokenizer::tt_string: // Replacing string and name tokens in this way normalizes their representation as this will // automatically handle quoting of unprintable characters, etc. - writeToken(QPDFTokenizer::Token(QPDFTokenizer::tt_string, token.getValue())); + write(QPDFObjectHandle::newString(token.getValue()).unparse()); break; case QPDFTokenizer::tt_name: - writeToken(QPDFTokenizer::Token(QPDFTokenizer::tt_name, token.getValue())); + write(QPDF_Name::normalizeName(token.getValue())); break; default: diff --git a/libqpdf/QPDFOutlineDocumentHelper.cc b/libqpdf/QPDFOutlineDocumentHelper.cc index dd9db5c1..ba4e4291 100644 --- a/libqpdf/QPDFOutlineDocumentHelper.cc +++ b/libqpdf/QPDFOutlineDocumentHelper.cc @@ -71,7 +71,7 @@ QPDFOutlineDocumentHelper::resolveNamedDest(QPDFObjectHandle name) m->dest_dict = qpdf.getRoot().getKey("/Dests"); } QTC::TC("qpdf", "QPDFOutlineDocumentHelper name named dest"); - result= m->dest_dict.getKeyIfDict(name.getName()); + result = m->dest_dict.getKeyIfDict(name.getName()); } else if (name.isString()) { if (!m->names_dest) { auto dests = qpdf.getRoot().getKey("/Names").getKeyIfDict("/Dests");