mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-03 10:34:14 +02:00
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:
@@ -898,8 +898,12 @@ void BorderTitleBlock::updateDiagramContextForTitleBlock(
|
|||||||
const DiagramContext &initial_context) {
|
const DiagramContext &initial_context) {
|
||||||
// Our final DiagramContext is the initial one (which is supposed to bring
|
// Our final DiagramContext is the initial one (which is supposed to bring
|
||||||
// project-wide properties), overridden by the "additional fields" one...
|
// 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;
|
DiagramContext context = initial_context;
|
||||||
foreach (QString key, additional_fields_.keys()) {
|
foreach (QString key, additional_fields_.keys()) {
|
||||||
|
if (!additional_fields_[key].toString().isEmpty())
|
||||||
context.addValue(key, additional_fields_[key]);
|
context.addValue(key, additional_fields_[key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user