Remove InsetEnvironment. This is unfinished decade old stuff.

http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg141609.html


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25479 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Pavel Sanda 2008-07-07 16:34:55 +00:00
parent 13f95530be
commit 20b9e0ba93
14 changed files with 3 additions and 59 deletions

View File

@ -966,7 +966,6 @@ src_insets_header_files = Split('''
InsetCommand.h InsetCommand.h
InsetCommandParams.h InsetCommandParams.h
InsetERT.h InsetERT.h
InsetEnvironment.h
InsetExternal.h InsetExternal.h
InsetFlex.h InsetFlex.h
InsetFloat.h InsetFloat.h
@ -1021,7 +1020,6 @@ src_insets_files = Split('''
InsetCommand.cpp InsetCommand.cpp
InsetCommandParams.cpp InsetCommandParams.cpp
InsetERT.cpp InsetERT.cpp
InsetEnvironment.cpp
InsetExternal.cpp InsetExternal.cpp
InsetFlex.cpp InsetFlex.cpp
InsetFloat.cpp InsetFloat.cpp

View File

@ -141,7 +141,7 @@ enum FuncCode
LFUN_SERVER_NOTIFY, LFUN_SERVER_NOTIFY,
LFUN_SERVER_GOTO_FILE_ROW, LFUN_SERVER_GOTO_FILE_ROW,
LFUN_NOTE_INSERT, LFUN_NOTE_INSERT,
LFUN_ENVIRONMENT_INSERT, // unused as of 20060905 LFUN_UI_TOGGLE,
LFUN_KEYMAP_OFF, LFUN_KEYMAP_OFF,
// 95 // 95
LFUN_KEYMAP_PRIMARY, LFUN_KEYMAP_PRIMARY,
@ -399,7 +399,6 @@ enum FuncCode
LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM, LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM,
LFUN_IN_MATHMACROTEMPLATE, LFUN_IN_MATHMACROTEMPLATE,
LFUN_SCROLL, LFUN_SCROLL,
LFUN_UI_TOGGLE,
LFUN_SPLIT_VIEW, LFUN_SPLIT_VIEW,
// 310 // 310
LFUN_COMPLETION_POPUP, LFUN_COMPLETION_POPUP,

View File

@ -123,7 +123,6 @@ Layout::Layout()
newline_allowed = true; newline_allowed = true;
free_spacing = false; free_spacing = false;
pass_thru = false; pass_thru = false;
is_environment = false;
toclevel = NOT_IN_TOC; toclevel = NOT_IN_TOC;
commanddepth = 0; commanddepth = 0;
} }

View File

@ -194,14 +194,6 @@ public:
bool free_spacing; bool free_spacing;
/// ///
bool pass_thru; bool pass_thru;
/**
* Whether this layout was declared with "Environment xxx" as opposed
* to "Style xxx". This is part of some unfinished generic environment
* handling (see also InsetEnvironment) started by Andre. No layout
* that is shipped with LyX has this flag set.
* Don't confuse this with isEnvironment()!
*/
bool is_environment;
/// show this in toc /// show this in toc
int toclevel; int toclevel;
/// special value of toclevel for non-section layouts /// special value of toclevel for non-section layouts

View File

