Commit 7836e1974726f379b96d980cfa39561cfab2e0ff

Authored by m-holger
Committed by Jay Berkenbilt
1 parent 3b3bcab3

Code tidy: remove redundant calls to QPDFObjectHandle::isInitialized

libqpdf/NNTree.cc
... ... @@ -56,8 +56,7 @@ NNTreeIterator::updateIValue(bool allow_invalid)
56 56 // measure, we also call updateIValue in operator* and operator->.
57 57  
58 58 bool okay = false;
59   - if ((item_number >= 0) && this->node.isInitialized() &&
60   - this->node.isDictionary()) {
  59 + if ((item_number >= 0) && this->node.isDictionary()) {
61 60 auto items = this->node.getKey(impl.details.itemsKey());
62 61 if (this->item_number + 1 < items.getArrayNItems()) {
63 62 okay = true;
... ... @@ -987,10 +986,10 @@ NNTreeImpl::insertFirst(QPDFObjectHandle key, QPDFObjectHandle value)
987 986 {
988 987 auto iter = begin();
989 988 QPDFObjectHandle items;
990   - if (iter.node.isInitialized() && iter.node.isDictionary()) {
  989 + if (iter.node.isDictionary()) {
991 990 items = iter.node.getKey(details.itemsKey());
992 991 }
993   - if (!(items.isInitialized() && items.isArray())) {
  992 + if (!(items.isArray())) {
994 993 QTC::TC("qpdf", "NNTree no valid items node in insertFirst");
995 994 error(qpdf, this->oh, "unable to find a valid items node");
996 995 }
... ...
libqpdf/QPDFFormFieldObjectHelper.cc
... ... @@ -878,7 +878,7 @@ QPDFFormFieldObjectHelper::generateTextAppearance(
878 878 if (!font.isInitialized()) {
879 879 QPDFObjectHandle dr = getDefaultResources();
880 880 font = getFontFromResource(dr, font_name);
881   - found_font_in_dr = (font.isInitialized() && font.isDictionary());
  881 + found_font_in_dr = font.isDictionary();
882 882 }
883 883 if (found_font_in_dr && resources.isDictionary()) {
884 884 QTC::TC("qpdf", "QPDFFormFieldObjectHelper get font from /DR");
... ... @@ -892,8 +892,7 @@ QPDFFormFieldObjectHelper::generateTextAppearance(
892 892 resources.getKey("/Font").replaceKey(font_name, font);
893 893 }
894 894  
895   - if (font.isInitialized() && font.isDictionary() &&
896   - font.getKey("/Encoding").isName()) {
  895 + if (font.isDictionary() && font.getKey("/Encoding").isName()) {
897 896 std::string encoding = font.getKey("/Encoding").getName();
898 897 if (encoding == "/WinAnsiEncoding") {
899 898 QTC::TC("qpdf", "QPDFFormFieldObjectHelper WinAnsi");
... ...