transfer cursor position saving (in the session) from ~WorkArea to ~BufferView.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19719 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-08-22 09:06:13 +00:00
parent a0e5ee9fac
commit 8202f63160
2 changed files with 8 additions and 11 deletions

View File

@ -142,6 +142,14 @@ BufferView::BufferView(Buffer & buf)
BufferView::~BufferView()
{
// current buffer is going to be switched-off, save cursor pos
// Ideally, the whole cursor stack should be saved, but session
// currently can only handle bottom (whole document) level pit and pos.
// That is to say, if a cursor is in a nested inset, it will be
// restore to the left of the top level inset.
LyX::ref().session().lastFilePos().save(
support::FileName(buffer_.fileName()),
boost::tie(cursor_.bottom().pit(), cursor_.bottom().pos()) );
}

View File

@ -29,7 +29,6 @@
#include "Font.h"
#include "FuncRequest.h"
#include "Language.h"
#include "LyX.h"
#include "LyXFunc.h"
#include "LyXRC.h"
#include "MetricsInfo.h"
@ -90,16 +89,6 @@ WorkArea::~WorkArea()
bufferChangedConnection_.disconnect();
bufferClosingConnection_.disconnect();
// current buffer is going to be switched-off, save cursor pos
// Ideally, the whole cursor stack should be saved, but session
// currently can only handle bottom (whole document) level pit and pos.
// That is to say, if a cursor is in a nested inset, it will be
// restore to the left of the top level inset.
Cursor & cur = buffer_view_->cursor();
LyX::ref().session().lastFilePos().save(
support::FileName(buffer_view_->buffer().fileName()),
boost::tie(cur.bottom().pit(), cur.bottom().pos()) );
delete buffer_view_;
}