From 183e440789c0ff25c2fd932556b7b1d0a8c480d5 Mon Sep 17 00:00:00 2001 From: m-holger Date: Tue, 13 May 2025 18:00:45 +0100 Subject: [PATCH] In QPDFJob::UnderOverlay refactor password handling to use std::string directly --- include/qpdf/QPDFJob.hh | 2 +- libqpdf/QPDFJob.cc | 2 +- libqpdf/QPDFJob_config.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/qpdf/QPDFJob.hh b/include/qpdf/QPDFJob.hh index 3bcdd89..f6719a9 100644 --- a/include/qpdf/QPDFJob.hh +++ b/include/qpdf/QPDFJob.hh @@ -451,7 +451,7 @@ class QPDFJob std::string which; std::string filename; - std::shared_ptr password; + std::string password; std::string to_nr; std::string from_nr; std::string repeat_nr; diff --git a/libqpdf/QPDFJob.cc b/libqpdf/QPDFJob.cc index 38d8693..f053c83 100644 --- a/libqpdf/QPDFJob.cc +++ b/libqpdf/QPDFJob.cc @@ -1882,7 +1882,7 @@ QPDFJob::validateUnderOverlay(QPDF& pdf, UnderOverlay* uo) { QPDFPageDocumentHelper main_pdh(pdf); int main_npages = QIntC::to_int(main_pdh.getAllPages().size()); - processFile(uo->pdf, uo->filename.c_str(), uo->password.get(), true, false); + processFile(uo->pdf, uo->filename.data(), uo->password.data(), true, false); QPDFPageDocumentHelper uo_pdh(*(uo->pdf)); int uo_npages = QIntC::to_int(uo_pdh.getAllPages().size()); try { diff --git a/libqpdf/QPDFJob_config.cc b/libqpdf/QPDFJob_config.cc index 8e85c37..f4f2f36 100644 --- a/libqpdf/QPDFJob_config.cc +++ b/libqpdf/QPDFJob_config.cc @@ -1108,7 +1108,7 @@ QPDFJob::UOConfig::repeat(std::string const& parameter) QPDFJob::UOConfig* QPDFJob::UOConfig::password(std::string const& parameter) { - config->o.m->under_overlay->password = QUtil::make_shared_cstr(parameter); + config->o.m->under_overlay->password = parameter; return this; } -- libgit2 0.21.4