@ -1071,7 +1071,6 @@ void LyXAction::init()
* \endvar * \endvar
*/ */
{ LFUN_DEPTH_INCREMENT, "depth-increment", Noop, Edit }, { LFUN_DEPTH_INCREMENT, "depth-increment", Noop, Edit },
{ LFUN_ENVIRONMENT_INSERT, "environment-insert", Noop, Edit },
/*! /*!
* \var lyx::FuncCode lyx::LFUN_FONT_BOLD * \var lyx::FuncCode lyx::LFUN_FONT_BOLD

View File

@ -493,7 +493,6 @@ SOURCEFILESINSETS = \
insets/InsetCollapsable.cpp \ insets/InsetCollapsable.cpp \
insets/InsetCommand.cpp \ insets/InsetCommand.cpp \
insets/InsetCommandParams.cpp \ insets/InsetCommandParams.cpp \
insets/InsetEnvironment.cpp \
insets/InsetERT.cpp \ insets/InsetERT.cpp \
insets/InsetExternal.cpp \ insets/InsetExternal.cpp \
insets/InsetFlex.cpp \ insets/InsetFlex.cpp \
@ -548,7 +547,6 @@ HEADERFILESINSETS = \
insets/InsetCommand.h \ insets/InsetCommand.h \
insets/InsetCommandParams.h \ insets/InsetCommandParams.h \
insets/InsetERT.h \ insets/InsetERT.h \
insets/InsetEnvironment.h \
insets/InsetExternal.h \ insets/InsetExternal.h \
insets/InsetFlex.h \ insets/InsetFlex.h \
insets/InsetFloat.h \ insets/InsetFloat.h \

View File

@ -46,8 +46,6 @@
#include "TextMetrics.h" #include "TextMetrics.h"
#include "VSpace.h" #include "VSpace.h"
#include "insets/InsetEnvironment.h"
#include "mathed/InsetMathHull.h" #include "mathed/InsetMathHull.h"
#include "support/lassert.h" #include "support/lassert.h"
@ -216,22 +214,6 @@ void Text::setLayout(Buffer const & buffer, pit_type start, pit_type end,
void Text::setLayout(Cursor & cur, docstring const & layout) void Text::setLayout(Cursor & cur, docstring const & layout)
{ {
LASSERT(this == cur.text(), /**/); LASSERT(this == cur.text(), /**/);
// special handling of new environment insets
BufferView & bv = cur.bv();
BufferParams const & params = bv.buffer().params();
Layout const & lyxlayout = params.documentClass()[layout];
if (lyxlayout.is_environment) {
// move everything in a new environment inset
LYXERR(Debug::DEBUG, "setting layout " << to_utf8(layout));
lyx::dispatch(FuncRequest(LFUN_LINE_BEGIN));
lyx::dispatch(FuncRequest(LFUN_LINE_END_SELECT));
lyx::dispatch(FuncRequest(LFUN_CUT));
Inset * inset = new InsetEnvironment(bv.buffer(), layout);
insertInset(cur, inset);
//inset->edit(cur, true);
//lyx::dispatch(FuncRequest(LFUN_PASTE));
return;
}
pit_type start = cur.selBegin().pit(); pit_type start = cur.selBegin().pit();
pit_type end = cur.selEnd().pit() + 1; pit_type end = cur.selEnd().pit() + 1;

View File

@ -1365,7 +1365,6 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
case LFUN_LISTING_INSERT: case LFUN_LISTING_INSERT:
case LFUN_MARGINALNOTE_INSERT: case LFUN_MARGINALNOTE_INSERT:
case LFUN_OPTIONAL_INSERT: case LFUN_OPTIONAL_INSERT:
case LFUN_ENVIRONMENT_INSERT:
case LFUN_INDEX_INSERT: case LFUN_INDEX_INSERT:
// Open the inset, and move the current selection // Open the inset, and move the current selection
// inside it. // inside it.
@ -1981,9 +1980,6 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
enable = cur.paragraph().insetList().count(OPTARG_CODE) enable = cur.paragraph().insetList().count(OPTARG_CODE)
< cur.paragraph().layout().optionalargs; < cur.paragraph().layout().optionalargs;
break; break;
case LFUN_ENVIRONMENT_INSERT:
code = BOX_CODE;
break;
case LFUN_INDEX_INSERT: case LFUN_INDEX_INSERT:
code = INDEX_CODE; code = INDEX_CODE;
break; break;

View File

