X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetwrap.C;h=570802c50d70b6371f71452d6cf531b577cd2b32;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=fe8abfe996761172719b1ca88c3042c8a1fee80e;hpb=0d449056ef9ace3ef737e4b9aba8d3994615dc18;p=lyx.git diff --git a/src/insets/insetwrap.C b/src/insets/insetwrap.C index fe8abfe996..570802c50d 100644 --- a/src/insets/insetwrap.C +++ b/src/insets/insetwrap.C @@ -28,12 +28,12 @@ #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; @@ -54,7 +54,7 @@ InsetWrap::InsetWrap(BufferParams const & bp, string const & type) setLabelFont(font); params_.type = type; params_.width = LyXLength(50, LyXLength::PCW); - setInsetName(type); + setInsetName(from_utf8(type)); } @@ -69,7 +69,7 @@ void InsetWrap::doDispatch(LCursor & cur, FuncRequest & cmd) 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; @@ -182,12 +182,12 @@ docstring const InsetWrap::editMessage() const 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; } @@ -196,9 +196,9 @@ int InsetWrap::docbook(Buffer const & buf, odocstream & os, 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 << "'; + os << "'; return i; } @@ -224,7 +224,7 @@ bool InsetWrap::showInsetDialog(BufferView * bv) const } -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); @@ -232,12 +232,11 @@ void InsetWrap::addToToc(lyx::toc::TocList & toclist, Buffer const & buf) const // 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(toclist[type].size() + 1) + convert(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)); } } } @@ -291,3 +290,6 @@ string const InsetWrapMailer::params2string(InsetWrapParams const & params) params.write(data); return data.str(); } + + +} // namespace lyx