From 0922e29029a1558d34e88466aefe4f39b92d601b Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 26 Mar 2008 03:54:44 +0000 Subject: [PATCH] Make InsetText store a Buffer. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23964 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Buffer.cpp | 2 +- src/CutAndPaste.cpp | 4 ++-- src/insets/InsetCollapsable.cpp | 4 ++++ src/insets/InsetText.cpp | 5 +---- src/insets/InsetText.h | 2 -- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index e4592b56f0..a502bf910a 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -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); diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index 9d5b97fe54..093eabee0e 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -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); diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index e2b7f8a9f7..7b2648ac27 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -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 diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index 2a596c0138..76caba8be2 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -70,6 +70,7 @@ using graphics::PreviewLoader; InsetText::InsetText(Buffer const & buf) : drawFrame_(false), frame_color_(Color_insetframe) { + Inset::setBuffer(const_cast(buf)); initParagraphs(buf); } @@ -85,10 +86,6 @@ InsetText::InsetText(InsetText const & in) } -InsetText::InsetText() -{} - - void InsetText::initParagraphs(Buffer const & buf) { BOOST_ASSERT(paragraphs().empty()); diff --git a/src/insets/InsetText.h b/src/insets/InsetText.h index afb874a442..644a7fede5 100644 --- a/src/insets/InsetText.h +++ b/src/insets/InsetText.h @@ -37,8 +37,6 @@ public: /// explicit InsetText(Buffer const & buffer); /// - InsetText(); - /// InsetText(InsetText const &); /// void initParagraphs(Buffer const & buffer);