mirror of
https://github.com/qpdf/qpdf.git
synced 2025-02-02 11:58:25 +00:00
QPDFJob: convert Under/Overlay ranges to strings
This commit is contained in:
parent
e48bfce930
commit
88891a75a2
@ -159,9 +159,9 @@ class QPDFJob
|
||||
std::string which;
|
||||
char const* filename;
|
||||
char const* password;
|
||||
char const* to_nr;
|
||||
char const* from_nr;
|
||||
char const* repeat_nr;
|
||||
std::string to_nr;
|
||||
std::string from_nr;
|
||||
std::string repeat_nr;
|
||||
std::shared_ptr<QPDF> pdf;
|
||||
std::vector<int> to_pagenos;
|
||||
std::vector<int> from_pagenos;
|
||||
|
@ -1945,7 +1945,7 @@ QPDFJob::validateUnderOverlay(QPDF& pdf, QPDFJob::UnderOverlay* uo)
|
||||
int uo_npages = QIntC::to_int(uo_pdh.getAllPages().size());
|
||||
try
|
||||
{
|
||||
uo->to_pagenos = QUtil::parse_numrange(uo->to_nr, main_npages);
|
||||
uo->to_pagenos = QUtil::parse_numrange(uo->to_nr.c_str(), main_npages);
|
||||
}
|
||||
catch (std::runtime_error& e)
|
||||
{
|
||||
@ -1955,16 +1955,17 @@ QPDFJob::validateUnderOverlay(QPDF& pdf, QPDFJob::UnderOverlay* uo)
|
||||
}
|
||||
try
|
||||
{
|
||||
if (0 == strlen(uo->from_nr))
|
||||
if (uo->from_nr.empty())
|
||||
{
|
||||
QTC::TC("qpdf", "qpdf from_nr from repeat_nr");
|
||||
uo->from_nr = uo->repeat_nr;
|
||||
}
|
||||
uo->from_pagenos = QUtil::parse_numrange(uo->from_nr, uo_npages);
|
||||
if (strlen(uo->repeat_nr))
|
||||
uo->from_pagenos =
|
||||
QUtil::parse_numrange(uo->from_nr.c_str(), uo_npages);
|
||||
if (! uo->repeat_nr.empty())
|
||||
{
|
||||
uo->repeat_pagenos =
|
||||
QUtil::parse_numrange(uo->repeat_nr, uo_npages);
|
||||
QUtil::parse_numrange(uo->repeat_nr.c_str(), uo_npages);
|
||||
}
|
||||
}
|
||||
catch (std::runtime_error& e)
|
||||
|
Loading…
x
Reference in New Issue
Block a user