#include "lyxlex.h"
#include "outputparams.h"
#include "paragraph.h"
-#include "pariterator.h"
+#include "TocBackend.h"
#include "support/convert.h"
-#include <sstream>
-using lyx::docstring;
+namespace lyx {
using std::string;
using std::endl;
setLabelFont(font);
params_.type = type;
params_.width = LyXLength(50, LyXLength::PCW);
- setInsetName(type);
+ setInsetName(from_utf8(type));
}
switch (cmd.action) {
case LFUN_INSET_MODIFY: {
InsetWrapParams params;
- InsetWrapMailer::string2params(lyx::to_utf8(cmd.argument()), params);
+ InsetWrapMailer::string2params(to_utf8(cmd.argument()), params);
params_.placement = params.placement;
params_.width = params.width;
break;
}
-int InsetWrap::latex(Buffer const & buf, ostream & os,
- OutputParams const & runparams) const
+int InsetWrap::latex(Buffer const & buf, odocstream & os,
+ OutputParams const & runparams) const
{
- os << "\\begin{floating" << params_.type << '}';
+ os << "\\begin{floating" << from_ascii(params_.type) << '}';
if (!params_.placement.empty())
- os << '[' << params_.placement << ']';
- os << '{' << params_.width.asLatexString() << "}%\n";
+ os << '[' << from_ascii(params_.placement) << ']';
+ os << '{' << from_ascii(params_.width.asLatexString()) << "}%\n";
int const i = InsetText::latex(buf, os, runparams);
- os << "\\end{floating" << params_.type << "}%\n";
+ os << "\\end{floating" << from_ascii(params_.type) << "}%\n";
return i + 2;
}
-int InsetWrap::docbook(Buffer const & buf, ostream & os,
- OutputParams const & runparams) const
+int InsetWrap::plaintext(Buffer const & buf, odocstream & os,
+ OutputParams const & runparams) const
{
- os << '<' << params_.type << '>';
+ os << '[' << _("wrap") << ' ' << floatName(params_.type, buf.params()) << ":\n";
+ InsetText::plaintext(buf, os, runparams);
+ os << "\n]";
+
+ return PLAINTEXT_NEWLINE + 1; // one char on a separate line
+}
+
+
+int InsetWrap::docbook(Buffer const & buf, odocstream & os,
+ OutputParams const & runparams) const
+{
+ // FIXME UNICODE
+ os << '<' << from_ascii(params_.type) << '>';
int const i = InsetText::docbook(buf, os, runparams);
- os << "</" << params_.type << '>';
+ os << "</" << from_ascii(params_.type) << '>';
return i;
}
}
-void InsetWrap::addToToc(lyx::toc::TocList & toclist, Buffer const & buf) const
+void InsetWrap::addToToc(TocList & toclist, Buffer const & buf) const
{
- 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;
- string const str =
- convert<string>(toclist[type].size() + 1)
- + ". " + pit->asString(buf, false);
- lyx::toc::TocItem const item(pit, 0 , str);
- toclist[type].push_back(item);
- }
- }
+ // Is there a need to provide a list of wrap insets?
+ return;
}
params.write(data);
return data.str();
}
+
+
+} // namespace lyx