]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/LyXView.C
Part of IU.
[lyx.git] / src / frontends / LyXView.C
index 658ce33ffd3c094c4167fbd53d377f3c08ee460c..da79c4c181567185d3ae0dd8fcb59317ed359826 100644 (file)
@@ -18,6 +18,7 @@
 #include "Menubar.h"
 
 #include "buffer.h"
+#include "bufferparams.h"
 #include "BufferView.h"
 #include "bufferview_funcs.h"
 #include "debug.h"
 #include <sys/time.h>
 #include <unistd.h>
 
-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;
 }