Abdelrazak Younes ha scritto:
LyXView::buffer() and GuiView::buffer() is no more in trunk. So the
first thing to do is to review all currentBufferView() and
documentBufferView() calls and replace one by the other when it makes
sense.
In LyXFunc::dispatch():
... L825:
} else {
Buffer * buffer = 0;
if (lyx_view_ && lyx_view_->currentBufferView())
buffer = &lyx_view_->currentBufferView()->buffer();
switch (action) {
... L875:
case LFUN_BUFFER_TOGGLE_READ_ONLY: {
LASSERT(lyx_view_ && lyx_view_->currentBufferView() &&
buffer, /**/);
why checking both currentBV() and buffer ?!?
...L897:
case LFUN_BUFFER_RELOAD: {
LASSERT(lyx_view_ && buffer, /**/);
docstring const file =
makeDisplayPath(buffer->absFileName(), 20);
If this LFUN is about loading document, then 'buffer' should be switched
to documentBufferView->buffer() ?
(in fact, the reloadBuffer() method works on the documentBufferView)
In order to simplify/easy code, what about adding at L826:
Buffer * buffer = 0;
if (lyx_view_ && lyx_view_->currentBufferView())
buffer = &lyx_view_->currentBufferView()->buffer();
the following:
Buffer * doc_buffer = 0;
if (lyx_view_ && lyx_view_->documentBufferView())
doc_buffer = &lyx_view_->documentBufferView()->buffer();
, then replacing the long "lyx_view_->documentBufferView()->buffer()"
instances with doc_buffer ?
T.
--
Tommaso Cucinotta, Computer Engineering PhD, Researcher
ReTiS Lab, Scuola Superiore Sant'Anna, Pisa, Italy
Tel +39 050 882 024, Fax +39 050 882 003
http://feanor.sssup.it/~tommaso