#include "BufferView_pimpl.h"
#include "bufferlist.h"
+#include "buffer.h"
#include "bufferview_funcs.h"
#include "lfuns.h"
#include "debug.h"
{
lyxerr[Debug::INFO] << "resizeCurrentBuffer" << endl;
- Paragraph * par = 0;
- Paragraph * selstartpar = 0;
- Paragraph * selendpar = 0;
+ ParagraphList::iterator par;
+ ParagraphList::iterator selstartpar;
+ ParagraphList::iterator selendpar;
UpdatableInset * the_locking_inset = 0;
pos_type pos = 0;
owner_->message(_("Formatting document..."));
if (bv_->text) {
- par = &*bv_->text->cursor.par();
+ par = bv_->text->cursor.par();
pos = bv_->text->cursor.pos();
- selstartpar = &*bv_->text->selection.start.par();
+ selstartpar = bv_->text->selection.start.par();
selstartpos = bv_->text->selection.start.pos();
- selendpar = &*bv_->text->selection.end.par();
+ selendpar = bv_->text->selection.end.par();
selendpos = bv_->text->selection.end.pos();
selection = bv_->text->selection.set();
mark_set = bv_->text->selection.mark();
bv_->text->init(bv_);
//buffer_->resizeInsets(bv_);
}
+
+ par = bv_->text->ownerParagraphs().end();
+ selstartpar = bv_->text->ownerParagraphs().end();
+ selendpar = bv_->text->ownerParagraphs().end();
}
- if (par) {
+ if (par != bv_->text->ownerParagraphs().end()) {
bv_->text->selection.set(true);
// At this point just to avoid the Delete-Empty-Paragraph-
// Mechanism when setting the cursor.
if (b != 0) buffer(b);
}
- Paragraph * par = &*buffer_->getParFromID(saved_positions[i].par_id);
- if (!par)
+ ParIterator par = buffer_->getParFromID(saved_positions[i].par_id);
+ if (par == buffer_->par_iterator_end())
return;
- bv_->text->setCursor(par,
- min(par->size(), saved_positions[i].par_pos));
+ bv_->text->setCursor(*par,
+ min((*par)->size(), saved_positions[i].par_pos));
update(BufferView::SELECT);
if (i > 0)