From ff69773b35480de41f86f410a120524c4d57d5c0 Mon Sep 17 00:00:00 2001 From: m-holger Date: Tue, 12 Jul 2022 17:14:31 +0100 Subject: Fix warnings in QPDF::getAllPagesInternal --- libqpdf/QPDF_pages.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'libqpdf') diff --git a/libqpdf/QPDF_pages.cc b/libqpdf/QPDF_pages.cc index 90d5a09f..a1bede25 100644 --- a/libqpdf/QPDF_pages.cc +++ b/libqpdf/QPDF_pages.cc @@ -107,10 +107,7 @@ QPDF::getAllPagesInternal( } visited.insert(cur_node_og); if (!cur_node.isDictionaryOfType("/Pages")) { - warn( - qpdf_e_damaged_pdf, - "page tree node", - m->file->getLastOffset(), + cur_node.warnIfPossible( "/Type key should be /Pages but is not; overriding"); cur_node.replaceKey("/Type", "/Pages"_qpdf); } @@ -140,10 +137,7 @@ QPDF::getAllPagesInternal( kids.setArrayItem(i, kid); } if (!kid.isDictionaryOfType("/Page")) { - warn( - qpdf_e_damaged_pdf, - "page tree node", - this->m->file->getLastOffset(), + kid.warnIfPossible( "/Type key should be /Page but is not; overriding"); kid.replaceKey("/Type", "/Page"_qpdf); } -- cgit v1.2.3-54-g00ecf