From 8803fedefd7b363135ba430ae8c3943921ca3382 Mon Sep 17 00:00:00 2001 From: m-holger Date: Wed, 3 Sep 2025 12:10:11 +0100 Subject: [PATCH] Refactor `QPDFAcroFormDocumentHelper`: simplify `/DR` initialization by removing redundant `initialized_dr_map` flag and directly checking `dr`. --- libqpdf/QPDFAcroFormDocumentHelper.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libqpdf/QPDFAcroFormDocumentHelper.cc b/libqpdf/QPDFAcroFormDocumentHelper.cc index 849e8b2..af0928f 100644 --- a/libqpdf/QPDFAcroFormDocumentHelper.cc +++ b/libqpdf/QPDFAcroFormDocumentHelper.cc @@ -789,12 +789,10 @@ QPDFAcroFormDocumentHelper::transformAnnotations( // If we have to merge /DR, we will need a mapping of conflicting keys for rewriting /DA. Set // this up for lazy initialization in case we encounter any form fields. std::map> dr_map; - bool initialized_dr_map = false; Dictionary dr; auto init_dr_map = [&]() { - if (!initialized_dr_map) { - initialized_dr_map = true; + if (!dr) { // Ensure that we have a /DR that is an indirect // dictionary object. if (!acroform) { -- libgit2 0.21.4