X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetFloat.cpp;h=c83fb96635906cebc028f5192fbd17cbab618eff;hb=d3e30f8d9b68d51141290c7f4888040e9cfbaffa;hp=5a5e2e2366fd1fda4259d0b581dbce775bde4714;hpb=42123ab8a71080b6d15fca4e0c43ae76abf00a1e;p=lyx.git diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp index 5a5e2e2366..c83fb96635 100644 --- a/src/insets/InsetFloat.cpp +++ b/src/insets/InsetFloat.cpp @@ -25,7 +25,7 @@ #include "FuncStatus.h" #include "gettext.h" #include "LaTeXFeatures.h" -#include "LColor.h" +#include "Color.h" #include "Lexer.h" #include "OutputParams.h" #include "Paragraph.h" @@ -116,16 +116,15 @@ using std::ostringstream; InsetFloat::InsetFloat(BufferParams const & bp, string const & type) - : InsetCollapsable(bp) + : InsetCollapsable(bp), name_(from_utf8(type)) { setLabel(_("float: ") + floatName(type, bp)); - LyXFont font(LyXFont::ALL_SANE); + Font font(Font::ALL_SANE); font.decSize(); font.decSize(); - font.setColor(LColor::collapsable); + font.setColor(Color::collapsable); setLabelFont(font); params_.type = type; - setInsetName(from_utf8(type)); } @@ -267,9 +266,9 @@ void InsetFloat::validate(LaTeXFeatures & features) const } -auto_ptr InsetFloat::doClone() const +auto_ptr InsetFloat::doClone() const { - return auto_ptr(new InsetFloat(*this)); + return auto_ptr(new InsetFloat(*this)); } @@ -280,9 +279,9 @@ docstring const InsetFloat::editMessage() const int InsetFloat::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { - FloatList const & floats = buf.params().getLyXTextClass().floats(); + FloatList const & floats = buf.params().getTextClass().floats(); string tmptype = (params_.wide ? params_.type + "*" : params_.type); if (params_.sideways) { if (params_.type == "table") @@ -329,9 +328,9 @@ int InsetFloat::latex(Buffer const & buf, odocstream & os, int InsetFloat::plaintext(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { - os << '[' << _("float") << ' ' << floatName(params_.type, buf.params()) << ":\n"; + os << '[' << buf.B_("float") << ' ' << floatName(params_.type, buf.params()) << ":\n"; InsetText::plaintext(buf, os, runparams); os << "\n]"; @@ -340,10 +339,10 @@ int InsetFloat::plaintext(Buffer const & buf, odocstream & os, int InsetFloat::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { - // FIXME UNICODE - os << '<' << from_ascii(params_.type) << '>'; + // FIXME UNICODE + os << '<' << from_ascii(params_.type) << '>'; int const i = InsetText::docbook(buf, os, runparams); os << "'; @@ -351,11 +350,11 @@ int InsetFloat::docbook(Buffer const & buf, odocstream & os, } -bool InsetFloat::insetAllowed(InsetBase::Code code) const +bool InsetFloat::insetAllowed(Inset::Code code) const { - return code != InsetBase::FLOAT_CODE - && code != InsetBase::FOOT_CODE - && code != InsetBase::MARGIN_CODE; + return code != Inset::FLOAT_CODE + && code != Inset::FOOT_CODE + && code != Inset::MARGIN_CODE; } @@ -387,31 +386,6 @@ void InsetFloat::sideways(bool s, BufferParams const & bp) } -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) { - Toc & toc = toclist[params_.type]; - docstring const str = - convert(toc.size() + 1) - + ". " + pit->asString(buf, false); - toc.push_back(TocItem(pit, 0, str)); - return; - } - } -} - - string const InsetFloatMailer::name_("float"); InsetFloatMailer::InsetFloatMailer(InsetFloat & inset) @@ -442,7 +416,7 @@ void InsetFloatMailer::string2params(string const & in, return print_mailer_error("InsetFloatMailer", in, 1, name_); // This is part of the inset proper that is usually swallowed - // by LyXText::readInset + // by Text::readInset string id; lex >> id; if (!lex || id != "Float")