mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-03 15:17:29 +00:00
Fix a few things found by CLion
This commit is contained in:
parent
0046de0852
commit
dedf9a06df
@ -1269,9 +1269,9 @@ QPDFJob::doJSONEncrypt(Pipeline* p, bool& first, QPDF& pdf)
|
|||||||
}
|
}
|
||||||
j_parameters.addDictionaryMember("bits", JSON::makeInt(bits));
|
j_parameters.addDictionaryMember("bits", JSON::makeInt(bits));
|
||||||
j_parameters.addDictionaryMember("key", key);
|
j_parameters.addDictionaryMember("key", key);
|
||||||
auto fix_method = [is_encrypted](QPDF::encryption_method_e& m) {
|
auto fix_method = [is_encrypted](QPDF::encryption_method_e& method) {
|
||||||
if (is_encrypted && m == QPDF::e_none) {
|
if (is_encrypted && method == QPDF::e_none) {
|
||||||
m = QPDF::e_rc4;
|
method = QPDF::e_rc4;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
fix_method(stream_method);
|
fix_method(stream_method);
|
||||||
@ -2342,7 +2342,7 @@ QPDFJob::handlePageSpecs(QPDF& pdf, std::vector<std::unique_ptr<QPDF>>& page_hea
|
|||||||
// paths to refer to the same file is a documented workaround for duplicating a page. If
|
// paths to refer to the same file is a documented workaround for duplicating a page. If
|
||||||
// you are using this an example of how to do this with the API, you can just create two
|
// you are using this an example of how to do this with the API, you can just create two
|
||||||
// different QPDF objects to the same underlying file with the same path to achieve the
|
// different QPDF objects to the same underlying file with the same path to achieve the
|
||||||
// same affect.
|
// same effect.
|
||||||
char const* password = page_spec.password.get();
|
char const* password = page_spec.password.get();
|
||||||
if ((!m->encryption_file.empty()) && (password == nullptr) &&
|
if ((!m->encryption_file.empty()) && (password == nullptr) &&
|
||||||
(page_spec.filename == m->encryption_file)) {
|
(page_spec.filename == m->encryption_file)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user