From 1bc5453cab892190760a81c951fa1f0851b74728 Mon Sep 17 00:00:00 2001 From: Richard Kimberly Heck Date: Fri, 17 Nov 2023 19:31:55 -0500 Subject: [PATCH] Amend 28e8bf742. The default 'empty' layout has "UNDEFINED" for the LabelString. --- src/insets/InsetBranch.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp index 2118a6f947..7a97e2c3b4 100644 --- a/src/insets/InsetBranch.cpp +++ b/src/insets/InsetBranch.cpp @@ -118,10 +118,18 @@ docstring const InsetBranch::buttonLabel(BufferView const &) const if (decoration() == InsetDecoration::MINIMALISTIC) return symb + inv_symb + params_.branch; - InsetLayout const & il = getLayout(); - docstring const & label_string = il.labelstring(); - if (!label_string.empty()) - return symb + inv_symb + label_string; + if (!buffer_) { + return symb + inv_symb + _("Branch (undefined): ") + + params_.branch; + } + bool const has_layout = + buffer().params().documentClass().hasInsetLayout(layoutName()); + if (has_layout) { + InsetLayout const & il = getLayout(); + docstring const & label_string = il.labelstring(); + if (!label_string.empty()) + return symb + inv_symb + label_string; + } docstring s; if (inmaster && inchild) s = _("Branch: "); -- 2.39.5