X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2FLyXView.C;h=da79c4c181567185d3ae0dd8fcb59317ed359826;hb=ccc5d5576437a7615f54bf1ed6e83e05bfbaaf78;hp=658ce33ffd3c094c4167fbd53d377f3c08ee460c;hpb=f3bff9d5d850904ddef6397f5bd31838c7f8b33d;p=lyx.git diff --git a/src/frontends/LyXView.C b/src/frontends/LyXView.C index 658ce33ffd..da79c4c181 100644 --- a/src/frontends/LyXView.C +++ b/src/frontends/LyXView.C @@ -18,6 +18,7 @@ #include "Menubar.h" #include "buffer.h" +#include "bufferparams.h" #include "BufferView.h" #include "bufferview_funcs.h" #include "debug.h" @@ -42,8 +43,11 @@ #include #include -using namespace lyx::support; +using lyx::support::MakeDisplayPath; +using lyx::support::OnlyFilename; + using std::endl; +using std::string; string current_layout; @@ -101,9 +105,9 @@ void LyXView::setLayout(string const & layout) void LyXView::updateToolbar() { - bool const math = mathcursor; + bool const math = inMathed(); bool const table = - !getLyXFunc().getStatus(LFUN_LAYOUT_TABULAR).disabled(); + !getLyXFunc().getStatus(FuncRequest(LFUN_LAYOUT_TABULAR)).disabled(); toolbar_->update(math, table); } @@ -140,12 +144,12 @@ void LyXView::updateLayoutChoice() } // update the layout display - if (toolbar_->updateLayoutList(buffer()->params.textclass)) { - current_layout = buffer()->params.getLyXTextClass().defaultLayoutName(); + if (toolbar_->updateLayoutList(buffer()->params().textclass)) { + current_layout = buffer()->params().getLyXTextClass().defaultLayoutName(); } string const & layout = - bufferview_->getLyXText()->cursor.par()->layout()->name(); + bufferview_->getLyXText()->cursorPar()->layout()->name(); if (layout != current_layout) { toolbar_->setLayout(layout); @@ -181,10 +185,18 @@ void LyXView::updateWindowTitle() } -void LyXView::dispatch(FuncRequest const & req) +void LyXView::dispatch(FuncRequest const & cmd) +{ + getLyXFunc().dispatch(cmd); +} + + +Buffer const * const LyXView::updateInset(InsetOld const * inset) const { - // substitute the correct BufferView here - FuncRequest r = req; - r.setView(view().get()); - getLyXFunc().dispatch(r); + Buffer const * buffer_ptr = 0; + if (inset) { + buffer_ptr = bufferview_->buffer(); + bufferview_->update(); + } + return buffer_ptr; }