#include "lyxlex.h"
#include "outputparams.h"
#include "paragraph.h"
-#include "pariterator.h"
+#include "TocBackend.h"
#include "support/convert.h"
-using lyx::docstring;
-using lyx::odocstream;
+
+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, odocstream & os,
OutputParams const & runparams) const
{
- os << "\\begin{floating" << lyx::from_ascii(params_.type) << '}';
+ os << "\\begin{floating" << from_ascii(params_.type) << '}';
if (!params_.placement.empty())
- os << '[' << lyx::from_ascii(params_.placement) << ']';
- os << '{' << lyx::from_ascii(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" << lyx::from_ascii(params_.type) << "}%\n";
+ os << "\\end{floating" << from_ascii(params_.type) << "}%\n";
return i + 2;
}
OutputParams const & runparams) const
{
// FIXME UNICODE
- os << '<' << lyx::from_ascii(params_.type) << '>';
+ os << '<' << from_ascii(params_.type) << '>';
int const i = InsetText::docbook(buf, os, runparams);
- os << "</" << lyx::from_ascii(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;
+ Toc & toc = toclist[params_.type];
docstring const str =
- convert<docstring>(toclist[type].size() + 1)
+ convert<docstring>(toc.size() + 1)
+ ". " + pit->asString(buf, false);
- lyx::toc::TocItem const item(pit, 0, str);
- toclist[type].push_back(item);
+ toc.push_back(TocItem(pit, 0, str));
}
}
}
params.write(data);
return data.str();
}
+
+
+} // namespace lyx