diff --git a/src/insets/InsetEnvironment.cpp b/src/insets/InsetEnvironment.cpp deleted file mode 100644 index 4dba48eb3e..0000000000 --- a/src/insets/InsetEnvironment.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/** - * \file InsetEnvironment.cpp - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author André Pönitz - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "InsetEnvironment.h" - -#include "Buffer.h" -#include "BufferParams.h" -#include "Layout.h" -#include "OutputParams.h" -#include "output_latex.h" -#include "TexRow.h" -#include "TextClass.h" - -#include "support/gettext.h" - -using namespace std; - -namespace lyx { - - -InsetEnvironment::InsetEnvironment(Buffer const & buf, docstring const & name) - : InsetText(buf), layout_(buf.params().documentClass()[name]), name_(name) -{ - setAutoBreakRows(true); - setDrawFrame(true); -} - - -void InsetEnvironment::write(ostream & os) const -{ - os << "Environment " << to_utf8(name()) << "\n"; - InsetText::write(os); -} - - -void InsetEnvironment::read(Lexer & lex) -{ - InsetText::read(lex); -} - - -docstring InsetEnvironment::editMessage() const -{ - return _("Opened Environment Inset: ") + name(); -} - - -int InsetEnvironment::latex(odocstream & os, - OutputParams const & runparams) const -{ - // FIXME UNICODE - os << from_utf8(layout_.latexheader); - TexRow texrow; - latexParagraphs(buffer(), text_, os, texrow, runparams, - layout_.latexparagraph); - // FIXME UNICODE - os << from_utf8(layout_.latexfooter); - return texrow.rows(); -} - - -int InsetEnvironment::plaintext(odocstream & os, - OutputParams const & runparams) const -{ - os << '[' << to_utf8(name()) << ":\n"; - InsetText::plaintext(os, runparams); - os << "\n]"; - - return PLAINTEXT_NEWLINE + 1; // one char on a separate line -} - - -Layout const & InsetEnvironment::layout() const -{ - return layout_; -} - - -} // namespace lyx diff --git a/src/insets/InsetEnvironment.h b/src/insets/InsetEnvironment.h deleted file mode 100644 index bb393719f3..0000000000 --- a/src/insets/InsetEnvironment.h +++ /dev/null @@ -1,59 +0,0 @@ -// -*- C++ -*- -/** - * \file InsetEnvironment.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author André Pönitz - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef INSETENVIRONMENT_H -#define INSETENVIRONMENT_H - -#include "InsetText.h" - -namespace lyx { - -class Layout; - -class InsetEnvironment : public InsetText { -public: - /// - InsetEnvironment(Buffer const &, docstring const & name); - /// - docstring name() const { return name_; } - /// - void write(std::ostream & os) const; - /// - void read(Lexer & lex); - /// - InsetCode lyxCode() const { return ENVIRONMENT_CODE; } - /// - int latex(odocstream &, OutputParams const &) const; - /// - int plaintext(odocstream &, OutputParams const &) const; - /// - docstring editMessage() const; - /// - Inset::EDITABLE editable() const { return HIGHLY_EDITABLE; } - /// - Layout const & layout() const; - /** returns true if, when outputing LaTeX, font changes should - be closed before generating this inset. This is needed for - insets that may contain several paragraphs */ - bool noFontChange() const { return true; } -private: - /// - Inset * clone() const { return new InsetEnvironment(*this); } - /// the layout - Layout const & layout_; - /// - docstring name_; -}; - - -} // namespace lyx - -#endif