mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-02 22:50:20 +00:00
Minor fixes
This commit is contained in:
parent
3e74916c5a
commit
06d6438ddf
@ -1,3 +1,9 @@
|
|||||||
|
2019-01-02 Jay Berkenbilt <ejb@ql.org>
|
||||||
|
|
||||||
|
* Add method QPDFObjectHandle::getResourceNames that returns a set
|
||||||
|
of strings representing all second-level keys in a dictionary
|
||||||
|
(i.e. all keys of all direct dictionary members).
|
||||||
|
|
||||||
2018-12-31 Jay Berkenbilt <ejb@ql.org>
|
2018-12-31 Jay Berkenbilt <ejb@ql.org>
|
||||||
|
|
||||||
* Add methods for flattening form fields and annotations:
|
* Add methods for flattening form fields and annotations:
|
||||||
|
@ -164,7 +164,8 @@ QPDFPageDocumentHelper::flattenAnnotationsForPage(
|
|||||||
}
|
}
|
||||||
std::set<std::string> names = resources.getResourceNames();
|
std::set<std::string> names = resources.getResourceNames();
|
||||||
std::string name;
|
std::string name;
|
||||||
while (next_fx < 1000000)
|
int max_fx = next_fx + names.size() + 1;
|
||||||
|
while (next_fx <= max_fx)
|
||||||
{
|
{
|
||||||
std::string candidate = "/Fxo" + QUtil::int_to_string(next_fx);
|
std::string candidate = "/Fxo" + QUtil::int_to_string(next_fx);
|
||||||
++next_fx;
|
++next_fx;
|
||||||
@ -176,9 +177,9 @@ QPDFPageDocumentHelper::flattenAnnotationsForPage(
|
|||||||
}
|
}
|
||||||
if (name.empty())
|
if (name.empty())
|
||||||
{
|
{
|
||||||
// There are already more than a million /Fxo names.
|
// This could only happen if there is a coding error.
|
||||||
// Somehow I doubt this is going to actually happen.
|
// The number of candidates we test is more than the
|
||||||
// Just pick a name and forget conflicts.
|
// number of keys we're checking against.
|
||||||
name = "/FxConflict";
|
name = "/FxConflict";
|
||||||
}
|
}
|
||||||
resources.mergeResources(
|
resources.mergeResources(
|
||||||
|
Loading…
Reference in New Issue
Block a user