mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
Change the "empty layout" to the "plain layout", to try to avoid confusion.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26025 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f6972543e0
commit
cca78e3c8a
@ -133,7 +133,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
|
||||
// set the paragraphs to empty layout if necessary
|
||||
if (cur.inset().usePlainLayout()) {
|
||||
bool forcePlainLayout = cur.inset().forcePlainLayout();
|
||||
Layout const & emptyLayout = newDocClass->emptyLayout();
|
||||
Layout const & emptyLayout = newDocClass->plainLayout();
|
||||
Layout const & defaultLayout = newDocClass->defaultLayout();
|
||||
ParagraphList::iterator const end = insertion.end();
|
||||
ParagraphList::iterator par = insertion.begin();
|
||||
@ -144,7 +144,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
|
||||
}
|
||||
} else { // check if we need to reset from empty layout
|
||||
Layout const & defaultLayout = newDocClass->defaultLayout();
|
||||
Layout const & emptyLayout = newDocClass->emptyLayout();
|
||||
Layout const & emptyLayout = newDocClass->plainLayout();
|
||||
ParagraphList::iterator const end = insertion.end();
|
||||
ParagraphList::iterator par = insertion.begin();
|
||||
for (; par != end; ++par) {
|
||||
@ -523,7 +523,7 @@ void switchBetweenClasses(DocumentClass const * const oldone,
|
||||
newtc.addLayoutIfNeeded(name);
|
||||
|
||||
if (in.usePlainLayout())
|
||||
it->setLayout(newtc.emptyLayout());
|
||||
it->setLayout(newtc.plainLayout());
|
||||
else
|
||||
it->setLayout(newtc[name]);
|
||||
}
|
||||
@ -720,7 +720,7 @@ void copySelectionToStack(Cursor & cur, CutStack & cutstack)
|
||||
Paragraph par;
|
||||
BufferParams const & bp = cur.buffer().params();
|
||||
// FIXME This should be the empty layout...right?
|
||||
par.setLayout(bp.documentClass().emptyLayout());
|
||||
par.setLayout(bp.documentClass().plainLayout());
|
||||
par.insert(0, grabSelection(cur), Font(), Change(Change::UNCHANGED));
|
||||
pars.push_back(par);
|
||||
cutstack.push(make_pair(pars, bp.documentClassPtr()));
|
||||
@ -747,7 +747,7 @@ void copySelection(Cursor & cur, docstring const & plaintext)
|
||||
ParagraphList pars;
|
||||
Paragraph par;
|
||||
BufferParams const & bp = cur.buffer().params();
|
||||
par.setLayout(bp.documentClass().emptyLayout());
|
||||
par.setLayout(bp.documentClass().plainLayout());
|
||||
par.insert(0, plaintext, Font(), Change(Change::UNCHANGED));
|
||||
pars.push_back(par);
|
||||
theCuts.push(make_pair(pars, bp.documentClassPtr()));
|
||||
|
@ -1883,7 +1883,7 @@ bool Paragraph::latex(BufferParams const & bparams,
|
||||
bool asdefault = forcePlainLayout();
|
||||
|
||||
Layout const & style = asdefault ?
|
||||
bparams.documentClass().emptyLayout() :
|
||||
bparams.documentClass().plainLayout() :
|
||||
*d->layout_;
|
||||
|
||||
// Current base font for all inherited font changes, without any
|
||||
@ -2426,7 +2426,7 @@ void Paragraph::setLayout(Layout const & layout)
|
||||
void Paragraph::setPlainOrDefaultLayout(DocumentClass const & tclass)
|
||||
{
|
||||
if (usePlainLayout())
|
||||
setLayout(tclass.emptyLayout());
|
||||
setLayout(tclass.plainLayout());
|
||||
else
|
||||
setLayout(tclass.defaultLayout());
|
||||
}
|
||||
|
10
src/Text.cpp
10
src/Text.cpp
@ -104,14 +104,14 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
|
||||
|
||||
if (par.forcePlainLayout()) {
|
||||
// in this case only the empty layout is allowed
|
||||
layoutname = tclass.emptyLayoutName();
|
||||
layoutname = tclass.plainLayoutName();
|
||||
} else if (par.usePlainLayout()) {
|
||||
// in this case, default layout maps to empty layout
|
||||
if (layoutname == tclass.defaultLayoutName())
|
||||
layoutname = tclass.emptyLayoutName();
|
||||
layoutname = tclass.plainLayoutName();
|
||||
} else {
|
||||
// otherwise, the empty layout maps to the default
|
||||
if (layoutname == tclass.emptyLayoutName())
|
||||
if (layoutname == tclass.plainLayoutName())
|
||||
layoutname = tclass.defaultLayoutName();
|
||||
}
|
||||
|
||||
@ -382,11 +382,11 @@ void Text::breakParagraph(Cursor & cur, bool inverse_logic)
|
||||
if (sensitive) {
|
||||
if (cur.pos() == 0)
|
||||
// set to standard-layout
|
||||
//FIXME Check if this should be emptyLayout() in some cases
|
||||
//FIXME Check if this should be plainLayout() in some cases
|
||||
pars_[cpit].applyLayout(tclass.defaultLayout());
|
||||
else
|
||||
// set to standard-layout
|
||||
//FIXME Check if this should be emptyLayout() in some cases
|
||||
//FIXME Check if this should be plainLayout() in some cases
|
||||
pars_[next_par].applyLayout(tclass.defaultLayout());
|
||||
}
|
||||
|
||||
|
@ -239,7 +239,7 @@ static bool doInsertInset(Cursor & cur, Text * text,
|
||||
cur.leaveInset(*inset);
|
||||
// reset surrounding par to default
|
||||
docstring const layoutname = insetText->usePlainLayout()
|
||||
? bparams.documentClass().emptyLayoutName()
|
||||
? bparams.documentClass().plainLayoutName()
|
||||
: bparams.documentClass().defaultLayoutName();
|
||||
text->setLayout(cur, layoutname);
|
||||
}
|
||||
@ -1014,14 +1014,14 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
|
||||
if (para.forcePlainLayout())
|
||||
// in this case only the empty layout is allowed
|
||||
layout = tclass.emptyLayoutName();
|
||||
layout = tclass.plainLayoutName();
|
||||
else if (para.usePlainLayout()) {
|
||||
// in this case, default layout maps to empty layout
|
||||
if (layout == tclass.defaultLayoutName())
|
||||
layout = tclass.emptyLayoutName();
|
||||
layout = tclass.plainLayoutName();
|
||||
} else {
|
||||
// otherwise, the empty layout maps to the default
|
||||
if (layout == tclass.emptyLayoutName())
|
||||
if (layout == tclass.plainLayoutName())
|
||||
layout = tclass.defaultLayoutName();
|
||||
}
|
||||
|
||||
@ -1695,7 +1695,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
}
|
||||
|
||||
docstring const laystr = cur.inset().usePlainLayout() ?
|
||||
tclass.emptyLayoutName() :
|
||||
tclass.plainLayoutName() :
|
||||
tclass.defaultLayoutName();
|
||||
setLayout(cur, laystr);
|
||||
ParagraphParameters p;
|
||||
|
@ -956,7 +956,7 @@ Layout & TextClass::operator[](docstring const & name)
|
||||
|
||||
bool TextClass::deleteLayout(docstring const & name)
|
||||
{
|
||||
if (name == defaultLayoutName() || name == emptyLayoutName())
|
||||
if (name == defaultLayoutName() || name == plainLayoutName())
|
||||
return false;
|
||||
|
||||
LayoutList::iterator it =
|
||||
@ -1044,7 +1044,7 @@ bool TextClass::isDefaultLayout(Layout const & layout) const
|
||||
|
||||
bool TextClass::isPlainLayout(Layout const & layout) const
|
||||
{
|
||||
return layout.name() == emptyLayoutName();
|
||||
return layout.name() == plainLayoutName();
|
||||
}
|
||||
|
||||
|
||||
|
@ -124,10 +124,10 @@ public:
|
||||
bool isPlainLayout(Layout const &) const;
|
||||
/// returns a special layout for use when we don't really want one,
|
||||
/// e.g., in table cells
|
||||
Layout const & emptyLayout() const
|
||||
Layout const & plainLayout() const
|
||||
{ return operator[](emptylayout_); };
|
||||
/// the name of the empty layout
|
||||
docstring const & emptyLayoutName() const
|
||||
/// the name of the plain layout
|
||||
docstring const & plainLayoutName() const
|
||||
{ return emptylayout_; }
|
||||
/// Enumerate the paragraph styles.
|
||||
size_t layoutCount() const { return layoutlist_.size(); }
|
||||
@ -191,8 +191,8 @@ protected:
|
||||
TextClass();
|
||||
///
|
||||
Layout & operator[](docstring const & vname);
|
||||
/// Create an empty layout for this textclass.
|
||||
/** \param unknown Set to true if this layout is a default layout used to
|
||||
/// Create an new, empty layout for this textclass.
|
||||
/** \param unknown Set to true if this layout is an empty layout used to
|
||||
* represent an unknown layout
|
||||
*/
|
||||
Layout createEmptyLayout(docstring const & name, bool unknown = false) const;
|
||||
@ -240,7 +240,7 @@ protected:
|
||||
std::string class_header_;
|
||||
///
|
||||
docstring defaultlayout_;
|
||||
/// name of empty layout
|
||||
/// name of plain layout
|
||||
static const docstring emptylayout_;
|
||||
/// preamble text to support layout styles
|
||||
docstring preamble_;
|
||||
@ -340,9 +340,9 @@ public:
|
||||
/// If that doesn't work either, an empty object returns (shouldn't
|
||||
/// happen). -- Idea JMarc, comment MV
|
||||
InsetLayout const & insetLayout(docstring const & name) const;
|
||||
/// an empty inset layout for use as a default
|
||||
static InsetLayout const & emptyInsetLayout() { return empty_insetlayout_; }
|
||||
/// add an empty layout \c name if it does not exist in layoutlist_
|
||||
/// a plain inset layout for use as a default
|
||||
static InsetLayout const & plainInsetLayout() { return empty_insetlayout_; }
|
||||
/// add a new, empty layout \c name if it does not exist in layoutlist_
|
||||
void addLayoutIfNeeded(docstring const & name) const;
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
@ -623,7 +623,7 @@ void GuiLayoutBox::updateContents(bool reset)
|
||||
if (name == text_class_->defaultLayoutName() && inset_ && useEmpty)
|
||||
continue;
|
||||
// if it doesn't require the empty layout, we skip it
|
||||
if (name == text_class_->emptyLayoutName() && inset_ && !useEmpty)
|
||||
if (name == text_class_->plainLayoutName() && inset_ && !useEmpty)
|
||||
continue;
|
||||
// obsoleted layouts are skipped as well
|
||||
if (!lit->obsoleted_by().empty())
|
||||
|
@ -97,7 +97,7 @@ InsetBox::InsetBox(Buffer const & buffer, string const & label)
|
||||
: InsetCollapsable(buffer), params_(label)
|
||||
{
|
||||
if (forcePlainLayout())
|
||||
paragraphs().back().setLayout(buffer.params().documentClass().emptyLayout());
|
||||
paragraphs().back().setLayout(buffer.params().documentClass().plainLayout());
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,7 +54,7 @@ InsetCaption::InsetCaption(Buffer const & buf)
|
||||
setDrawFrame(true);
|
||||
setFrameColor(Color_captionframe);
|
||||
// There will always be only one
|
||||
paragraphs().back().setLayout(buf.params().documentClass().emptyLayout());
|
||||
paragraphs().back().setLayout(buf.params().documentClass().plainLayout());
|
||||
}
|
||||
|
||||
|
||||
|
@ -86,7 +86,7 @@ InsetCollapsable::InsetCollapsable(Buffer const & buf,
|
||||
setAutoBreakRows(true);
|
||||
setDrawFrame(true);
|
||||
setFrameColor(Color_collapsableframe);
|
||||
paragraphs().back().setLayout(dc.emptyLayout());
|
||||
paragraphs().back().setLayout(dc.plainLayout());
|
||||
}
|
||||
|
||||
|
||||
@ -147,7 +147,7 @@ void InsetCollapsable::setLayout(DocumentClass const * const dc)
|
||||
layout_ = &(dc->insetLayout(name()));
|
||||
labelstring_ = translateIfPossible(layout_->labelstring());
|
||||
} else {
|
||||
layout_ = &DocumentClass::emptyInsetLayout();
|
||||
layout_ = &DocumentClass::plainInsetLayout();
|
||||
labelstring_ = _("UNDEFINED");
|
||||
}
|
||||
|
||||
@ -848,7 +848,7 @@ void InsetCollapsable::validate(LaTeXFeatures & features) const
|
||||
bool InsetCollapsable::undefined() const
|
||||
{
|
||||
docstring const & n = getLayout().name();
|
||||
return n.empty() || n == DocumentClass::emptyInsetLayout().name();
|
||||
return n.empty() || n == DocumentClass::plainInsetLayout().name();
|
||||
}
|
||||
|
||||
|
||||
|
@ -104,7 +104,7 @@ int InsetERT::docbook(odocstream & os, OutputParams const &) const
|
||||
void InsetERT::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
{
|
||||
BufferParams const & bp = cur.buffer().params();
|
||||
Layout const layout = bp.documentClass().emptyLayout();
|
||||
Layout const layout = bp.documentClass().plainLayout();
|
||||
//lyxerr << "\nInsetERT::doDispatch (begin): cmd: " << cmd << endl;
|
||||
switch (cmd.action) {
|
||||
case LFUN_QUOTE_INSERT: {
|
||||
|
@ -487,7 +487,7 @@ Tabular::CellData::CellData(Buffer & buf)
|
||||
inset(new InsetTableCell(buf))
|
||||
{
|
||||
inset->setBuffer(const_cast<Buffer &>(buf));
|
||||
inset->paragraphs().back().setLayout(buf.params().documentClass().emptyLayout());
|
||||
inset->paragraphs().back().setLayout(buf.params().documentClass().plainLayout());
|
||||
}
|
||||
|
||||
|
||||
@ -981,7 +981,7 @@ void toggleFixedWidth(Cursor & cur, InsetTableCell * inset, bool fixedWidth)
|
||||
cur.push(*inset);
|
||||
// undo information has already been recorded
|
||||
inset->getText(0)->setLayout(cur.bv().buffer(), 0, cur.lastpit() + 1,
|
||||
bp.documentClass().emptyLayoutName());
|
||||
bp.documentClass().plainLayoutName());
|
||||
cur.pop();
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ TeXEnvironment(Buffer const & buf,
|
||||
BufferParams const & bparams = buf.params();
|
||||
|
||||
Layout const & style = pit->forcePlainLayout() ?
|
||||
bparams.documentClass().emptyLayout() : pit->layout();
|
||||
bparams.documentClass().plainLayout() : pit->layout();
|
||||
|
||||
ParagraphList const & paragraphs = text.paragraphs();
|
||||
|
||||
@ -310,7 +310,7 @@ TeXOnePar(Buffer const & buf,
|
||||
}
|
||||
|
||||
Layout const style = pit->forcePlainLayout() ?
|
||||
bparams.documentClass().emptyLayout() : pit->layout();
|
||||
bparams.documentClass().plainLayout() : pit->layout();
|
||||
|
||||
OutputParams runparams = runparams_in;
|
||||
runparams.moving_arg |= style.needprotect;
|
||||
@ -785,7 +785,7 @@ void latexParagraphs(Buffer const & buf,
|
||||
while (par != endpar) {
|
||||
lastpar = par;
|
||||
Layout const & layout = par->forcePlainLayout() ?
|
||||
tclass.emptyLayout() :
|
||||
tclass.plainLayout() :
|
||||
par->layout();
|
||||
|
||||
if (layout.intitle) {
|
||||
|
Loading…
Reference in New Issue
Block a user