Adding forced update to Layout writer to ensure proper files. A warning is given.

This commit is contained in:
Matthias Koefferlein 2024-10-26 22:46:09 +02:00
parent 1407ae13a7
commit 946729f14d
1 changed files with 5 additions and 0 deletions

View File

@ -58,6 +58,11 @@ Writer::write (db::Layout &layout, tl::OutputStream &stream)
{
tl::SelfTimer timer (tl::verbosity () >= 21, tl::to_string (tr ("Writing file: ")) + stream.path ());
if (layout.under_construction ()) {
tl::warn << tl::to_string (tr ("Cannot properly write a layout that is under construction - forcing update."));
layout.force_update ();
}
tl_assert (mp_writer != 0);
mp_writer->write (layout, stream, m_options);
}