]> git.lyx.org Git - features.git/blobdiff - src/frontends/xforms/FormInset.C
Pass and store references to LyXView and Dialogs, not pointers in the
[features.git] / src / frontends / xforms / FormInset.C
index 1c3506ca7e2d7698d7cc8449c63138ca4aed1840..3d0b47f126661b39e6952444ce294cf9622baff0 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright 2000-2001 The LyX Team.
  * See the file COPYING.
  *
- * \author Angus Leeming, a.leeming@ic.ac.uk
+ * \author Angus Leeming <leeming@lyx.org>
  */
 
 #include <config.h>
 #pragma implementation
 #endif
 
-#include "Dialogs.h"
-#include "frontends/LyXView.h"
 #include "FormInset.h"
-#include "xformsBC.h"
-#include "insets/insetcommand.h"
+
+#include "frontends/Dialogs.h"
 
 #include <boost/bind.hpp>
 
-FormInset::FormInset(LyXView * lv, Dialogs * d, string const & t)
+FormInset::FormInset(LyXView & lv, Dialogs & d, string const & t)
        : FormBaseBD(lv, d, t)
 {}
 
 
 void FormInset::connect()
 {
-       u_ = d_->updateBufferDependent.
+       u_ = d_.updateBufferDependent.
                connect(boost::bind(&FormInset::updateSlot, this, _1));
-       h_ = d_->hideBufferDependent.
+       h_ = d_.hideBufferDependent.
                connect(boost::bind(&FormInset::hide, this));
        FormBaseDeprecated::connect();
 }
@@ -51,46 +49,3 @@ void FormInset::updateSlot(bool switched)
        else
                update();
 }
-
-
-FormCommand::FormCommand(LyXView * lv, Dialogs * d, string const & t)
-       : FormInset(lv, d, t),
-         inset_(0)
-{}
-
-
-void FormCommand::disconnect()
-{
-       inset_ = 0;
-       params = InsetCommandParams(string());
-       FormInset::disconnect();
-}
-
-
-void FormCommand::showInset(InsetCommand * inset)
-{
-       if (inset == 0) return;  // maybe we should Assert this?
-
-       // If connected to another inset, disconnect from it.
-       if (inset_)
-               ih_.disconnect();
-
-       inset_    = inset;
-       params    = inset->params();
-       ih_ = inset->hideDialog.connect(boost::bind(&FormCommand::hide, this));
-       show();
-}
-
-
-void FormCommand::createInset(string const & arg)
-{
-       if (inset_) {
-               ih_.disconnect();
-               inset_ = 0;
-       }
-
-       params.setFromString(arg);
-       if (!arg.empty())
-               bc().valid(); // so that the user can press Ok
-       show();
-}