#include "gettext.h"
#include "Color.h"
#include "Lexer.h"
-#include "Paragraph.h"
#include "OutputParams.h"
#include <sstream>
font.decSize();
docstring s = _("Branch: ") + params_.branch;
- font.setColor(Color::foreground);
if (!params_.branch.empty()) {
// FIXME UNICODE
Color_color c = lcolor.getFromLyXName(to_utf8(params_.branch));
if (c == Color::none) {
- c = Color::error;
s = _("Undef: ") + s;
}
- setBackgroundColor(c);
- } else
- setBackgroundColor(Color::background);
+ }
+ font.setColor(Color::foreground);
setLabel(isOpen() ? s : getNewLabel(s) );
setLabelFont(font);
}
+Color_color InsetBranch::backgroundColor() const
+{
+ if (!params_.branch.empty()) {
+ // FIXME UNICODE
+ Color_color c = lcolor.getFromLyXName(to_utf8(params_.branch));
+ if (c == Color::none) {
+ c = Color::error;
+ }
+ return c;
+ } else
+ return Inset::backgroundColor();
+}
+
+
bool InsetBranch::showInsetDialog(BufferView * bv) const
{
InsetBranchMailer(const_cast<InsetBranch &>(*this)).showDialog(bv);
case LFUN_INSET_TOGGLE:
- if (cmd.argument() == "assign" || cmd.argument().empty()) {
+ if (cmd.argument() == "assign") {
// The branch inset uses "assign".
if (isBranchSelected(cur.buffer())) {
if (status() != Open)
int InsetBranch::latex(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
return isBranchSelected(buf) ?
InsetText::latex(buf, os, runparams) : 0;
int InsetBranch::plaintext(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
if (!isBranchSelected(buf))
return 0;
- os << '[' << _("branch") << ' ' << params_.branch << ":\n";
+ os << '[' << buf.B_("branch") << ' ' << params_.branch << ":\n";
InsetText::plaintext(buf, os, runparams);
os << "\n]";
int InsetBranch::docbook(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
return isBranchSelected(buf) ?
InsetText::docbook(buf, os, runparams) : 0;
return print_mailer_error("InsetBranchMailer", in, 1, name_);
// This is part of the inset proper that is usually swallowed
- // by LyXText::readInset
+ // by Text::readInset
string id;
lex >> id;
if (!lex || id != "Branch")