#include "debug.h"
#include "FloatList.h"
#include "FuncRequest.h"
-#include "Color.h"
#include "Lexer.h"
#include "LyX.h"
case LFUN_FLEX_INSERT: {
string s = cmd.getArg(0);
- TextClass tclass = params.getTextClass();
- InsetLayout il = tclass.insetlayout(from_utf8(s));
+ TextClass const & tclass = params.getTextClass();
+ InsetLayout const & il = tclass.insetlayout(from_utf8(s));
return new InsetFlex(params, il);
}
auto_ptr<InsetCaption> inset(new InsetCaption(params));
inset->setAutoBreakRows(true);
inset->setDrawFrame(true);
- inset->setFrameColor(Color::captionframe);
+ inset->setFrameColor(Color_captionframe);
return inset.release();
}
}
case INCLUDE_CODE: {
- InsetCommandParams iip(code);
- InsetIncludeMailer::string2params(to_utf8(cmd.argument()), iip);
- return new InsetInclude(iip);
+ InsetCommandParams icp(code);
+ InsetCommandMailer::string2params(name, to_utf8(cmd.argument()), icp);
+ return new InsetInclude(icp);
}
case INDEX_CODE:
auto_ptr<Inset> inset;
- TextClass tclass = buf.params().getTextClass();
+ TextClass const & tclass = buf.params().getTextClass();
lex.next();
string tmptok = lex.getString();
case HYPERLINK_CODE:
inset.reset(new InsetHyperlink(inscmd));
break;
- // FIXME Currently non-functional, since InsetInclude
- // does not write itself as a CommandInset.
case INCLUDE_CODE:
inset.reset(new InsetInclude(inscmd));
break;
- case INDEX_CODE:
- inset.reset(new InsetIndex(buf.params()));
- break;
case INDEX_PRINT_CODE:
inset.reset(new InsetPrintIndex(inscmd));
break;
} else if (tmptok == "Flex") {
lex.next();
string s = lex.getString();
- InsetLayout il = tclass.insetlayout(from_utf8(s));
+ InsetLayout const & il = tclass.insetlayout(from_utf8(s));
inset.reset(new InsetFlex(buf.params(), il));
} else if (tmptok == "Branch") {
inset.reset(new InsetBranch(buf.params(),
InsetBranchParams()));
- } else if (tmptok == "Include") {
- //FIXME
- InsetCommandParams p(INCLUDE_CODE);
- inset.reset(new InsetInclude(p));
} else if (tmptok == "Environment") {
lex.next();
inset.reset(new InsetEnvironment(buf.params(), lex.getDocString()));
}
inset->read(buf, lex);
-
-// FIXME: hack..
- if (inset->lyxCode() == MATHMACRO_CODE) {
- MathMacroTemplate const * tmpl =
- static_cast<MathMacroTemplate*>(inset.get());
- MacroTable::globalMacros().insert
- (tmpl->name(), tmpl->asMacroData());
- LYXERR(Debug::DEBUG)
- << BOOST_CURRENT_FUNCTION
- << ": creating local macro " << to_utf8(tmpl->name())
- << endl;
- }
}
return inset.release();