lex.pushToken(token);
Paragraph par;
+ par.owningBuffer(*this);
par.params().depth(depth);
if (params.tracking_changes)
par.trackChanges();
} // namespace anon
-extern BufferView * current_view;
-
-
Paragraph::Paragraph()
: pimpl_(new Paragraph::Pimpl(this))
{
// 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);
}
#include "ParagraphList.h"
#include "LString.h"
+#include <boost/optional.hpp>
+
class BufferParams;
class BufferView;
class Counters;
InsetList insetlist;
///
//Counters & counters();
+ ///
+ void owningBuffer(Buffer const & b) {
+ buffer_.reset(&b);
+ }
private:
///
LyXLayout_ptr layout_;
Paragraph * next_par_;
Paragraph * prev_par_;
#endif
+ ///
+ boost::optional<Buffer const *> buffer_;
+
struct Pimpl;
///
friend struct Paragraph::Pimpl;