]> git.lyx.org Git - features.git/commitdiff
fix some small problems... kindo hackish...
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 24 May 2003 16:11:27 +0000 (16:11 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 24 May 2003 16:11:27 +0000 (16:11 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7041 a592a061-630c-0410-9148-cb99ea01b6c8

src/buffer.C
src/insets/inset.h
src/paragraph.C
src/paragraph.h

index ea8485e06667046a9481b4935a29333757b00a0b..03974c043926f0d9da1c40266df4e7703b8fe0c8 100644 (file)
@@ -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();
index 6bc007f2327791580e30e7131d23074203828dd0..3e86cc5114c272d004c22d44aa06e40db79cea63 100644 (file)
@@ -103,7 +103,7 @@ public:
                ///
                MINIPAGE_CODE,
                ///
-               SPACE_CODE, 
+               SPACE_CODE,
                ///
                SPECIALCHAR_CODE, // 25
                ///
index f5c2694036f9c3b9460d98e67fae7df44eaf0574..0d12383a6cbc92ce68d0db116602fde1203ebfea 100644 (file)
@@ -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);
        }
index c426e34132743196a9a33a1339051094b90ab7f8..f38ef03cfc0b70b6565ca8337748827855dc7ffe 100644 (file)
@@ -21,6 +21,8 @@
 #include "ParagraphList.h"
 #include "LString.h"
 
+#include <boost/optional.hpp>
+
 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 const *> buffer_;
+
        struct Pimpl;
        ///
        friend struct Paragraph::Pimpl;