X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetFloatList.cpp;h=7de262f9a20f45c347161d81167fe387be1e4fef;hb=12c7e7dde3851ad894380fd42ba741dd3d0cbcc7;hp=28485ceb0dfa2fa8edb44c3ba75bde29cbcdf567;hpb=cbed4c3cc55ffba60c4feceda886deb8b235fc6c;p=lyx.git diff --git a/src/insets/InsetFloatList.cpp b/src/insets/InsetFloatList.cpp index 28485ceb0d..7de262f9a2 100644 --- a/src/insets/InsetFloatList.cpp +++ b/src/insets/InsetFloatList.cpp @@ -17,11 +17,10 @@ #include "DispatchResult.h" #include "Floating.h" #include "FloatList.h" -#include "FuncRequest.h" +#include "Font.h" #include "Language.h" #include "LaTeXFeatures.h" #include "Lexer.h" -#include "MetricsInfo.h" #include "Paragraph.h" #include "output_xhtml.h" #include "TextClass.h" @@ -40,12 +39,12 @@ namespace lyx { InsetFloatList::InsetFloatList(Buffer * buf) - : InsetCommand(buf, InsetCommandParams(FLOAT_LIST_CODE), "toc") + : InsetCommand(buf, InsetCommandParams(FLOAT_LIST_CODE)) {} InsetFloatList::InsetFloatList(Buffer * buf, string const & type) - : InsetCommand(buf, InsetCommandParams(FLOAT_LIST_CODE), "toc") + : InsetCommand(buf, InsetCommandParams(FLOAT_LIST_CODE)) { setParam("type", from_ascii(type)); } @@ -120,7 +119,18 @@ int InsetFloatList::latex(odocstream & os, OutputParams const &) const FloatList::const_iterator cit = floats[to_ascii(getParam("type"))]; if (cit != floats.end()) { - os << cit->second.listCommand(buffer().params().language->code()); + Floating const & fl = cit->second; + if (fl.needsFloatPkg()) + os << "\\listof{" << getParam("type") << "}{" + << buffer().B_(fl.listName()) << "}\n"; + else { + if (!fl.listCommand().empty()) + os << "\\" << from_ascii(fl.listCommand()) << "\n"; + else + os << "%% " + << bformat(_("LyX cannot generate a list of %1$s"), getParam("type")) + << "\n"; + } } else { os << "%%\\listof{" << getParam("type") << "}{" << bformat(_("List of %1$s"), getParam("type")) @@ -151,6 +161,12 @@ docstring InsetFloatList::xhtml(XHTMLStream &, OutputParams const &) const { string toctype; docstring toclabel; + // FIXME + // Other builtin floats should be handled here. But I'm not sure if that is + // even possible yet, since I'm not sure if we have a TOC for such things. + // If so, then they should define ListName, as non-builtin floats do, and + // then we can use that. + // Really, all floats should define that. if (!cit->second.needsFloatPkg()) { // Only two different types allowed here: string const type = cit->second.floattype(); @@ -219,7 +235,7 @@ docstring InsetFloatList::xhtml(XHTMLStream &, OutputParams const &) const { << html::StartTag("a", parattr) // FIXME XHTML // There ought to be a simple way to customize this. - << XHTMLStream::NextRaw() << "⇘" + << XHTMLStream::NextRaw() << ">" << html::EndTag("a"); xs << html::EndTag("div"); }