From 863c5e07ba7b11eb303f06ab59f4c18ef48ee163 Mon Sep 17 00:00:00 2001 From: Beat Hangartner Date: Wed, 7 Oct 2026 21:10:30 +0200 Subject: [PATCH] Initialise the read-only flag of the title block logo manager TitleBlockTemplateLogoManager never sets read_only_: its constructor leaves the member uninitialised, and setReadOnly() returns early when the new value equals the member. The template editor calls setReadOnly() right after creating the manager, so whenever the garbage value happened to match, the call did nothing: the add, delete and rename buttons stayed enabled on a read-only template, and isReadOnly() returned garbage. Give the member a default value, false, in the header, matching the buttons' state after construction. Only sources/titleblock/templatelogomanager.h changes. No behaviour change for an editable template: setReadOnly(false) on a manager that is already editable still returns early. No file-format change. Tests: none of their own; an uninitialised read is what a sanitizer finds, and this one is the same kind as the BorderTitleBlock and ConductorProfile fixes (#1358, #1359). ctest on macOS, and all example projects through --resave and --export-svg, unchanged. Co-Authored-By: Claude Fable 5.1 Signed-off-by: Beat Hangartner --- sources/titleblock/templatelogomanager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/titleblock/templatelogomanager.h b/sources/titleblock/templatelogomanager.h index 7e26c9c56..3a4ff5e90 100644 --- a/sources/titleblock/templatelogomanager.h +++ b/sources/titleblock/templatelogomanager.h @@ -73,6 +73,6 @@ class TitleBlockTemplateLogoManager : public QWidget { QLabel *logo_type_; ///< current logo type QDialogButtonBox *buttons_; ///< ok/cancel buttons QDir open_dialog_dir_; ///< last opened directory - bool read_only_; ///< Whether this logo manager should allow logo edition (renaming, addition, deletion) + bool read_only_ = false; ///< Whether this logo manager should allow logo edition (renaming, addition, deletion) }; #endif