X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetBox.cpp;h=ec99e94b59ab7c24f94bd60513a549c72482d568;hb=76dc2c0d3002db400f4826e6f3b3e8bf84f830f4;hp=71620c32139d2ca7ce7b0119b49c8f8bcf3681ff;hpb=0362c6aae73c293d1c20277c12d362acfe0b2ef6;p=lyx.git diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp index 71620c3213..ec99e94b59 100644 --- a/src/insets/InsetBox.cpp +++ b/src/insets/InsetBox.cpp @@ -85,32 +85,21 @@ BoxTranslatorLoc const & boxtranslator_loc() } // anon -InsetBox::InsetBox(BufferParams const & bp, string const & label) - : InsetCollapsable(bp), params_(label) +InsetBox::InsetBox(Buffer const & buffer, string const & label) + : InsetCollapsable(buffer), params_(label) { if (forceEmptyLayout()) - paragraphs().back().setLayout(bp.textClass().emptyLayout()); + paragraphs().back().setLayout(buffer.params().documentClass().emptyLayout()); } -InsetBox::InsetBox(InsetBox const & in) - : InsetCollapsable(in), params_(in.params_) -{} - - InsetBox::~InsetBox() { InsetBoxMailer(*this).hideDialog(); } -Inset * InsetBox::clone() const -{ - return new InsetBox(*this); -} - - -docstring const InsetBox::editMessage() const +docstring InsetBox::editMessage() const { return _("Opened Box Inset"); } @@ -119,24 +108,24 @@ docstring const InsetBox::editMessage() const docstring InsetBox::name() const { // FIXME: UNICODE - string name = string("Box"); + string name = "Box"; if (boxtranslator().find(params_.type) == Shaded) name += string(":Shaded"); return from_ascii(name); } -void InsetBox::write(Buffer const & buf, ostream & os) const +void InsetBox::write(ostream & os) const { params_.write(os); - InsetCollapsable::write(buf, os); + InsetCollapsable::write(os); } -void InsetBox::read(Buffer const & buf, Lexer & lex) +void InsetBox::read(Lexer & lex) { params_.read(lex); - InsetCollapsable::read(buf, lex); + InsetCollapsable::read(lex); } @@ -162,7 +151,7 @@ void InsetBox::setButtonLabel() bool InsetBox::hasFixedWidth() const { - return params_.inner_box || params_.special != "width"; + return params_.inner_box || params_.special != "width"; } @@ -244,20 +233,12 @@ bool InsetBox::getStatus(Cursor & cur, FuncRequest const & cmd, } -bool InsetBox::isMacroScope(Buffer const &) const -{ - BoxType btype = boxtranslator().find(params_.type); - return btype != Frameless || params_.inner_box; -} - - -int InsetBox::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const +int InsetBox::latex(odocstream & os, OutputParams const & runparams) const { BoxType btype = boxtranslator().find(params_.type); string width_string = params_.width.asLatexString(); - bool stdwidth(false); + bool stdwidth = false; if (params_.inner_box && (width_string.find("1.0\\columnwidth") != string::npos || width_string.find("1.0\\textwidth") != string::npos)) { @@ -374,7 +355,7 @@ int InsetBox::latex(Buffer const & buf, odocstream & os, os << "\\begin{shaded}%\n"; i += 1; - i += InsetText::latex(buf, os, runparams); + i += InsetText::latex(os, runparams); if (btype == Shaded) os << "\\end{shaded}"; @@ -414,8 +395,7 @@ int InsetBox::latex(Buffer const & buf, odocstream & os, } -int InsetBox::plaintext(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const +int InsetBox::plaintext(odocstream & os, OutputParams const & runparams) const { BoxType const btype = boxtranslator().find(params_.type); @@ -441,7 +421,7 @@ int InsetBox::plaintext(Buffer const & buf, odocstream & os, break; } - InsetText::plaintext(buf, os, runparams); + InsetText::plaintext(os, runparams); int len = 0; switch (btype) { @@ -476,10 +456,9 @@ int InsetBox::plaintext(Buffer const & buf, odocstream & os, } -int InsetBox::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const +int InsetBox::docbook(odocstream & os, OutputParams const & runparams) const { - return InsetText::docbook(buf, os, runparams); + return InsetText::docbook(os, runparams); }