mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-24 10:40:48 +00:00
4b2c271e23
* lyxtext.h: move ParagraphList member to LyXText rename LyXText::ownerParagraphs to LyXText::paragraph * CutAndPaste.C: * bufferview_funcs.C: * iterators.[Ch]: * lyx_cb.C: * paragraph.C: * rowpainter.C: * tabular.C: * text.C: * text2.C: * text3.C: adjust * lyxfunc.C: move LFUN_INSET_TOGGLE handling to insets. * undo.C: fix cursor positioning * insetbase.h: whitespace * inset.[Ch]: remove latexTextWidth make setBackgroundColor virtual * insettext.[Ch]: move ParagraphList member to LyXText * insetcollapsable.[Ch]: handle LFUN_INSET_TOGGLE * insetcharstyle.C: * insetenv.C: * insetert.[Ch]: * insetfloat.[Ch]: * insetminipage.[Ch]: * insettabular.C: * insetwrap.[Ch]: adjust paragraphs and background color handling, git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8166 a592a061-630c-0410-9148-cb99ea01b6c8
85 lines
1.6 KiB
C
85 lines
1.6 KiB
C
/**
|
|
* \file insetenv.C
|
|
* 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 <config.h>
|
|
|
|
#include "insetenv.h"
|
|
|
|
#include "bufferparams.h"
|
|
#include "gettext.h"
|
|
#include "paragraph.h"
|
|
#include "output_latex.h"
|
|
#include "texrow.h"
|
|
|
|
#include "support/std_ostream.h"
|
|
|
|
|
|
using std::string;
|
|
using std::auto_ptr;
|
|
using std::ostream;
|
|
|
|
|
|
InsetEnvironment::InsetEnvironment
|
|
(BufferParams const & bp, string const & name)
|
|
: InsetText(bp), layout_(bp.getLyXTextClass()[name])
|
|
{
|
|
setInsetName(name);
|
|
setAutoBreakRows(true);
|
|
setDrawFrame(ALWAYS);
|
|
}
|
|
|
|
|
|
InsetEnvironment::InsetEnvironment(InsetEnvironment const & in)
|
|
: InsetText(in), layout_(in.layout_)
|
|
{}
|
|
|
|
|
|
auto_ptr<InsetBase> InsetEnvironment::clone() const
|
|
{
|
|
return auto_ptr<InsetBase>(new InsetEnvironment(*this));
|
|
}
|
|
|
|
|
|
void InsetEnvironment::write(Buffer const & buf, ostream & os) const
|
|
{
|
|
os << "Environment " << getInsetName() << "\n";
|
|
InsetText::write(buf, os);
|
|
}
|
|
|
|
|
|
void InsetEnvironment::read(Buffer const & buf, LyXLex & lex)
|
|
{
|
|
InsetText::read(buf, lex);
|
|
}
|
|
|
|
|
|
string const InsetEnvironment::editMessage() const
|
|
{
|
|
return _("Opened Environment Inset: ") + getInsetName();
|
|
}
|
|
|
|
|
|
int InsetEnvironment::latex(Buffer const & buf, ostream & os,
|
|
OutputParams const & runparams) const
|
|
{
|
|
os << layout_->latexheader;
|
|
TexRow texrow;
|
|
latexParagraphs(buf, paragraphs(), os, texrow, runparams,
|
|
layout_->latexparagraph);
|
|
os << layout_->latexfooter;
|
|
return texrow.rows();
|
|
}
|
|
|
|
|
|
LyXLayout_ptr const & InsetEnvironment::layout() const
|
|
{
|
|
return layout_;
|
|
}
|