#include "lyxlex.h"
#include "outputparams.h"
#include "paragraph.h"
-#include "pariterator.h"
+#include "TocBackend.h"
#include "support/lstrings.h"
#include "support/convert.h"
-#include <sstream>
-
namespace lyx {
font.setColor(LColor::collapsable);
setLabelFont(font);
params_.type = type;
- setInsetName(type);
+ setInsetName(from_utf8(type));
}
int InsetFloat::latex(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
FloatList const & floats = buf.params().getLyXTextClass().floats();
string tmptype = (params_.wide ? params_.type + "*" : params_.type);
}
+int InsetFloat::plaintext(Buffer const & buf, odocstream & os,
+ OutputParams const & runparams) const
+{
+ os << '[' << _("float") << ' ' << floatName(params_.type, buf.params()) << ":\n";
+ InsetText::plaintext(buf, os, runparams);
+ os << "\n]";
+
+ return PLAINTEXT_NEWLINE + 1; // one char on a separate line
+}
+
+
int InsetFloat::docbook(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
// FIXME UNICODE
os << '<' << from_ascii(params_.type) << '>';
}
-void InsetFloat::addToToc(toc::TocList & toclist, Buffer const & buf) const
+void InsetFloat::addToToc(TocList & toclist, Buffer const & buf) const
{
+ // Is there a need to provide a list of float insets?
+ return;
+
+ // Abdel (01/02/2006): I'll let this code for reference in case
+ // there's a need to do something similar for another kind of
+ // inset.
ParConstIterator pit = par_const_iterator_begin(*this);
ParConstIterator end = par_const_iterator_end(*this);
// Find a caption layout in one of the (child inset's) pars
for (; pit != end; ++pit) {
if (pit->layout()->labeltype == LABEL_SENSITIVE) {
- string const type = params_.type;
+ Toc & toc = toclist[params_.type];
docstring const str =
- convert<docstring>(toclist[type].size() + 1)
+ convert<docstring>(toc.size() + 1)
+ ". " + pit->asString(buf, false);
- toc::TocItem const item(pit, 0, str);
- toclist[type].push_back(item);
+ toc.push_back(TocItem(pit, 0, str));
+ return;
}
}
}