]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/command_inset.C
bug + spped fixes + small stuff
[lyx.git] / src / mathed / command_inset.C
index 77570665d6d14f7857d04a1a6ac2ab2fde0e0ce7..8ddd8fbe9aff80b96dc6d302888d40f4f986e5a7 100644 (file)
@@ -1,8 +1,26 @@
+/**
+ * \file command_inset.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include <config.h>
 
 #include "command_inset.h"
+#include "math_data.h"
 #include "math_mathmlstream.h"
+#include "dispatchresult.h"
 #include "funcrequest.h"
-#include "Lsstream.h"
+#include "support/std_sstream.h"
+
+
+using std::string;
+using std::auto_ptr;
+using std::ostringstream;
 
 
 CommandInset::CommandInset(string const & name)
@@ -14,9 +32,9 @@ CommandInset::CommandInset(string const & name)
 }
 
 
-InsetBase * CommandInset::clone() const
+auto_ptr<InsetBase> CommandInset::clone() const
 {
-       return new CommandInset(*this);
+       return auto_ptr<InsetBase>(new CommandInset(*this));
 }
 
 
@@ -35,14 +53,15 @@ void CommandInset::draw(PainterInfo & pi, int x, int y) const
        button_.draw(pi, x, y);
 }
 
-dispatch_result
-CommandInset::dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
+
+DispatchResult
+CommandInset::priv_dispatch(LCursor & bv, FuncRequest const & cmd)
 {
        switch (cmd.action) {
                default:
-                       return MathNestInset::dispatch(cmd, idx, pos);
+                       return MathNestInset::priv_dispatch(bv, cmd);
        }
-       return UNDISPATCHED;
+       return DispatchResult(false);
 }
 
 
@@ -68,5 +87,5 @@ string const CommandInset::createDialogStr(string const & name) const
        WriteStream wsdata(data);
        write(wsdata);
        wsdata << "\n\\end_inset\n\n";
-       return STRCONV(data.str());
+       return data.str();
 }