From f9357e269b4fb2570a11b6090dbb097cc99d556b Mon Sep 17 00:00:00 2001 From: ispyisail Date: Thu, 30 Jul 2026 18:32:54 +1200 Subject: [PATCH] Fix #531: page-level empty title block variable no longer shadows project-level value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- sources/bordertitleblock.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sources/bordertitleblock.cpp b/sources/bordertitleblock.cpp index 5b884d015..f44553ffe 100644 --- a/sources/bordertitleblock.cpp +++ b/sources/bordertitleblock.cpp @@ -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