]> 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 9eb5254229039b4dd07fb6d53e3fc4d2bb409de6..e7bd1e430b44d6114a9694aa1b71c4a2279e4e84 100644 (file)
@@ -1,61 +1,51 @@
-/* This file is part of
- * ======================================================
- *
- *           LyX, The Document Processor
- *
- *           Copyright 2001 The LyX Team.
+/**
+ * \file ControlTabularCreate.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * ======================================================
+ * \author unknown
  *
- * \file ControlTabularCreate.C
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "ControlTabularCreate.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
-#include "BufferView.h"
-#include "Dialogs.h"
-#include "lyxfunc.h"
+#include "funcrequest.h"
 
-#include "frontends/LyXView.h"
+#include "support/convert.h"
 
-#include "support/lstrings.h"
 
-#include <boost/bind.hpp>
+using std::string;
 
-ControlTabularCreate::ControlTabularCreate(LyXView & lv, Dialogs & d)
-       : ControlDialogBD(lv, d)
-{
-       d_.showTabularCreate = boost::bind(&ControlTabularCreate::show, this);
-}
+namespace lyx {
+namespace frontend {
+
+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 (!lv_.view()->available())
-               return;
-
-       view().apply();
-
-       string const val(tostr(params().first) + " " + tostr(params().second));
-
-       lv_.getLyXFunc()->dispatch(LFUN_INSET_TABULAR, val);
+       string const data = convert<string>(params().first) + ' ' + convert<string>(params().second);
+       kernel().dispatch(FuncRequest(getLfun(), data));
 }
+
+} // namespace frontend
+} // namespace lyx