]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlTabularCreate.C
The reference dialog now disconnects from the inset on Apply. Its behaviour
[lyx.git] / src / frontends / controllers / ControlTabularCreate.C
index 1d2db58b01592d3d9c9413a9843dd25a3582751e..fa55e9e6a1ab989e93031b0f41e05373cf778abd 100644 (file)
 #pragma implementation
 #endif
 
+#include "ViewBase.h"
+#include "ButtonControllerBase.h"
 #include "ControlTabularCreate.h"
 #include "BufferView.h"
 #include "Dialogs.h"
 #include "LyXView.h"
 #include "lyxfunc.h"
+#include "support/lstrings.h"
 
 ControlTabularCreate::ControlTabularCreate(LyXView & lv, Dialogs & d)
        : ControlDialog<ControlConnectBD>(lv, d)
@@ -30,31 +33,18 @@ ControlTabularCreate::ControlTabularCreate(LyXView & lv, Dialogs & d)
 }
 
 
-string & ControlTabularCreate::params() const
+ControlTabularCreate::rowsCols & ControlTabularCreate::params()
 {
-       Assert(params_);
-       return *params_;
+               return params_;
 }
 
 
 void ControlTabularCreate::setParams()
 {
-       if (params_) delete params_;
-       params_ = new string;
-
        bc().valid(); // so that the user can press Ok
 }
 
 
-void ControlTabularCreate::clearParams()
-{
-       if (params_) {
-               delete params_;
-               params_ = 0;
-       }
-}
-
-
 void ControlTabularCreate::apply()
 {
        if (!lv_.view()->available())
@@ -62,5 +52,7 @@ void ControlTabularCreate::apply()
    
        view().apply();
 
-       lv_.getLyXFunc()->Dispatch(LFUN_INSET_TABULAR, params());
+       string const val(tostr(params().first) + " " + tostr(params().second)); 
+       lv_.getLyXFunc()->dispatch(LFUN_INSET_TABULAR, val);
 }