Build the folios before reading the drawn items' view (stage D6)

A query of drawing_item_view, which is made of the shape, text and
picture tables, built no folio, and with folios built only when needed
(the default since D6) it found nothing: the drawn items are written to
the database by built folios. A query naming the view builds them, as
one naming the tables does.

Found by the qet MCP server's suite (four drawn-item tests failed lazily,
passed with every folio built). tst_lazyfolios: the view's rows from a
.qetz as when built (5 = 5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ispyisail
2026-10-12 21:46:37 +13:00
parent 975ec57c74
commit a6d81a21a8
2 changed files with 17 additions and 3 deletions
+4 -3
View File
@@ -1660,10 +1660,11 @@ QSqlQuery projectDataBase::newQuery(const QString &query, QString *error) {
//storeConductorProperties().
//The drawing tables hold what only built items know (a text's
//laid-out size, a picture's pixels): with folios not built yet
//(lazy folios) a read of them builds those first. Every other
//table was filled from the document.
//(lazy folios) a read of them builds those first, and so does a
//read of the view made of them. Every other table was filled from
//the document.
static const QRegularExpression drawing_tables(
QStringLiteral("\\b(shape|independent_text|image)\\b"),
QStringLiteral("\\b(shape|independent_text|image|drawing_item_view)\\b"),
QRegularExpression::CaseInsensitiveOption);
if (m_project && m_project->unloadedFolioCount() && drawing_tables.match(query).hasMatch()) {
m_project->loadFolios();