]> 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 05995019c05312a13315f0aec6d3bfa79f83ca4a..2ca92f23cd23b7d4b95779affd1b0bb8cec53aec 100644 (file)
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "BranchList.h"
-#include "LCursor.h"
+#include "Cursor.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
 #include "gettext.h"
-#include "LColor.h"
-#include "LyXLex.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));
 }
 
 
@@ -84,7 +83,7 @@ void InsetBranch::write(Buffer const & buf, ostream & os) const
 }
 
 
-void InsetBranch::read(Buffer const & buf, LyXLex & lex)
+void InsetBranch::read(Buffer const & buf, Lexer & lex)
 {
        params_.read(lex);
        InsetCollapsable::read(buf, lex);
@@ -94,22 +93,22 @@ void InsetBranch::read(Buffer const & buf, LyXLex & 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);
 }
@@ -122,7 +121,7 @@ bool InsetBranch::showInsetDialog(BufferView * bv) const
 }
 
 
-void InsetBranch::doDispatch(LCursor & cur, FuncRequest & cmd)
+void InsetBranch::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        switch (cmd.action) {
        case LFUN_INSET_MODIFY: {
@@ -178,7 +177,7 @@ void InsetBranch::doDispatch(LCursor & cur, FuncRequest & cmd)
 }
 
 
-bool InsetBranch::getStatus(LCursor & cur, FuncRequest const & cmd,
+bool InsetBranch::getStatus(Cursor & cur, FuncRequest const & cmd,
                FuncStatus & flag) const
 {
        switch (cmd.action) {
@@ -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]";
 
@@ -296,7 +295,7 @@ void InsetBranchMailer::string2params(string const & in,
                return;
 
        istringstream data(in);
-       LyXLex lex(0,0);
+       Lexer lex(0,0);
        lex.setStream(data);
 
        string name;
@@ -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")
@@ -321,7 +320,7 @@ void InsetBranchParams::write(ostream & os) const
 }
 
 
-void InsetBranchParams::read(LyXLex & lex)
+void InsetBranchParams::read(Lexer & lex)
 {
        lex >> branch;
 }