#include "BufferParams.h"
#include "gettext.h"
-#include "Paragraph.h"
#include "OutputParams.h"
#include "output_latex.h"
#include "TexRow.h"
namespace lyx {
-using std::string;
-using std::auto_ptr;
-using std::ostream;
-
InsetEnvironment::InsetEnvironment
- (BufferParams const & bp, string const & name)
- : InsetText(bp), layout_(bp.getLyXTextClass()[name]), name_(from_utf8(name))
+ (BufferParams const & bp, docstring const & name)
+ : InsetText(bp), layout_(bp.getTextClass()[name]), name_(name)
{
setAutoBreakRows(true);
setDrawFrame(true);
{}
-auto_ptr<InsetBase> InsetEnvironment::doClone() const
+Inset * InsetEnvironment::clone() const
{
- return auto_ptr<InsetBase>(new InsetEnvironment(*this));
+ return new InsetEnvironment(*this);
}
-void InsetEnvironment::write(Buffer const & buf, ostream & os) const
+void InsetEnvironment::write(Buffer const & buf, std::ostream & os) const
{
- os << "Environment " << to_utf8(getInsetName()) << "\n";
+ os << "Environment " << to_utf8(name()) << "\n";
InsetText::write(buf, os);
}
docstring const InsetEnvironment::editMessage() const
{
- return _("Opened Environment Inset: ") + getInsetName();
+ return _("Opened Environment Inset: ") + name();
}
int InsetEnvironment::latex(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
// FIXME UNICODE
os << from_utf8(layout_->latexheader);
int InsetEnvironment::plaintext(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
- os << '[' << to_utf8(getInsetName()) << ":\n";
+ os << '[' << to_utf8(name()) << ":\n";
InsetText::plaintext(buf, os, runparams);
os << "\n]";
}
-LyXLayout_ptr const & InsetEnvironment::layout() const
+LayoutPtr const & InsetEnvironment::layout() const
{
return layout_;
}