#include "InsetEnvironment.h"
#include "BufferParams.h"
-#include "gettext.h"
-#include "Paragraph.h"
+#include "support/gettext.h"
+#include "Layout.h"
#include "OutputParams.h"
#include "output_latex.h"
#include "TexRow.h"
+#include "TextClass.h"
+using namespace std;
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<Inset> InsetEnvironment::doClone() const
+Inset * InsetEnvironment::clone() const
{
- return auto_ptr<Inset>(new InsetEnvironment(*this));
+ return new InsetEnvironment(*this);
}
void InsetEnvironment::write(Buffer const & buf, ostream & os) const
{
- os << "Environment " << to_utf8(insetName()) << "\n";
+ os << "Environment " << to_utf8(name()) << "\n";
InsetText::write(buf, os);
}
docstring const InsetEnvironment::editMessage() const
{
- return _("Opened Environment Inset: ") + insetName();
+ 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(insetName()) << ":\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_;
}