]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbranch.C
insetbranch.C (linuxdoc, docbook): minor fix.
[lyx.git] / src / insets / insetbranch.C
index af18dd23cde5062188dacc8b6864af3611e07658..0193d450ef60e82e815903e61ed75915f2499900 100644 (file)
@@ -32,6 +32,7 @@ using std::ostringstream;
 void InsetBranch::init()
 {
        setInsetName("Branch");
+       setButtonLabel();
 }
 
 
@@ -98,10 +99,9 @@ void InsetBranch::setButtonLabel()
 
        setLabel("Branch: " + params_.branch);
        font.setColor(LColor::foreground);
-       string const color = params_.branchlist.getColor(params_.branch);
-       if (!color.empty()) {
+       if (!params_.branch.empty())
                setBackgroundColor(lcolor.getFromLyXName(params_.branch));
-       else
+       else
                setBackgroundColor(LColor::background);
        setLabelFont(font);
 }
@@ -157,15 +157,17 @@ int InsetBranch::latex(Buffer const & buf, ostream & os,
 }
 
 
-int InsetBranch::linuxdoc(Buffer const &, std::ostream &) const
+int InsetBranch::linuxdoc(Buffer const & buf, std::ostream & os) const
 {
-       return 0;
+       string const branch_sel = buf.params().branchlist().allSelected();
+       if (branch_sel.find(params_.branch, 0) != string::npos)
+               return inset.linuxdoc(buf, os);
+       return 0;
 }
 
 
 int InsetBranch::docbook(Buffer const & buf, std::ostream & os, bool mixcont) const
 {
-       // untested - MV
        string const branch_sel = buf.params().branchlist().allSelected();
        if (branch_sel.find(params_.branch, 0) != string::npos)
                return inset.docbook(buf, os, mixcont);