Commit 183e440789c0ff25c2fd932556b7b1d0a8c480d5
1 parent
74e76df0
In QPDFJob::UnderOverlay refactor password handling to use std::string directly
Replaced std::shared_ptr<char> with std::string for passwords in QPDFJob. This simplifies memory management and aligns the implementation with modern C++ standards, improving code readability and maintainability.
Showing
3 changed files
with
3 additions
and
3 deletions
include/qpdf/QPDFJob.hh
libqpdf/QPDFJob.cc
| ... | ... | @@ -1882,7 +1882,7 @@ QPDFJob::validateUnderOverlay(QPDF& pdf, UnderOverlay* uo) |
| 1882 | 1882 | { |
| 1883 | 1883 | QPDFPageDocumentHelper main_pdh(pdf); |
| 1884 | 1884 | int main_npages = QIntC::to_int(main_pdh.getAllPages().size()); |
| 1885 | - processFile(uo->pdf, uo->filename.c_str(), uo->password.get(), true, false); | |
| 1885 | + processFile(uo->pdf, uo->filename.data(), uo->password.data(), true, false); | |
| 1886 | 1886 | QPDFPageDocumentHelper uo_pdh(*(uo->pdf)); |
| 1887 | 1887 | int uo_npages = QIntC::to_int(uo_pdh.getAllPages().size()); |
| 1888 | 1888 | try { | ... | ... |
libqpdf/QPDFJob_config.cc
| ... | ... | @@ -1108,7 +1108,7 @@ QPDFJob::UOConfig::repeat(std::string const& parameter) |
| 1108 | 1108 | QPDFJob::UOConfig* |
| 1109 | 1109 | QPDFJob::UOConfig::password(std::string const& parameter) |
| 1110 | 1110 | { |
| 1111 | - config->o.m->under_overlay->password = QUtil::make_shared_cstr(parameter); | |
| 1111 | + config->o.m->under_overlay->password = parameter; | |
| 1112 | 1112 | return this; |
| 1113 | 1113 | } |
| 1114 | 1114 | ... | ... |