Make InsetText store a Buffer.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23964 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2008-03-26 03:54:44 +00:00
parent 024c973d74
commit 0922e29029
5 changed files with 8 additions and 9 deletions

View File

@ -238,7 +238,7 @@ Buffer::Impl::Impl(Buffer & parent, FileName const & file, bool readonly_)
read_only(readonly_), filename(file), file_fully_loaded(false),
toc_backend(&parent), macro_lock(false),
embedded_files(), timestamp_(0), checksum_(0), wa_(0),
undo_(parent)
undo_(parent), inset(parent)
{
temppath = createBufferTmpDir();
lyxvc.setBuffer(&parent);

View File

@ -140,7 +140,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
}
// Make sure there is no class difference.
InsetText in;
InsetText in(cur.buffer());
// This works without copying any paragraph data because we have
// a specialized swap method for ParagraphList. This is important
// since we store pointers to insets at some places and we don't
@ -194,7 +194,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
}
// Prepare the paragraphs and insets for insertion.
// A couple of insets store buffer references so need updating.
// Insets store buffer references so need updating.
insertion.swap(in.paragraphs());
InsetIterator const i_end = inset_iterator_end(in);

View File

@ -512,6 +512,10 @@ void InsetCollapsable::doDispatch(Cursor & cur, FuncRequest & cmd)
// Nothing to do.
cur.undispatched();
return;
case mouse_button::none:
case mouse_button::button4:
case mouse_button::button5:
break;
}
}
if (geometry() == NoButton

View File

@ -70,6 +70,7 @@ using graphics::PreviewLoader;
InsetText::InsetText(Buffer const & buf)
: drawFrame_(false), frame_color_(Color_insetframe)
{
Inset::setBuffer(const_cast<Buffer &>(buf));
initParagraphs(buf);
}
@ -85,10 +86,6 @@ InsetText::InsetText(InsetText const & in)
}
InsetText::InsetText()
{}
void InsetText::initParagraphs(Buffer const & buf)
{
BOOST_ASSERT(paragraphs().empty());

View File

@ -37,8 +37,6 @@ public:
///
explicit InsetText(Buffer const & buffer);
///
InsetText();
///
InsetText(InsetText const &);
///
void initParagraphs(Buffer const & buffer);