Commit 7836e1974726f379b96d980cfa39561cfab2e0ff
Committed by
Jay Berkenbilt
1 parent
3b3bcab3
Code tidy: remove redundant calls to QPDFObjectHandle::isInitialized
Showing
2 changed files
with
5 additions
and
7 deletions
libqpdf/NNTree.cc
| @@ -56,8 +56,7 @@ NNTreeIterator::updateIValue(bool allow_invalid) | @@ -56,8 +56,7 @@ NNTreeIterator::updateIValue(bool allow_invalid) | ||
| 56 | // measure, we also call updateIValue in operator* and operator->. | 56 | // measure, we also call updateIValue in operator* and operator->. |
| 57 | 57 | ||
| 58 | bool okay = false; | 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 | auto items = this->node.getKey(impl.details.itemsKey()); | 60 | auto items = this->node.getKey(impl.details.itemsKey()); |
| 62 | if (this->item_number + 1 < items.getArrayNItems()) { | 61 | if (this->item_number + 1 < items.getArrayNItems()) { |
| 63 | okay = true; | 62 | okay = true; |
| @@ -987,10 +986,10 @@ NNTreeImpl::insertFirst(QPDFObjectHandle key, QPDFObjectHandle value) | @@ -987,10 +986,10 @@ NNTreeImpl::insertFirst(QPDFObjectHandle key, QPDFObjectHandle value) | ||
| 987 | { | 986 | { |
| 988 | auto iter = begin(); | 987 | auto iter = begin(); |
| 989 | QPDFObjectHandle items; | 988 | QPDFObjectHandle items; |
| 990 | - if (iter.node.isInitialized() && iter.node.isDictionary()) { | 989 | + if (iter.node.isDictionary()) { |
| 991 | items = iter.node.getKey(details.itemsKey()); | 990 | items = iter.node.getKey(details.itemsKey()); |
| 992 | } | 991 | } |
| 993 | - if (!(items.isInitialized() && items.isArray())) { | 992 | + if (!(items.isArray())) { |
| 994 | QTC::TC("qpdf", "NNTree no valid items node in insertFirst"); | 993 | QTC::TC("qpdf", "NNTree no valid items node in insertFirst"); |
| 995 | error(qpdf, this->oh, "unable to find a valid items node"); | 994 | error(qpdf, this->oh, "unable to find a valid items node"); |
| 996 | } | 995 | } |
libqpdf/QPDFFormFieldObjectHelper.cc
| @@ -878,7 +878,7 @@ QPDFFormFieldObjectHelper::generateTextAppearance( | @@ -878,7 +878,7 @@ QPDFFormFieldObjectHelper::generateTextAppearance( | ||
| 878 | if (!font.isInitialized()) { | 878 | if (!font.isInitialized()) { |
| 879 | QPDFObjectHandle dr = getDefaultResources(); | 879 | QPDFObjectHandle dr = getDefaultResources(); |
| 880 | font = getFontFromResource(dr, font_name); | 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 | if (found_font_in_dr && resources.isDictionary()) { | 883 | if (found_font_in_dr && resources.isDictionary()) { |
| 884 | QTC::TC("qpdf", "QPDFFormFieldObjectHelper get font from /DR"); | 884 | QTC::TC("qpdf", "QPDFFormFieldObjectHelper get font from /DR"); |
| @@ -892,8 +892,7 @@ QPDFFormFieldObjectHelper::generateTextAppearance( | @@ -892,8 +892,7 @@ QPDFFormFieldObjectHelper::generateTextAppearance( | ||
| 892 | resources.getKey("/Font").replaceKey(font_name, font); | 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 | std::string encoding = font.getKey("/Encoding").getName(); | 896 | std::string encoding = font.getKey("/Encoding").getName(); |
| 898 | if (encoding == "/WinAnsiEncoding") { | 897 | if (encoding == "/WinAnsiEncoding") { |
| 899 | QTC::TC("qpdf", "QPDFFormFieldObjectHelper WinAnsi"); | 898 | QTC::TC("qpdf", "QPDFFormFieldObjectHelper WinAnsi"); |