]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBranch.cpp
Remove color dependency of framed note, fix bug 3598
[lyx.git] / src / insets / InsetBranch.cpp
index 29f19e9ba77ed2225149e26a6cefb8c6d108c64b..2ca92f23cd23b7d4b95779affd1b0bb8cec53aec 100644 (file)
@@ -20,7 +20,7 @@
 #include "FuncRequest.h"
 #include "FuncStatus.h"
 #include "gettext.h"
-#include "LColor.h"
+#include "Color.h"
 #include "Lexer.h"
 #include "Paragraph.h"
 #include "OutputParams.h"
@@ -39,7 +39,6 @@ using std::ostringstream;
 
 void InsetBranch::init()
 {
-       setInsetName(from_utf8("Branch"));
        setButtonLabel();
 }
 
@@ -65,9 +64,9 @@ InsetBranch::~InsetBranch()
 }
 
 
-auto_ptr<InsetBase> InsetBranch::doClone() const
+auto_ptr<Inset> InsetBranch::doClone() const
 {
-       return auto_ptr<InsetBase>(new InsetBranch(*this));
+       return auto_ptr<Inset>(new InsetBranch(*this));
 }
 
 
@@ -94,22 +93,22 @@ void InsetBranch::read(Buffer const & buf, Lexer & lex)
 
 void InsetBranch::setButtonLabel()
 {
-       LyXFont font(LyXFont::ALL_SANE);
+       Font font(Font::ALL_SANE);
        font.decSize();
        font.decSize();
 
        docstring s = _("Branch: ") + params_.branch;
-       font.setColor(LColor::foreground);
+       font.setColor(Color::foreground);
        if (!params_.branch.empty()) {
                // FIXME UNICODE
-               LColor_color c = lcolor.getFromLyXName(to_utf8(params_.branch));
-               if (c == LColor::none) {
-                       c = LColor::error;
+               Color_color c = lcolor.getFromLyXName(to_utf8(params_.branch));
+               if (c == Color::none) {
+                       c = Color::error;
                        s = _("Undef: ") + s;
                }
                setBackgroundColor(c);
        } else
-               setBackgroundColor(LColor::background);
+               setBackgroundColor(Color::background);
        setLabel(isOpen() ? s : getNewLabel(s) );
        setLabelFont(font);
 }
@@ -236,7 +235,7 @@ int InsetBranch::plaintext(Buffer const & buf, odocstream & os,
        if (!isBranchSelected(buf))
                return 0;
 
-       os << '[' << _("branch") << ' ' << params_.branch << ":\n";
+       os << '[' << buf.B_("branch") << ' ' << params_.branch << ":\n";
        InsetText::plaintext(buf, os, runparams);
        os << "\n]";
 
@@ -305,7 +304,7 @@ void InsetBranchMailer::string2params(string const & in,
                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")