#include "BufferView.h"
#include "funcrequest.h"
#include "gettext.h"
+#include "LColor.h"
#include "lyxlex.h"
#include "paragraph.h"
void InsetBranch::init()
{
setInsetName("Branch");
+ 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);
}
case LFUN_INSET_EDIT:
if (cmd.button() != mouse_button::button3)
return InsetCollapsable::localDispatch(cmd);
-
+
return UNDISPATCHED;
case LFUN_INSET_DIALOG_UPDATE:
InsetBranchMailer("branch", *this).updateDialog(bv);
}
-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);
params.write(data);
// Add all_branches parameter to data:
data << params.branchlist.allBranches() << "\n";
- return STRCONV(data.str());
+ return data.str();
}
if (in.empty())
return;
- istringstream data(STRCONV(in));
+ istringstream data(in);
LyXLex lex(0,0);
lex.setStream(data);
params.read(lex);