BufferView::BufferView()
- : buffer_(0), wh_(0),
+ : width_(0), height_(0), buffer_(0), wh_(0),
cursor_(*this),
multiparsel_cache_(false), anchor_ref_(0), offset_ref_(0),
intl_(new Intl)
saved_positions.resize(saved_positions_num);
// load saved bookmarks
- Session::BookmarkList & bmList = LyX::ref().session().loadBookmarks();
- for (Session::BookmarkList::iterator bm = bmList.begin();
+ BookmarksSection::BookmarkList & bmList = LyX::ref().session().bookmarks().load();
+ for (BookmarksSection::BookmarkList::iterator bm = bmList.begin();
bm != bmList.end(); ++bm)
if (bm->get<0>() < saved_positions_num)
saved_positions[bm->get<0>()] = Position( bm->get<1>(), bm->get<2>(), bm->get<3>() );
buffer_->saveCursor(cursor_.selectionBegin(),
cursor_.selectionEnd());
// current buffer is going to be switched-off, save cursor pos
- LyX::ref().session().saveFilePosition(buffer_->fileName(),
+ LyX::ref().session().lastFilePos().save(buffer_->fileName(),
boost::tie(cursor_.pit(), cursor_.pos()) );
}
if (!theBufferList().close(theBufferList().getBuffer(s), false))
return false;
// Fall through to new load. (Asger)
+ buffer_ = 0;
}
Buffer * b = 0;
if (lyxrc.use_lastfilepos) {
pit_type pit;
pos_type pos;
- boost::tie(pit, pos) = LyX::ref().session().loadFilePosition(s);
+ boost::tie(pit, pos) = LyX::ref().session().lastFilePos().load(s);
// I am not sure how to separate the following part to a function
// so I will leave this to Lars.
//
}
if (tolastfiles)
- LyX::ref().session().addLastFile(b->fileName());
+ LyX::ref().session().lastFiles().add(b->fileName());
return true;
}
if (!buffer_)
return false;
+ lyxerr[Debug::WORKAREA] << "BufferView::update" << std::endl;
+
// Update macro store
buffer_->buildMacros();
sumh += h2;
nh++;
}
+
+ BOOST_ASSERT(nh);
int const hav = sumh / nh;
// More realistic average paragraph height
if (hav > wh_)
wh_ = hav;
+ BOOST_ASSERT(h);
scrollbarParameters_.height = (parsize + 1) * wh_;
scrollbarParameters_.position = anchor_ref_ * wh_ + int(offset_ref_ * wh_ / float(h));
scrollbarParameters_.lineScrollHeight = int(wh_ * defaultRowHeight() / float(h));
// par_id and pit.
for (unsigned int i=1; i < saved_positions_num; ++i) {
if ( isSavedPosition(i) )
- LyX::ref().session().saveBookmark( boost::tie(
+ LyX::ref().session().bookmarks().save( boost::tie(
i,
saved_positions[i].filename,
saved_positions[i].par_id,
metrics_info_ = ViewMetricsInfo(pit1, pit2, y1, y2, singlepar, size);
if (lyxerr.debugging(Debug::WORKAREA)) {
+ lyxerr[Debug::WORKAREA] << "BufferView::updateMetrics" << endl;
coord_cache_.dump();
}
}