]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/command_inset.C
Fix to bug 2362: Deleting superscript also deletes subscript.
[lyx.git] / src / mathed / command_inset.C
index 1e06d4626811e8109b5988e6b99318042db05147..fcfa79d16a326288eff6da2e1787351dfa7c6ee0 100644 (file)
@@ -15,8 +15,8 @@
 #include "math_mathmlstream.h"
 #include "dispatchresult.h"
 #include "funcrequest.h"
-#include "support/std_sstream.h"
 
+#include <sstream>
 
 using std::string;
 using std::auto_ptr;
@@ -24,15 +24,13 @@ using std::ostringstream;
 
 
 CommandInset::CommandInset(string const & name)
-       : MathNestInset(2),
-         name_(name),
-         set_label_(false)
+       : MathNestInset(2), name_(name), set_label_(false)
 {
        lock_ = true;
 }
 
 
-auto_ptr<InsetBase> CommandInset::clone() const
+auto_ptr<InsetBase> CommandInset::doClone() const
 {
        return auto_ptr<InsetBase>(new CommandInset(*this));
 }
@@ -45,6 +43,14 @@ void CommandInset::metrics(MetricsInfo & mi, Dimension & dim) const
                button_.update(screenLabel(), true);
        }
        button_.metrics(mi, dim);
+       dim_ = dim;
+}
+
+
+InsetBase * CommandInset::editXY(LCursor & cur, int /*x*/, int /*y*/)
+{
+       edit(cur, true);
+       return this;
 }
 
 
@@ -66,16 +72,16 @@ void CommandInset::write(WriteStream & os) const
 
 string const CommandInset::screenLabel() const
 {
-       return name_;
+       return name_;
 }
 
 
 string const CommandInset::createDialogStr(string const & name) const
 {
-       ostringstream data;
-       data << name << " LatexCommand ";
-       WriteStream wsdata(data);
-       write(wsdata);
-       wsdata << "\n\\end_inset\n\n";
-       return data.str();
+       ostringstream os;
+       os << name << " LatexCommand ";
+       WriteStream ws(os);
+       write(ws);
+       ws << "\n\\end_inset\n\n";
+       return os.str();
 }