#include "LaTeXFeatures.h"
#include "Lexer.h"
#include "MetricsInfo.h"
-#include "TocBackend.h"
#include "TextClass.h"
+#include "TocBackend.h"
#include "support/debug.h"
#include "support/gettext.h"
{
static ParamInfo param_info_;
if (param_info_.empty()) {
- param_info_.add("type", false);
+ param_info_.add("type", ParamInfo::LATEX_REQUIRED);
}
return param_info_;
}
}
-docstring const InsetFloatList::getScreenLabel(Buffer const & buf) const
+docstring InsetFloatList::screenLabel() const
{
- FloatList const & floats = buf.params().textClass().floats();
+ FloatList const & floats = buffer().params().documentClass().floats();
FloatList::const_iterator it = floats[to_ascii(getParam("type"))];
if (it != floats.end())
- return buf.B_(it->second.listName());
+ return buffer().B_(it->second.listName());
else
return _("ERROR: Nonexistent float type!");
}
-void InsetFloatList::write(Buffer const &, ostream & os) const
+void InsetFloatList::write(ostream & os) const
{
os << "FloatList " << to_ascii(getParam("type")) << "\n";
}
-void InsetFloatList::read(Buffer const & buf, Lexer & lex)
+void InsetFloatList::read(Lexer & lex)
{
- FloatList const & floats = buf.params().textClass().floats();
+ lex.setContext("InsetFloatList::read");
+ FloatList const & floats = buffer().params().documentClass().floats();
string token;
if (lex.eatLine()) {
LYXERR(Debug::INSETS, "FloatList::float_type: "
<< to_ascii(getParam("type")));
if (!floats.typeExist(to_ascii(getParam("type"))))
- lex.printError("InsetFloatList: Unknown float type: `$$Token'");
+ lex.printError("Unknown float type");
} else {
- lex.printError("InsetFloatList: Parse error: `$$Token'");
+ lex.printError("Parse error");
}
while (lex.isOK()) {
break;
}
if (token != "\\end_inset") {
- lex.printError("Missing \\end_inset at this point. "
- "Read: `$$Token'");
+ lex.printError("Missing \\end_inset at this point.");
}
}
-int InsetFloatList::latex(Buffer const & buf, odocstream & os,
- OutputParams const &) const
+int InsetFloatList::latex(odocstream & os, OutputParams const &) const
{
- FloatList const & floats = buf.params().textClass().floats();
+ FloatList const & floats = buffer().params().documentClass().floats();
FloatList::const_iterator cit = floats[to_ascii(getParam("type"))];
if (cit != floats.end()) {
}
} else {
os << "\\listof{" << getParam("type") << "}{"
- << buf.B_(cit->second.listName()) << "}\n";
+ << buffer().B_(cit->second.listName()) << "}\n";
}
} else {
os << "%%\\listof{" << getParam("type") << "}{"
}
-int InsetFloatList::plaintext(Buffer const & buffer, odocstream & os,
- OutputParams const &) const
+int InsetFloatList::plaintext(odocstream & os, OutputParams const &) const
{
- os << getScreenLabel(buffer) << "\n\n";
+ os << screenLabel() << "\n\n";
- buffer.tocBackend().writePlaintextTocList(to_ascii(getParam("type")), os);
+ buffer().tocBackend().writePlaintextTocList(to_ascii(getParam("type")), os);
return PLAINTEXT_NEWLINE;
}