]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlTabularCreate.C
fix crash due to invalidated iterator
[lyx.git] / src / frontends / controllers / ControlTabularCreate.C
index e1e0b2850f53080d9f1d125c682b8dc7a192b54a..e7bd1e430b44d6114a9694aa1b71c4a2279e4e84 100644 (file)
@@ -5,46 +5,47 @@
  *
  * \author unknown
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-
 #include "ControlTabularCreate.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
-#include "lyxfunc.h"
 #include "funcrequest.h"
 
+#include "support/convert.h"
+
 
-#include "support/lstrings.h"
+using std::string;
 
+namespace lyx {
+namespace frontend {
 
-ControlTabularCreate::ControlTabularCreate(LyXView & lv, Dialogs & d)
-       : ControlDialogBD(lv, d)
+ControlTabularCreate::ControlTabularCreate(Dialog & parent)
+       : Dialog::Controller(parent)
 {}
 
 
-ControlTabularCreate::rowsCols & ControlTabularCreate::params()
+bool ControlTabularCreate::initialiseParams(string const &)
 {
-       return params_;
+       params_.first  = 5;
+       params_.second = 5;
+       return true;
 }
 
 
-void ControlTabularCreate::setParams()
+void ControlTabularCreate::clearParams()
 {
-       bc().valid(); // so that the user can press Ok
+       params_.first  = 0;
+       params_.second = 0;
 }
 
 
-void ControlTabularCreate::apply()
+void ControlTabularCreate::dispatchParams()
 {
-       if (!bufferIsAvailable())
-               return;
-
-       view().apply();
-
-       string const val = tostr(params().first) + ' ' + tostr(params().second);
-       lyxfunc().dispatch(FuncRequest(LFUN_TABULAR_INSERT, val));
+       string const data = convert<string>(params().first) + ' ' + convert<string>(params().second);
+       kernel().dispatch(FuncRequest(getLfun(), data));
 }
+
+} // namespace frontend
+} // namespace lyx