mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
XFA: bugfixing - merge positional layout into one
This commit is contained in:
@ -10467,9 +10467,20 @@ bool PDFXFALayoutEngine::layoutPositional(LayoutParameters& sourceLayoutParamete
|
|||||||
layout.updatePresence(targetLayoutParameters.presence);
|
layout.updatePresence(targetLayoutParameters.presence);
|
||||||
}
|
}
|
||||||
|
|
||||||
Layout finalLayout;
|
auto it = std::find_if(targetLayoutParameters.layout.begin(), targetLayoutParameters.layout.end(), [pageIndex](const auto& layout) { return layout.pageIndex == pageIndex; });
|
||||||
finalLayout.pageIndex = pageIndex;
|
if (it == targetLayoutParameters.layout.end())
|
||||||
|
{
|
||||||
|
QSizeF nominalExtentSize = targetLayoutParameters.sizeInfo.effSize;
|
||||||
|
|
||||||
|
Layout createdLayout;
|
||||||
|
createdLayout.pageIndex = pageIndex;
|
||||||
|
createdLayout.nominalExtent = QRectF(QPointF(0, 0), nominalExtentSize);
|
||||||
|
createdLayout.colSpan = targetLayoutParameters.columnSpan;
|
||||||
|
targetLayoutParameters.layout.push_back(createdLayout);
|
||||||
|
it = std::next(targetLayoutParameters.layout.begin(), targetLayoutParameters.layout.size() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
Layout& finalLayout = *it;
|
||||||
PDFReal x = sourceLayoutParameters.xOffset + targetLayoutParameters.margins.left() + captionMargins.left();
|
PDFReal x = sourceLayoutParameters.xOffset + targetLayoutParameters.margins.left() + captionMargins.left();
|
||||||
PDFReal y = sourceLayoutParameters.yOffset + targetLayoutParameters.margins.top() + captionMargins.top();
|
PDFReal y = sourceLayoutParameters.yOffset + targetLayoutParameters.margins.top() + captionMargins.top();
|
||||||
|
|
||||||
@ -10526,13 +10537,9 @@ bool PDFXFALayoutEngine::layoutPositional(LayoutParameters& sourceLayoutParamete
|
|||||||
finalLayout.items.insert(finalLayout.items.end(), layout.items.begin(), layout.items.end());
|
finalLayout.items.insert(finalLayout.items.end(), layout.items.begin(), layout.items.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
QSizeF nominalExtentSize = targetLayoutParameters.sizeInfo.effSize;
|
if (finalLayout.items.empty())
|
||||||
finalLayout.nominalExtent = QRectF(QPointF(0, 0), nominalExtentSize);
|
|
||||||
finalLayout.colSpan = targetLayoutParameters.columnSpan;
|
|
||||||
|
|
||||||
if (!finalLayout.items.empty())
|
|
||||||
{
|
{
|
||||||
targetLayoutParameters.layout.emplace_back(std::move(finalLayout));
|
targetLayoutParameters.layout.pop_back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user