@ -163,7 +163,6 @@ enum TextClassTags {
TC_STYLE, TC_STYLE,
TC_DEFAULTSTYLE, TC_DEFAULTSTYLE,
TC_INSETLAYOUT, TC_INSETLAYOUT,
TC_ENVIRONMENT,
TC_NOSTYLE, TC_NOSTYLE,
TC_COLUMNS, TC_COLUMNS,
TC_SIDES, TC_SIDES,
@ -196,7 +195,6 @@ namespace {
{ "counter", TC_COUNTER }, { "counter", TC_COUNTER },
{ "defaultfont", TC_DEFAULTFONT }, { "defaultfont", TC_DEFAULTFONT },
{ "defaultstyle", TC_DEFAULTSTYLE }, { "defaultstyle", TC_DEFAULTSTYLE },
{ "environment", TC_ENVIRONMENT },
{ "float", TC_FLOAT }, { "float", TC_FLOAT },
{ "format", TC_FORMAT }, { "format", TC_FORMAT },
{ "input", TC_INPUT }, { "input", TC_INPUT },
@ -386,7 +384,6 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
} }
break; break;
case TC_ENVIRONMENT:
case TC_STYLE: case TC_STYLE:
if (lexrc.next()) { if (lexrc.next()) {
docstring const name = from_utf8(subst(lexrc.getString(), docstring const name = from_utf8(subst(lexrc.getString(),
@ -405,8 +402,6 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
} else { } else {
Layout layout; Layout layout;
layout.setName(name); layout.setName(name);
if (le == TC_ENVIRONMENT)
layout.is_environment = true;
error = !readStyle(lexrc, layout); error = !readStyle(lexrc, layout);
if (!error) if (!error)
layoutlist_.push_back(layout); layoutlist_.push_back(layout);

View File

@ -25,7 +25,6 @@
#include "insets/InsetCaption.h" #include "insets/InsetCaption.h"
#include "insets/InsetCitation.h" #include "insets/InsetCitation.h"
#include "insets/InsetFlex.h" #include "insets/InsetFlex.h"
#include "insets/InsetEnvironment.h"
#include "insets/InsetERT.h" #include "insets/InsetERT.h"
#include "insets/InsetListings.h" #include "insets/InsetListings.h"
#include "insets/InsetExternal.h" #include "insets/InsetExternal.h"
@ -207,9 +206,6 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
case LFUN_TOC_INSERT: case LFUN_TOC_INSERT:
return new InsetTOC(InsetCommandParams(TOC_CODE)); return new InsetTOC(InsetCommandParams(TOC_CODE));
case LFUN_ENVIRONMENT_INSERT:
return new InsetEnvironment(buf, cmd.argument());
case LFUN_INFO_INSERT: { case LFUN_INFO_INSERT: {
InsetInfo * inset = new InsetInfo(buf, to_utf8(cmd.argument())); InsetInfo * inset = new InsetInfo(buf, to_utf8(cmd.argument()));
inset->updateInfo(); inset->updateInfo();
@ -521,9 +517,6 @@ Inset * readInset(Lexer & lex, Buffer const & buf)
inset.reset(new InsetFlex(buf, s)); inset.reset(new InsetFlex(buf, s));
} else if (tmptok == "Branch") { } else if (tmptok == "Branch") {
inset.reset(new InsetBranch(buf, InsetBranchParams())); inset.reset(new InsetBranch(buf, InsetBranchParams()));
} else if (tmptok == "Environment") {
lex.next();
inset.reset(new InsetEnvironment(buf, lex.getDocString()));
} else if (tmptok == "ERT") { } else if (tmptok == "ERT") {
inset.reset(new InsetERT(buf)); inset.reset(new InsetERT(buf));
} else if (tmptok == "listings") { } else if (tmptok == "listings") {

View File

@ -94,7 +94,6 @@ static TranslatorMap const build_translator()
InsetName("index_print", INDEX_PRINT_CODE), InsetName("index_print", INDEX_PRINT_CODE),
InsetName("nomencl_print", NOMENCL_PRINT_CODE), InsetName("nomencl_print", NOMENCL_PRINT_CODE),
InsetName("optarg", OPTARG_CODE), InsetName("optarg", OPTARG_CODE),
InsetName("environment", ENVIRONMENT_CODE),
InsetName("newline", NEWLINE_CODE), InsetName("newline", NEWLINE_CODE),
InsetName("line", LINE_CODE), InsetName("line", LINE_CODE),
InsetName("branch", BRANCH_CODE), InsetName("branch", BRANCH_CODE),

View File

@ -85,7 +85,7 @@ enum InsetCode {
/// ///
OPTARG_CODE, OPTARG_CODE,
/// ///
ENVIRONMENT_CODE, CELL_CODE,
/// ///
NEWLINE_CODE, NEWLINE_CODE,
/// ///
@ -112,8 +112,6 @@ enum InsetCode {
INFO_CODE, // 45 INFO_CODE, // 45
/// ///
COLLAPSABLE_CODE, COLLAPSABLE_CODE,
///
CELL_CODE,
}; };
} // namespace lyx } // namespace lyx

View File

@ -654,7 +654,6 @@ bool InsetCollapsable::getStatus(Cursor & cur, FuncRequest const & cmd,
case LFUN_CAPTION_INSERT: case LFUN_CAPTION_INSERT:
case LFUN_DEPTH_DECREMENT: case LFUN_DEPTH_DECREMENT:
case LFUN_DEPTH_INCREMENT: case LFUN_DEPTH_INCREMENT:
case LFUN_ENVIRONMENT_INSERT:
case LFUN_ERT_INSERT: case LFUN_ERT_INSERT:
case LFUN_FILE_INSERT: case LFUN_FILE_INSERT:
case LFUN_FLEX_INSERT: case LFUN_FLEX_INSERT:

View File

@ -816,10 +816,7 @@ void latexParagraphs(Buffer const & buf,
was_title = false; was_title = false;
} }
if (layout.is_environment) { if (layout.isEnvironment() ||
par = TeXOnePar(buf, text, par, os, texrow,
runparams, everypar);
} else if (layout.isEnvironment() ||
!par->params().leftIndent().zero()) { !par->params().leftIndent().zero()) {
par = TeXEnvironment(buf, text, par, os, par = TeXEnvironment(buf, text, par, os,
texrow, runparams); texrow, runparams);