]> git.lyx.org Git - features.git/blobdiff - src/BufferView_pimpl.C
move floatlist to textclass
[features.git] / src / BufferView_pimpl.C
index 6e1f60e2ef41bfa76c8921c3034d5b92c9b0a156..737d6aaea2483700f2a6ef8aecab3dde69d1350c 100644 (file)
@@ -40,7 +40,6 @@
 #include "ParagraphParameters.h"
 #include "undo_funcs.h"
 #include "funcrequest.h"
-#include "factory.h"
 
 #include "insets/insetbib.h"
 #include "insets/insettext.h"
@@ -54,7 +53,6 @@
 #include "insets/insetcite.h"
 #include "insets/insetgraphics.h"
 #include "insets/insetmarginal.h"
-#include "insets/insettabular.h"
 #include "insets/insetcaption.h"
 #include "insets/insetfloatlist.h"
 
@@ -69,7 +67,6 @@
 #include <boost/bind.hpp>
 #include <boost/signals/connection.hpp>
 
-#include <cstdio>
 #include <unistd.h>
 #include <sys/wait.h>
 
@@ -1541,42 +1538,6 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
        }
        break;
 
-#if 0
-       case LFUN_INSET_LIST:
-       case LFUN_INSET_THEOREM:
-#endif
-       case LFUN_INSERT_NOTE:
-       case LFUN_INSET_ERT:
-       case LFUN_INSET_EXTERNAL:
-       case LFUN_INSET_FLOAT:
-       case LFUN_INSET_FOOTNOTE:
-       case LFUN_INSET_MARGINAL:
-       case LFUN_INSET_MINIPAGE:
-       case LFUN_INSET_OPTARG:
-       case LFUN_INSET_WIDE_FLOAT:
-       {
-               FuncRequest cmd = ev;
-               cmd.setView(bv_);
-               Inset * inset = createInset(cmd);
-               if (inset) {
-                       bool gotsel = false;
-
-                       if (bv_->getLyXText()->selection.set()) {
-                               bv_->getLyXText()->cutSelection(bv_, true, false);
-                               gotsel = true;
-                       }
-
-                       if (insertInset(inset)) {
-                               inset->edit(bv_);
-                               if (gotsel)
-                                       owner_->dispatch(FuncRequest(LFUN_PASTESELECTION));
-                       }
-                       else
-                               delete inset;
-               }
-               break;
-       }
-
        case LFUN_INSET_CAPTION:
        {
                // Do we have a locking inset...
@@ -1597,25 +1558,6 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
        }
        break;
 
-       case LFUN_TABULAR_INSERT:
-       {
-               if (ev.argument.empty()) {
-                       owner_->getDialogs().showTabularCreate();
-                       break;
-               }
-
-               int r = 2;
-               int c = 2;
-               ::sscanf(ev.argument.c_str(),"%d%d", &r, &c);
-               InsetTabular * new_inset =
-                       new InsetTabular(*buffer_, r, c);
-               bool const rtl =
-                       bv_->getLyXText()->real_current_font.isRightToLeft();
-               if (!open_new_inset(new_inset, rtl))
-                       delete new_inset;
-       }
-       break;
-
 
        // --- accented characters ---------------------------
 
@@ -1783,7 +1725,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
        break;
 
        case LFUN_FLOAT_LIST:
-               if (floatList.typeExist(ev.argument)) {
+               if (tclass.floats().typeExist(ev.argument)) {
                        Inset * inset = new InsetFloatList(ev.argument);
                        if (!insertInset(inset, tclass.defaultLayoutName()))
                                delete inset;
@@ -1828,22 +1770,6 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
 }
 
 
-// Open and lock an updatable inset
-bool BufferView::Pimpl::open_new_inset(UpdatableInset * new_inset, bool behind)
-{
-       LyXText * lt = bv_->getLyXText();
-
-       beforeChange(lt);
-       finishUndo();
-       if (!insertInset(new_inset)) {
-               delete new_inset;
-               return false;
-       }
-       new_inset->edit(bv_, !behind);
-       return true;
-}
-
-
 bool BufferView::Pimpl::insertInset(Inset * inset, string const & lout)
 {
        // if we are in a locking inset we should try to insert the