From 9e3b4803fe79a9ed043b8021434920415bd04759 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sun, 26 Oct 2008 01:18:26 +0000 Subject: [PATCH] The two lines deleted here attempt to call virtual functions from a constructor. They have no effect, basically. Patch that does what these try to do forthcoming. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27125 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetCollapsable.cpp | 1 - src/insets/InsetText.cpp | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index 77621b3abc..a64b867baa 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -86,7 +86,6 @@ InsetCollapsable::InsetCollapsable(Buffer const & buf, setAutoBreakRows(true); setDrawFrame(true); setFrameColor(Color_collapsableframe); - paragraphs().back().setLayout(dc.plainLayout()); } diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index b346726201..b9b7f767d8 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -71,11 +71,11 @@ using graphics::PreviewLoader; ///////////////////////////////////////////////////////////////////// -InsetText::InsetText(Buffer const & buf) +InsetText::InsetText(Buffer const & buf, bool useplain) : drawFrame_(false), frame_color_(Color_insetframe) { - initParagraphs(buf.params()); setBuffer(const_cast(buf)); + initParagraphs(useplain); } @@ -99,13 +99,15 @@ void InsetText::setBuffer(Buffer & buf) } -void InsetText::initParagraphs(BufferParams const & bparams) +void InsetText::initParagraphs(bool useplain) { LASSERT(paragraphs().empty(), /**/); paragraphs().push_back(Paragraph()); Paragraph & ourpar = paragraphs().back(); ourpar.setInsetOwner(this); - ourpar.setPlainOrDefaultLayout(bparams.documentClass()); + DocumentClass const & dc = buffer_.params().documentClass(); + Layout const & lay = useplain ? dc.plainLayout() : dc.defaultLayout(); + ourpar.setLayout(lay); }