diff options
Diffstat (limited to 'libqpdf/QPDFOutlineObjectHelper.cc')
-rw-r--r-- | libqpdf/QPDFOutlineObjectHelper.cc | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/libqpdf/QPDFOutlineObjectHelper.cc b/libqpdf/QPDFOutlineObjectHelper.cc index cf6d3fcf..713c1412 100644 --- a/libqpdf/QPDFOutlineObjectHelper.cc +++ b/libqpdf/QPDFOutlineObjectHelper.cc @@ -17,22 +17,19 @@ QPDFOutlineObjectHelper::QPDFOutlineObjectHelper( QPDFObjectHelper(oh), m(new Members(dh)) { - if (depth > 50) - { + if (depth > 50) { // Not exercised in test suite, but was tested manually by // temporarily changing max depth to 1. return; } if (QPDFOutlineDocumentHelper::Accessor::checkSeen( - this->m->dh, this->oh.getObjGen())) - { + this->m->dh, this->oh.getObjGen())) { QTC::TC("qpdf", "QPDFOutlineObjectHelper loop"); return; } QPDFObjectHandle cur = oh.getKey("/First"); - while (! cur.isNull()) - { + while (!cur.isNull()) { QPDFOutlineObjectHelper new_ooh(cur, dh, 1 + depth); new_ooh.m->parent = make_pointer_holder<QPDFOutlineObjectHelper>(*this); this->m->kids.push_back(new_ooh); @@ -57,26 +54,20 @@ QPDFOutlineObjectHelper::getDest() { QPDFObjectHandle dest; QPDFObjectHandle A; - if (this->oh.hasKey("/Dest")) - { + if (this->oh.hasKey("/Dest")) { QTC::TC("qpdf", "QPDFOutlineObjectHelper direct dest"); dest = this->oh.getKey("/Dest"); - } - else if ((A = this->oh.getKey("/A")).isDictionary() && - A.getKey("/S").isName() && - (A.getKey("/S").getName() == "/GoTo") && - A.hasKey("/D")) - { + } else if ( + (A = this->oh.getKey("/A")).isDictionary() && A.getKey("/S").isName() && + (A.getKey("/S").getName() == "/GoTo") && A.hasKey("/D")) { QTC::TC("qpdf", "QPDFOutlineObjectHelper action dest"); dest = A.getKey("/D"); } - if (! dest.isInitialized()) - { + if (!dest.isInitialized()) { dest = QPDFObjectHandle::newNull(); } - if (dest.isName() || dest.isString()) - { + if (dest.isName() || dest.isString()) { QTC::TC("qpdf", "QPDFOutlineObjectHelper named dest"); dest = this->m->dh.resolveNamedDest(dest); } @@ -88,8 +79,7 @@ QPDFObjectHandle QPDFOutlineObjectHelper::getDestPage() { QPDFObjectHandle dest = getDest(); - if ((dest.isArray()) && (dest.getArrayNItems() > 0)) - { + if ((dest.isArray()) && (dest.getArrayNItems() > 0)) { return dest.getArrayItem(0); } return QPDFObjectHandle::newNull(); @@ -99,8 +89,7 @@ int QPDFOutlineObjectHelper::getCount() { int count = 0; - if (this->oh.hasKey("/Count")) - { + if (this->oh.hasKey("/Count")) { count = this->oh.getKey("/Count").getIntValueAsInt(); } return count; @@ -110,8 +99,7 @@ std::string QPDFOutlineObjectHelper::getTitle() { std::string result; - if (this->oh.hasKey("/Title")) - { + if (this->oh.hasKey("/Title")) { result = this->oh.getKey("/Title").getUTF8Value(); } return result; |