Angus Leeming wrote:
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
This commit move out from BufferView all update to the LyXView owner. The goal is that BufferView is not used directly but LyXView instead. There is a degradation of performance due to too many calls to WorkArea::redraw(). I have to review which one is really necessary.

I haven't looked at the patch but I do have a question: why LyXView?

LyXView is a "LyX window", right? With Menubar, Toolbars, and eventually
multiple WorkAreas. LyXView is the wrong place to transfer any Buffer-related
info, no? The  frontend thing that's interested in Buffers is the WorkArea.

I must be missing something obvious. Help me out here.

Good question. There are two reasons why setBuffer and LoadLyXFile are transfered to LyXView instead of WorkArea:

1) Evolution: the cited method are used in source code that knows about LyXView not WorkArea. So it is less code to transfer to LyXView. As I don't want to change too much code at the same time. This is a logical choice. The transition to WorkArea can happen afterward if needed.

2) From a user point of view, you click file->open in the LyXView and the buffer is loaded into the current WorkArea (the one that has the focus). It's the job of LyXView to decide which one.

Eventually though we could also add the possibility to specify the WorkArea where we want the buffer to be loaded:

LyXView::setBuffer(Buffer * b, int work_area_id);

Does it make sense?

Abdel.

Reply via email to