From: Lars Gullik Bjønnes Date: Sat, 24 May 2003 16:11:27 +0000 (+0000) Subject: fix some small problems... kindo hackish... X-Git-Tag: 1.6.10~16748 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=40df68631241c4bda3b45a27f333eda5d4e10a1a;p=features.git fix some small problems... kindo hackish... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7041 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/buffer.C b/src/buffer.C index ea8485e066..03974c0439 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -369,6 +369,7 @@ int Buffer::readParagraph(LyXLex & lex, string const & token, lex.pushToken(token); Paragraph par; + par.owningBuffer(*this); par.params().depth(depth); if (params.tracking_changes) par.trackChanges(); diff --git a/src/insets/inset.h b/src/insets/inset.h index 6bc007f232..3e86cc5114 100644 --- a/src/insets/inset.h +++ b/src/insets/inset.h @@ -103,7 +103,7 @@ public: /// MINIPAGE_CODE, /// - SPACE_CODE, + SPACE_CODE, /// SPECIALCHAR_CODE, // 25 /// diff --git a/src/paragraph.C b/src/paragraph.C index f5c2694036..0d12383a6c 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -67,9 +67,6 @@ Inset * minibuffer_inset; } // namespace anon -extern BufferView * current_view; - - Paragraph::Paragraph() : pimpl_(new Paragraph::Pimpl(this)) { @@ -95,14 +92,14 @@ Paragraph::Paragraph(Paragraph const & lp, bool same_ids) // this is because of the dummy layout of the paragraphs that // follow footnotes layout_ = lp.layout(); - + buffer_ = lp.buffer_; + // copy everything behind the break-position to the new paragraph insetlist = lp.insetlist; InsetList::iterator it = insetlist.begin(); InsetList::iterator end = insetlist.end(); for (; it != end; ++it) { - it.setInset(it.getInset()->clone(*current_view->buffer(), - same_ids)); + it.setInset(it.getInset()->clone(**buffer_, same_ids)); // tell the new inset who is the boss now it.getInset()->parOwner(this); } diff --git a/src/paragraph.h b/src/paragraph.h index c426e34132..f38ef03cfc 100644 --- a/src/paragraph.h +++ b/src/paragraph.h @@ -21,6 +21,8 @@ #include "ParagraphList.h" #include "LString.h" +#include + class BufferParams; class BufferView; class Counters; @@ -299,6 +301,10 @@ public: InsetList insetlist; /// //Counters & counters(); + /// + void owningBuffer(Buffer const & b) { + buffer_.reset(&b); + } private: /// LyXLayout_ptr layout_; @@ -308,6 +314,9 @@ private: Paragraph * next_par_; Paragraph * prev_par_; #endif + /// + boost::optional buffer_; + struct Pimpl; /// friend struct Paragraph::Pimpl;