Commit 9b4c8ea5 authored by Volker Krause's avatar Volker Krause
Browse files

Work around RCT2 fields claiming to have a 0x0 size

Found in PKP samples.
parent af8731a5
Pipeline #213764 passed with stage
in 3 minutes and 29 seconds
......@@ -151,10 +151,13 @@ QString Uic9183TicketLayout::text(int row, int column, int width, int height) co
}
for (auto f = firstField(); !f.isNull(); f = f.next()) {
if (f.row() + f.height() - 1 < row || f.row() > row + height - 1) {
// there's non-compliant samples out there with zero field sizes...
const auto effectiveHeight = std::max(f.height(), 1);
if (f.row() + effectiveHeight - 1 < row || f.row() > row + height - 1) {
continue;
}
if (f.column() + f.width() - 1 < column || f.column() > column + width - 1) {
const auto effectiveFieldWidth = f.width() > 0 ? f.width() : f.size();
if (f.column() + effectiveFieldWidth - 1 < column || f.column() > column + width - 1) {
continue;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment