mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-31 10:58:25 +00:00
Code tidy: remove redundant calls to QPDFObjectHandle::isInitialized
This commit is contained in:
parent
3b3bcab349
commit
7836e19747
@ -56,8 +56,7 @@ NNTreeIterator::updateIValue(bool allow_invalid)
|
||||
// measure, we also call updateIValue in operator* and operator->.
|
||||
|
||||
bool okay = false;
|
||||
if ((item_number >= 0) && this->node.isInitialized() &&
|
||||
this->node.isDictionary()) {
|
||||
if ((item_number >= 0) && this->node.isDictionary()) {
|
||||
auto items = this->node.getKey(impl.details.itemsKey());
|
||||
if (this->item_number + 1 < items.getArrayNItems()) {
|
||||
okay = true;
|
||||
@ -987,10 +986,10 @@ NNTreeImpl::insertFirst(QPDFObjectHandle key, QPDFObjectHandle value)
|
||||
{
|
||||
auto iter = begin();
|
||||
QPDFObjectHandle items;
|
||||
if (iter.node.isInitialized() && iter.node.isDictionary()) {
|
||||
if (iter.node.isDictionary()) {
|
||||
items = iter.node.getKey(details.itemsKey());
|
||||
}
|
||||
if (!(items.isInitialized() && items.isArray())) {
|
||||
if (!(items.isArray())) {
|
||||
QTC::TC("qpdf", "NNTree no valid items node in insertFirst");
|
||||
error(qpdf, this->oh, "unable to find a valid items node");
|
||||
}
|
||||
|
@ -878,7 +878,7 @@ QPDFFormFieldObjectHelper::generateTextAppearance(
|
||||
if (!font.isInitialized()) {
|
||||
QPDFObjectHandle dr = getDefaultResources();
|
||||
font = getFontFromResource(dr, font_name);
|
||||
found_font_in_dr = (font.isInitialized() && font.isDictionary());
|
||||
found_font_in_dr = font.isDictionary();
|
||||
}
|
||||
if (found_font_in_dr && resources.isDictionary()) {
|
||||
QTC::TC("qpdf", "QPDFFormFieldObjectHelper get font from /DR");
|
||||
@ -892,8 +892,7 @@ QPDFFormFieldObjectHelper::generateTextAppearance(
|
||||
resources.getKey("/Font").replaceKey(font_name, font);
|
||||
}
|
||||
|
||||
if (font.isInitialized() && font.isDictionary() &&
|
||||
font.getKey("/Encoding").isName()) {
|
||||
if (font.isDictionary() && font.getKey("/Encoding").isName()) {
|
||||
std::string encoding = font.getKey("/Encoding").getName();
|
||||
if (encoding == "/WinAnsiEncoding") {
|
||||
QTC::TC("qpdf", "QPDFFormFieldObjectHelper WinAnsi");
|
||||
|
Loading…
x
Reference in New Issue
Block a user