]> git.lyx.org Git - lyx.git/commitdiff
15 moved, 23 dead, 1 bug squashed...
authorAndré Pönitz <poenitz@gmx.net>
Tue, 27 Aug 2002 15:23:01 +0000 (15:23 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 27 Aug 2002 15:23:01 +0000 (15:23 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5122 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/BufferView_pimpl.h
src/text3.C

index 124f2e993e826b27f72d84740e764a84f9e9ba22..0579df09eb80ff5b19b71700a7a93421683c88dd 100644 (file)
@@ -53,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"
 
@@ -68,7 +67,6 @@
 #include <boost/bind.hpp>
 #include <boost/signals/connection.hpp>
 
-#include <cstdio>
 #include <unistd.h>
 #include <sys/wait.h>
 
@@ -1560,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 ---------------------------
 
@@ -1791,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
index 868d4a55eb61a9a18ec353a286ae5c16e05b557e..3e0c025597ddebbca8f6056d78eac2f0a52dbd05 100644 (file)
@@ -136,8 +136,6 @@ private:
                           int & x, int & y) const;
        ///
        friend class BufferView;
-       /// open and lock an updatable inset
-       bool open_new_inset(UpdatableInset * new_inset, bool behind = false);
        ///
        void hfill();
 
index bfb91a2cadfd99ad0329411e79898c3501d778a1..e7ecc2867cf9327232067cb12bef2de3819c43fa 100644 (file)
 #include "frontends/LyXView.h"
 #include "frontends/screen.h"
 #include "frontends/WorkArea.h"
+#include "frontends/Dialogs.h"
 #include "insets/insetspecialchar.h"
 #include "insets/insettext.h"
 #include "insets/insetquotes.h"
 #include "insets/insetcommand.h"
+#include "insets/insettabular.h"
 #include "undo_funcs.h"
 
 #include <ctime>
 #include <clocale>
+#include <cstdio>
 
 using std::endl;
 
@@ -1088,6 +1091,23 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
                break;
        }
 
+       case LFUN_TABULAR_INSERT:
+               if (cmd.argument.empty()) 
+                       bv->owner()->getDialogs().showTabularCreate();
+               else {
+                       int r = 2;
+                       int c = 2;
+                       ::sscanf(cmd.argument.c_str(),"%d%d", &r, &c);
+                       InsetTabular * inset = new InsetTabular(*bv->buffer(), r, c);
+                       bv->beforeChange(this);
+                       finishUndo();
+                       if (!bv->insertInset(inset))
+                               delete inset;
+                       else
+                               inset->edit(bv, !real_current_font.isRightToLeft());
+               }
+               break;
+
        case LFUN_QUOTE: {
                Paragraph const * par = cursor.par();
                lyx::pos_type pos = cursor.pos();