X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetFloatList.cpp;h=f3299d899f7892d7c7e1fa79c892818d0c8ad6b8;hb=0362c6aae73c293d1c20277c12d362acfe0b2ef6;hp=808bbd4f6c71cafe864da4b2e3ea1cc7e67f3756;hpb=e158e07c29a2066ac408d1b0038382623180da9c;p=lyx.git diff --git a/src/insets/InsetFloatList.cpp b/src/insets/InsetFloatList.cpp index 808bbd4f6c..f3299d899f 100644 --- a/src/insets/InsetFloatList.cpp +++ b/src/insets/InsetFloatList.cpp @@ -14,27 +14,26 @@ #include "Buffer.h" #include "BufferParams.h" -#include "debug.h" #include "DispatchResult.h" #include "Floating.h" #include "FloatList.h" #include "FuncRequest.h" -#include "gettext.h" #include "LaTeXFeatures.h" #include "Lexer.h" #include "MetricsInfo.h" #include "TocBackend.h" +#include "TextClass.h" +#include "support/debug.h" +#include "support/gettext.h" #include "support/lstrings.h" +#include -namespace lyx { - -using support::bformat; +using namespace std; +using namespace lyx::support; -using std::endl; -using std::string; -using std::ostream; +namespace lyx { InsetFloatList::InsetFloatList() @@ -49,9 +48,27 @@ InsetFloatList::InsetFloatList(string const & type) } +ParamInfo const & InsetFloatList::findInfo(string const & /* cmdName */) +{ + static ParamInfo param_info_; + if (param_info_.empty()) { + param_info_.add("type", false); + } + return param_info_; +} + + +//HACK +bool InsetFloatList::isCompatibleCommand(string const & s) +{ + string str = s.substr(0, 6); + return str == "listof"; +} + + docstring const InsetFloatList::getScreenLabel(Buffer const & buf) const { - FloatList const & floats = buf.params().getTextClass().floats(); + FloatList const & floats = buf.params().textClass().floats(); FloatList::const_iterator it = floats[to_ascii(getParam("type"))]; if (it != floats.end()) return buf.B_(it->second.listName()); @@ -68,17 +85,19 @@ void InsetFloatList::write(Buffer const &, ostream & os) const void InsetFloatList::read(Buffer const & buf, Lexer & lex) { - FloatList const & floats = buf.params().getTextClass().floats(); + FloatList const & floats = buf.params().textClass().floats(); string token; if (lex.eatLine()) { setParam("type", lex.getDocString()); - LYXERR(Debug::INSETS) << "FloatList::float_type: " - << to_ascii(getParam("type")) << endl; + LYXERR(Debug::INSETS, "FloatList::float_type: " + << to_ascii(getParam("type"))); if (!floats.typeExist(to_ascii(getParam("type")))) lex.printError("InsetFloatList: Unknown float type: `$$Token'"); - } else + } else { lex.printError("InsetFloatList: Parse error: `$$Token'"); + } + while (lex.isOK()) { lex.next(); token = lex.getString(); @@ -95,7 +114,7 @@ void InsetFloatList::read(Buffer const & buf, Lexer & lex) int InsetFloatList::latex(Buffer const & buf, odocstream & os, OutputParams const &) const { - FloatList const & floats = buf.params().getTextClass().floats(); + FloatList const & floats = buf.params().textClass().floats(); FloatList::const_iterator cit = floats[to_ascii(getParam("type"))]; if (cit != floats.end()) {