]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBranch.cpp
Stupid bug fix.
[lyx.git] / src / insets / InsetBranch.cpp
index 948a8d638842a38ff2e92df34bed37bb9e9ab042..02537c05f60353e75903f4de61e51b2bca2ea906 100644 (file)
@@ -82,9 +82,8 @@ void InsetBranch::setButtonLabel()
        if (!params_.branch.empty()) {
                // FIXME UNICODE
                ColorCode c = lcolor.getFromLyXName(to_utf8(params_.branch));
-               if (c == Color_none) {
+               if (c == Color_none)
                        s = _("Undef: ") + s;
-               }
        }
        if (decoration() == InsetLayout::Classic)
                setLabel(isOpen() ? s : getNewLabel(s) );
@@ -95,15 +94,13 @@ void InsetBranch::setButtonLabel()
 
 ColorCode InsetBranch::backgroundColor() const
 {
-       if (!params_.branch.empty()) {
-               // FIXME UNICODE
-               ColorCode c = lcolor.getFromLyXName(to_utf8(params_.branch));
-               if (c == Color_none) {
-                       c = Color_error;
-               }
-               return c;
-       } else
+       if (params_.branch.empty())
                return Inset::backgroundColor();
+       // FIXME UNICODE
+       ColorCode c = lcolor.getFromLyXName(to_utf8(params_.branch));
+       if (c == Color_none)
+               c = Color_error;
+       return c;
 }
 
 
@@ -282,6 +279,8 @@ void InsetBranch::addToToc(DocIterator const & cpit)
        Toc & toc = buffer().tocBackend().toc("branch");
        docstring const str = params_.branch + ": " + text_.getPar(0).asString();
        toc.push_back(TocItem(pit, 0, str));
+       // Proceed with the rest of the inset.
+       InsetCollapsable::addToToc(cpit);
 }