Fix #531: page-level empty title block variable no longer shadows project-level value

BorderTitleBlock::updateDiagramContextForTitleBlock() merged the page's
"additional fields" over the project-level context unconditionally,
even when the page-level value was empty. Since #495 auto-adds every
template custom variable to the folio's Custom tab with an empty
value (so the user only has to fill in what's missing), simply
opening/confirming the Folio Properties dialog now permanently blanks
out any project-level custom variable of the same name — and it's
self-perpetuating, since the dialog re-adds the empty entry every time
it's reopened.

Skip page-level values that are empty when merging, so a real
project-level value shows through. An explicit non-empty page-level
override still takes precedence as before.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
ispyisail
2026-07-30 18:32:54 +12:00
parent 88962570a8
commit f9357e269b
+5 -1
View File
@@ -898,9 +898,13 @@ void BorderTitleBlock::updateDiagramContextForTitleBlock(
const DiagramContext &initial_context) {
// Our final DiagramContext is the initial one (which is supposed to bring
// project-wide properties), overridden by the "additional fields" one...
// An empty page-level value means the variable was auto-added to the
// folio's Custom tab (#495) but never actually set by the user, so it
// must not shadow a real project-level value of the same name (#531).
DiagramContext context = initial_context;
foreach (QString key, additional_fields_.keys()) {
context.addValue(key, additional_fields_[key]);
if (!additional_fields_[key].toString().isEmpty())
context.addValue(key, additional_fields_[key]);
}
// ... overridden by the historical and/or dynamically generated fields