case LFUN_LAYOUT:
case LFUN_LAYOUT_PARAGRAPH:
- flag.enabled(cur.inset().forceDefaultParagraphs(cur.idx()));
+ flag.enabled(cur.inset().allowParagraphCustomization(cur.idx()));
break;
case LFUN_INSET_SETTINGS: {
}
}
- // If we are in an inset which returns forceDefaultParagraphs,
- // set the paragraphs to default
- if (cur.inset().forceDefaultParagraphs(cur.idx())) {
+ // set the paragraphs to empty layout if necessary
+ // note that we are doing this if the empty layout is
+ // supposed to be the default, not just if it is forced
+ if (cur.inset().useEmptyLayout()) {
LayoutPtr const layout =
- buffer.params().getTextClass().defaultLayout();
+ buffer.params().getTextClass().emptyLayout();
ParagraphList::iterator const end = insertion.end();
for (ParagraphList::iterator par = insertion.begin();
par != end; ++par)
}
-void switchBetweenClasses(TextClassPtr const & c1,
- TextClassPtr const & c2, InsetText & in, ErrorList & errorlist)
+void switchBetweenClasses(TextClassPtr const & oldone,
+ TextClassPtr const & newone, InsetText & in, ErrorList & errorlist)
{
errorlist.clear();
BOOST_ASSERT(!in.paragraphs().empty());
- if (c1 == c2)
+ if (oldone == newone)
return;
- TextClass const & tclass1 = *c1;
- TextClass const & tclass2 = *c2;
+ TextClass const & oldtc = *oldone;
+ TextClass const & newtc = *newone;
// layouts
ParIterator end = par_iterator_end(in);
for (ParIterator it = par_iterator_begin(in); it != end; ++it) {
docstring const name = it->layout()->name();
- bool hasLayout = tclass2.hasLayout(name);
+ bool hasLayout = newtc.hasLayout(name);
if (hasLayout)
- it->layout(tclass2[name]);
+ it->layout(newtc[name]);
else
- it->layout(tclass2.defaultLayout());
+ it->layout(newtc.defaultLayout());
- if (!hasLayout && name != tclass1.defaultLayoutName()) {
+ if (!hasLayout && name != oldtc.defaultLayoutName()) {
docstring const s = bformat(
_("Layout had to be changed from\n%1$s to %2$s\n"
"because of class conversion from\n%3$s to %4$s"),
name, it->layout()->name(),
- from_utf8(tclass1.name()), from_utf8(tclass2.name()));
+ from_utf8(oldtc.name()), from_utf8(newtc.name()));
// To warn the user that something had to be done.
errorlist.push_back(ErrorItem(_("Changed Layout"), s,
it->id(), 0,
if (inset->lyxCode() != FLEX_CODE)
// FIXME: Should we verify all InsetCollapsable?
continue;
- inset->setLayout(c2);
+ inset->setLayout(newone);
if (inset->getLayout().labelstring != from_utf8("UNDEFINED"))
continue;
- // The flex inset is undefined in tclass2
+ // The flex inset is undefined in newtc
docstring const s = bformat(_(
"Flex inset %1$s is "
"undefined because of class "
"conversion from\n%2$s to %3$s"),
- inset->name(), from_utf8(tclass1.name()),
- from_utf8(tclass2.name()));
+ inset->name(), from_utf8(oldtc.name()),
+ from_utf8(newtc.name()));
// To warn the user that something had to be done.
errorlist.push_back(ErrorItem(
_("Undefined flex inset"),
}
-bool Paragraph::forceDefaultParagraphs() const
+bool Paragraph::forceEmptyLayout() const
{
- return inInset() && inInset()->forceDefaultParagraphs(0);
+ return inInset() && inInset()->forceEmptyLayout();
+}
+
+
+bool Paragraph::allowParagraphCustomization() const
+{
+ return inInset() && inInset()->allowParagraphCustomization(0);
+}
+
+
+bool Paragraph::useEmptyLayout() const
+{
+ return inInset() && inInset()->useEmptyLayout();
}
// any special options in the paragraph and also we don't allow
// any environment other than the default layout of the text class
// to be valid!
- bool asdefault = forceDefaultParagraphs();
+ bool asdefault = forceEmptyLayout();
if (asdefault) {
style = bparams.getTextClass().defaultLayout();
///
InsetCode ownerCode() const;
///
- bool forceDefaultParagraphs() const;
-
+ bool forceEmptyLayout() const;
+ ///
+ bool allowParagraphCustomization() const;
+ ///
+ bool useEmptyLayout() const;
///
pos_type size() const;
///
TextClass const & tclass = bp.getTextClass();
- if (layoutname.empty()) {
+ if (layoutname.empty())
layoutname = tclass.defaultLayoutName();
+
+ if (par.forceEmptyLayout())
+ // in this case only the empty layout is allowed
+ layoutname = tclass.emptyLayoutName();
+ else if (par.useEmptyLayout()) {
+ // in this case, default layout maps to empty layout
+ if (layoutname == tclass.defaultLayoutName())
+ layoutname = tclass.emptyLayoutName();
+ } else {
+ // otherwise, the empty layout maps to the default
+ if (layoutname == tclass.emptyLayoutName())
+ layoutname = tclass.defaultLayoutName();
}
bool hasLayout = tclass.hasLayout(layoutname);
errorList.push_back(ErrorItem(_("Unknown layout"),
bformat(_("Layout '%1$s' does not exist in textclass '%2$s'\nTrying to use the default instead.\n"),
layoutname, from_utf8(tclass.name())), par.id(), 0, par.size()));
- layoutname = tclass.defaultLayoutName();
+ layoutname = par.useEmptyLayout() ?
+ tclass.emptyLayoutName() :
+ tclass.defaultLayoutName();
}
par.layout(bp.getTextClass()[layoutname]);
if (sensitive) {
if (cur.pos() == 0)
// set to standard-layout
+ //FIXME Check if this should be emptyLayout() in some cases
pars_[cpit].applyLayout(tclass.defaultLayout());
else
// set to standard-layout
+ //FIXME Check if this should be emptyLayout() in some cases
pars_[next_par].applyLayout(tclass.defaultLayout());
}
{
if (cur.paragraph().layout()->labeltype != LABEL_BIBLIO)
return false;
+
+ if (cur.pos() != 0)
+ return false;
+
+ BufferParams const & bufparams = cur.buffer().params();
+ Paragraph const & par = cur.paragraph();
+ Cursor prevcur = cur;
+ if (cur.pit() > 0) {
+ --prevcur.pit();
+ prevcur.pos() = prevcur.lastpos();
+ }
+ Paragraph const & prevpar = prevcur.paragraph();
+
// if a bibitem is deleted, merge with previous paragraph
// if this is a bibliography item as well
- if (cur.pos() == 0) {
- BufferParams const & bufparams = cur.buffer().params();
- Paragraph const & par = cur.paragraph();
- Cursor prevcur = cur;
- if (cur.pit() > 0) {
- --prevcur.pit();
- prevcur.pos() = prevcur.lastpos();
- }
- Paragraph const & prevpar = prevcur.paragraph();
- if (cur.pit() > 0 && par.layout() == prevpar.layout()) {
- cur.recordUndo(ATOMIC_UNDO, prevcur.pit());
- mergeParagraph(bufparams, cur.text()->paragraphs(),
- prevcur.pit());
- updateLabels(cur.buffer());
- setCursorIntern(cur, prevcur.pit(), prevcur.pos());
- cur.updateFlags(Update::Force);
- // if not, reset the paragraph to default
- } else
- cur.paragraph().layout(
- bufparams.getTextClass().defaultLayout());
+ if (cur.pit() > 0 && par.layout() == prevpar.layout()) {
+ cur.recordUndo(ATOMIC_UNDO, prevcur.pit());
+ mergeParagraph(bufparams, cur.text()->paragraphs(),
+ prevcur.pit());
+ updateLabels(cur.buffer());
+ setCursorIntern(cur, prevcur.pit(), prevcur.pos());
+ cur.updateFlags(Update::Force);
return true;
- }
- return false;
+ }
+
+ // otherwise reset to default
+ if (par.useEmptyLayout())
+ cur.paragraph().layout(bufparams.getTextClass().emptyLayout());
+ else
+ cur.paragraph().layout(bufparams.getTextClass().defaultLayout());
+ return true;
}
// layouts. I think it is a real bug of all other
// word processors to allow it. It confuses the user.
// Correction: Pasting is always allowed with standard-layout
+ // or the empty layout.
else if (par.layout() == prevpar.layout()
- || par.layout() == tclass.defaultLayout()) {
+ || par.layout() == tclass.defaultLayout()
+ || par.layout() == tclass.emptyLayout()) {
cur.recordUndo(ATOMIC_UNDO, prevcur.pit());
mergeParagraph(bufparams, plist, prevcur.pit());
needsUpdate = true;
InsetText * insetText = dynamic_cast<InsetText *>(inset);
if (insetText && !insetText->allowMultiPar() || cur.lastpit() == 0) {
// reset first par to default
- LayoutPtr const layout =
+ LayoutPtr const layout = insetText->useEmptyLayout() ?
+ cur.buffer().params().getTextClass().emptyLayout() :
cur.buffer().params().getTextClass().defaultLayout();
cur.text()->paragraphs().begin()->layout(layout);
cur.pos() = 0;
}
} else {
// reset surrounding par to default
- docstring const layoutname =
- cur.buffer().params().getTextClass().defaultLayoutName();
+ docstring const layoutname = insetText->useEmptyLayout() ?
+ cur.buffer().params().getTextClass().emptyLayoutName() :
+ cur.buffer().params().getTextClass().defaultLayoutName();
cur.leaveInset(*inset);
text->setLayout(cur, layoutname);
}
docstring layout = cmd.argument();
LYXERR(Debug::INFO, "LFUN_LAYOUT: (arg) " << to_utf8(layout));
- docstring const old_layout = cur.paragraph().layout()->name();
-
- // Derive layout number from given argument (string)
- // and current buffer's textclass (number)
+ Paragraph const & para = cur.paragraph();
+ docstring const old_layout = para.layout()->name();
TextClass const & tclass = bv->buffer().params().getTextClass();
+
if (layout.empty())
layout = tclass.defaultLayoutName();
+
+ if (para.forceEmptyLayout())
+ // in this case only the empty layout is allowed
+ layout = tclass.emptyLayoutName();
+ else if (para.useEmptyLayout()) {
+ // in this case, default layout maps to empty layout
+ if (layout == tclass.defaultLayoutName())
+ layout = tclass.emptyLayoutName();
+ } else {
+ // otherwise, the empty layout maps to the default
+ if (layout == tclass.emptyLayoutName())
+ layout = tclass.defaultLayoutName();
+ }
+
bool hasLayout = tclass.hasLayout(layout);
// If the entry is obsolete, use the new one instead.
// add a separate paragraph for the caption inset
pars.push_back(Paragraph());
pars.back().setInsetOwner(pars[0].inInset());
- pars.back().layout(tclass.defaultLayout());
+ if (pars.back().useEmptyLayout())
+ pars.back().layout(tclass.emptyLayout());
+ else
+ pars.back().layout(tclass.defaultLayout());
int cap_pit = pars.size() - 1;
if (!content) {
pars.push_back(Paragraph());
pars.back().setInsetOwner(pars[0].inInset());
- pars.back().layout(tclass.defaultLayout());
-
+ if (pars.back().useEmptyLayout())
+ pars.back().layout(tclass.emptyLayout());
+ else
+ pars.back().layout(tclass.defaultLayout());
}
// reposition the cursor to the caption
params2string(cur.paragraph(), data);
// Will the paragraph accept changes from the dialog?
- bool const accept = !cur.inset().forceDefaultParagraphs(cur.idx());
+ bool const accept =
+ cur.inset().allowParagraphCustomization(cur.idx());
data = "update " + convert<string>(accept) + '\n' + data;
bv->updateDialog("paragraph", data);
breakParagraph(cur);
}
+ //FIXME Check if this should be emptyLayout()
setLayout(cur, tclass.defaultLayoutName());
ParagraphParameters p;
setParagraphs(cur, p);
#include "support/os.h"
#include <sstream>
+#include <strstream>
using namespace std;
using namespace lyx::support;
titletype_ = TITLE_COMMAND_AFTER;
titlename_ = "maketitle";
loaded_ = false;
+ // a hack to make this available for translation
+ // i'm sure there must be a better way (rgh)
+ _("PlainLayout");
}
+docstring const TextClass::emptylayout_ = from_ascii("PlainLayout");
+
+
bool TextClass::isTeXClassAvailable() const
{
return texClassAvail_;
LYXERR(Debug::TCLASS, "Reading " + translateRT(rt) + ": " +
to_utf8(makeDisplayPath(filename.absFilename())));
+ // Define the `empty' layout used in table cells, ert, etc. Note that
+ // we do this before loading any layout file, so that classes can
+ // override features of this layout if they should choose to do so.
+ if (rt == BASECLASS) {
+ static char const * s = "Margin Static\n"
+ "LatexType Paragraph\n"
+ "LatexName dummy\n"
+ "Align Block\n"
+ "AlignPossible Left, Right, Center\n"
+ "LabelType No_Label\n"
+ "End";
+ istrstream ss(s);
+ Lexer lex(textClassTags, sizeof(textClassTags) / sizeof(textClassTags[0]));
+ lex.setStream(ss);
+ Layout lay;
+ lay.setName(emptylayout_);
+ bool error = readStyle(lex, lay);
+ BOOST_ASSERT(!error);
+ layoutlist_.push_back(boost::shared_ptr<Layout>(new Layout(lay)));
+ }
+
Lexer lexrc(textClassTags,
sizeof(textClassTags) / sizeof(textClassTags[0]));
bool TextClass::deleteLayout(docstring const & name)
{
- if (name == defaultLayoutName())
+ if (name == defaultLayoutName() || name == emptyLayoutName())
return false;
LayoutList::iterator it =
docstring const & defaultLayoutName() const;
///
LayoutPtr const & defaultLayout() const;
+ /// returns a special layout for use when we don't really want one,
+ /// e.g., in table cells
+ LayoutPtr const & emptyLayout() const
+ { return operator[](emptylayout_); };
+ ///
+ docstring const & emptyLayoutName() const
+ { return emptylayout_; }
///
std::string const & name() const;
///
std::string class_header_;
///
docstring defaultlayout_;
+ /// name of empty layout
+ static const docstring emptylayout_;
/// preamble text to support layout styles
docstring preamble_;
/// latex packages loaded by document class.
if (pars[newpar].layout()->isEnvironment()) {
l_margin = leftMargin(max_width, newpar);
}
+ //FIXME Should this check for emptyLayout() as well?
if (par.layout() == tclass.defaultLayout()) {
if (pars[newpar].params().noindent())
parindent.erase();
&& !(!par.empty()
&& par.isInset(pos)
&& par.getInset(pos)->display())
- && (par.layout() != tclass.defaultLayout()
+ && (par.layout() != tclass.defaultLayout() //should this check emptyLayout()?
|| buffer.params().paragraph_separation ==
BufferParams::PARSEP_INDENT))
{
clear();
setEnabled(false);
text_class_ = 0;
+ inset_ = 0;
return;
}
TextClass const * text_class = &buffer->params().getTextClass();
- if (!reset && text_class_ == text_class) {
+ Inset const * inset =
+ owner_.view()->cursor().innerParagraph().inInset();
+
+ // we'll only update the layout list if the text class has changed
+ // or we've moved from one inset to another
+ if (!reset && text_class_ == text_class && inset_ == inset) {
set(owner_.view()->cursor().innerParagraph().layout()->name());
return;
}
+ inset_ = inset;
text_class_ = text_class;
clear();
TextClass::const_iterator it = text_class_->begin();
TextClass::const_iterator const end = text_class_->end();
- for (; it != end; ++it)
- addItemSort(toqstr(translateIfPossible((*it)->name())), lyxrc.sort_layouts);
+
+ for (; it != end; ++it) {
+ docstring const & name = (*it)->name();
+ // if this inset requires the empty layout, we skip the default
+ // layout
+ if (name == text_class_->defaultLayoutName() && inset &&
+ (inset->forceEmptyLayout() || inset->useEmptyLayout()))
+ continue;
+ // if it doesn't require the empty layout, we skip it
+ if (name == text_class_->emptyLayoutName() && inset &&
+ !inset->forceEmptyLayout() && !inset->useEmptyLayout())
+ continue;
+ addItemSort(toqstr(translateIfPossible(name)), lyxrc.sort_layouts);
+ }
set(owner_.view()->cursor().innerParagraph().layout()->name());
namespace lyx {
+class Inset;
class TextClass;
class ToolbarItem;
private:
GuiView & owner_;
TextClass const * text_class_;
+ Inset const * inset_;
};
/// returns true if the inset can hold an inset of given type
virtual bool insetAllowed(InsetCode) const { return false; }
- /// if this inset has paragraphs should they be output all as default
- /// paragraphs with the default layout of the text class?
- virtual bool forceDefaultParagraphs(idx_type) const { return false; }
+ /// should this inset use the empty layout by default rather than
+ /// the standard layout? (default: only if that is forced.)
+ virtual bool useEmptyLayout() const { return forceEmptyLayout(); }
+ /// if this inset has paragraphs should they be forced to use the
+ /// empty layout?
+ virtual bool forceEmptyLayout() const { return false; }
+ /// if this inset has paragraphs should the user be allowed to
+ /// customize alignment, etc?
+ virtual bool allowParagraphCustomization(idx_type) const { return true; }
/// Is the width forced to some value?
virtual bool hasFixedWidth() const { return false; }
#include "InsetBox.h"
#include "Buffer.h"
+#include "BufferParams.h"
#include "BufferView.h"
#include "Cursor.h"
#include "DispatchResult.h"
#include "LaTeXFeatures.h"
#include "Lexer.h"
#include "MetricsInfo.h"
+#include "TextClass.h"
#include "support/Translator.h"
InsetBox::InsetBox(BufferParams const & bp, string const & label)
: InsetCollapsable(bp), params_(label)
-{}
+{
+ if (forceEmptyLayout())
+ paragraphs().back().layout(bp.getTextClass().emptyLayout());
+}
InsetBox::InsetBox(InsetBox const & in)
}
-bool InsetBox::forceDefaultParagraphs(idx_type) const
+bool InsetBox::forceEmptyLayout() const
{
return !params_.inner_box;
}
bool showInsetDialog(BufferView * bv) const;
///
DisplayType display() const { return Inline; }
+ //FIXME Is this the one we want? or is it:
+ //allowParagraphCustomization(idx_type)?
///
- bool forceDefaultParagraphs(idx_type) const;
+ virtual bool forceEmptyLayout() const;
///
bool neverIndent(Buffer const &) const { return true; }
///
setFrameColor(Color_captionframe);
}
+
InsetCaption::InsetCaption(BufferParams const & bp)
: InsetText(bp), textclass_(bp.getTextClass())
{
setAutoBreakRows(true);
setDrawFrame(true);
setFrameColor(Color_captionframe);
+ //FIXME Do we need to set all paragraphs here? or will there
+ //always only be one?
+ paragraphs().back().layout(bp.getTextClass().emptyLayout());
}
void setCustomLabel(docstring const & label);
///
void addToToc(TocList &, Buffer const &, ParConstIterator const &) const;
+ ///
+ virtual bool forceEmptyLayout() const { return true; }
/// Captions don't accept alignment, spacing, etc.
- bool forceDefaultParagraphs(idx_type) const { return true; }
+ virtual bool allowParagraphCustomization(idx_type) const { return false; }
private:
///
setAutoBreakRows(true);
setDrawFrame(true);
setFrameColor(Color_collapsableframe);
+ paragraphs().back().layout(bp.getTextClass().emptyLayout());
}
/// to name()
void setLayout(TextClassPtr tc);
///
+ virtual bool useEmptyLayout() { return true; }
+ ///
void read(Buffer const &, Lexer &);
///
void write(Buffer const &, std::ostream &) const;
virtual bool allowEmpty() const { return layout_->keepempty; }
/// Force inset into LTR environment if surroundings are RTL?
virtual bool forceLTR() const { return layout_->forceltr; }
+ ///
+ virtual bool useEmptyLayout() const { return true; }
protected:
///
{
BufferParams const & bp = cur.buffer().params();
LayoutPtr const layout =
- bp.getTextClass().defaultLayout();
+ bp.getTextClass().emptyLayout();
//lyxerr << "\nInsetERT::doDispatch (begin): cmd: " << cmd << endl;
switch (cmd.action) {
///
bool showInsetDialog(BufferView *) const;
///
- bool forceDefaultParagraphs(idx_type) const { return true; }
- /// should paragraph indendation be ommitted in any case?
+ virtual bool forceEmptyLayout() const { return true; }
+ ///
+ virtual bool allowParagraphCustomization(idx_type) const { return false; }
+ /// should paragraph indendation be omitted in any case?
bool neverIndent(Buffer const &) const { return true; }
protected:
InsetERT(InsetERT const &);
///
void read(Buffer const & buf, Lexer & lex);
///
- bool forceDefaultParagraphs(idx_type) const { return true; }
+ virtual bool allowParagraphCustomization(idx_type) const { return false; }
///
int plaintext(Buffer const &, odocstream &,
usebox(BOX_NONE),
rotate(false),
inset(new InsetText(bp))
-{}
+{
+ inset->paragraphs().back().layout(bp.getTextClass().emptyLayout());
+}
Tabular::cellstruct::cellstruct(cellstruct const & cs)
cur.push(*inset);
// undo information has already been recorded
inset->getText(0)->setLayout(cur.bv().buffer(), 0, cur.lastpit() + 1,
- bp.getTextClass().defaultLayoutName());
+ bp.getTextClass().emptyLayoutName());
cur.pop();
}
}
-bool InsetTabular::forceDefaultParagraphs(idx_type cell) const
+bool InsetTabular::allowParagraphCustomization(idx_type cell) const
{
return tabular.getPWidth(cell).zero();
}
// this should return true if we have a "normal" cell, otherwise false.
// "normal" means without width set!
/// should all paragraphs be output with "Standard" layout?
- bool forceDefaultParagraphs(idx_type cell = 0) const;
-
+ virtual bool allowParagraphCustomization(idx_type cell = 0) const;
+ ///
+ virtual bool forceEmptyLayout() { return true; }
///
void addPreview(graphics::PreviewLoader &) const;
: drawFrame_(false), frame_color_(Color_insetframe)
{
paragraphs().push_back(Paragraph());
- paragraphs().back().layout(bp.getTextClass().defaultLayout());
+ if (useEmptyLayout())
+ paragraphs().back().layout(bp.getTextClass().emptyLayout());
+ else
+ paragraphs().back().layout(bp.getTextClass().defaultLayout());
init();
}
BufferParams const & bparams = buf.params();
- LayoutPtr const & style = pit->layout();
+ LayoutPtr const & style = pit->forceEmptyLayout() ?
+ bparams.getTextClass().emptyLayout() :
+ pit->layout();
ParagraphList const & paragraphs = text.paragraphs();
LYXERR(Debug::LATEX, "TeXOnePar... " << &*pit << " '"
<< everypar << "'");
BufferParams const & bparams = buf.params();
- LayoutPtr style;
ParagraphList const & paragraphs = text.paragraphs();
if (runparams_in.verbatim) {
return ++pit;
}
+ // FIXME This comment doesn't make sense. What's the
+ // length got to do with forceEmptyLayout()? I.e., what
+ // was forceDefaultParagraphs()?
// In an inset with unlimited length (all in one row),
// force layout to default
- if (!pit->forceDefaultParagraphs())
- style = pit->layout();
- else
- style = bparams.getTextClass().defaultLayout();
+ LayoutPtr const style = pit->forceEmptyLayout() ?
+ bparams.getTextClass().emptyLayout() :
+ pit->layout();
OutputParams runparams = runparams_in;
runparams.moving_arg |= style->needprotect;
}
}
- // In an inset with unlimited length (all in one row),
- // don't allow any special options in the paragraph
bool const useSetSpace = bparams.getTextClass().provides("SetSpace");
- if (!pit->forceDefaultParagraphs()) {
+ if (pit->allowParagraphCustomization()) {
if (pit->params().startOfAppendix()) {
os << "\\appendix\n";
texrow.newline();
pending_newline = true;
}
- if (!pit->forceDefaultParagraphs()) {
+ if (pit->allowParagraphCustomization()) {
if (!pit->params().spacing().isDefault()
&& (boost::next(pit) == paragraphs.end()
|| !boost::next(pit)->hasSameLayout(*pit)))
// any special options in the paragraph and also we don't allow
// any environment other than the default layout of the
// text class to be valid!
- if (!par->forceDefaultParagraphs()) {
- LayoutPtr const & layout = par->layout();
+ if (par->allowParagraphCustomization()) {
+ LayoutPtr const & layout = par->forceEmptyLayout() ?
+ tclass.emptyLayout() :
+ par->layout();
if (layout->intitle) {
if (already_title) {
// without doing that we get a crash when typing <Return> at the
// end of a paragraph
- tmp->layout(bparams.getTextClass().defaultLayout());
+ if (par.useEmptyLayout())
+ tmp->layout(bparams.getTextClass().emptyLayout());
+ else
+ tmp->layout(bparams.getTextClass().defaultLayout());
// remember to set the inset_owner
tmp->setInsetOwner(par.inInset());