]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_inset.h
use the new sstream return non-pods as const, use string instead of char * in a lot...
[lyx.git] / src / mathed / math_inset.h
index fa80cf4eef15b71a7f1a18ddf978f604e7890a85..1b374a866d7b25c2c94939a5936d0d52ec2065d8 100644 (file)
@@ -36,7 +36,8 @@
 class MathFuncInset: public MathedInset  {
 public:
        ///
-       MathFuncInset(char const * nm,
+       explicit
+       MathFuncInset(string const & nm,
                      short ot = LM_OT_FUNC, short st = LM_ST_TEXT);
        ///
        ~MathFuncInset();
@@ -45,7 +46,7 @@ public:
        ///
        void draw(Painter &, int, int);
        ///
-       void Write(std::ostream &);
+       void Write(std::ostream &, bool fragile);
        ///
        void Metrics();
        ///
@@ -56,7 +57,7 @@ protected:
        ///
        bool lims;
        ///
-       char * fname;
+       string fname;
 };
 
 
@@ -74,7 +75,7 @@ public:
        ///
        void draw(Painter &, int, int);
        ///
-       void Write(std::ostream &);
+       void Write(std::ostream &, bool fragile);
        ///
        void Metrics();
        ///
@@ -98,13 +99,13 @@ protected:
 class MathDotsInset: public MathedInset {
 public:
        ///
-       MathDotsInset(char const *, int, short st = LM_ST_TEXT);
+       MathDotsInset(string const &, int, short st = LM_ST_TEXT);
        ///
        MathedInset * Clone();
        ///
        void draw(Painter &, int, int);
        ///
-       void Write(std::ostream &);
+       void Write(std::ostream &, bool fragile);
        ///
        void Metrics();
 protected:
@@ -123,7 +124,7 @@ public:
        ///
        void draw(Painter &, int, int);
        ///
-       void Write(std::ostream &);
+       void Write(std::ostream &, bool fragile);
        ///
        inline void Metrics();
        ///
@@ -140,13 +141,13 @@ protected:
 class MathBigopInset: public MathedInset {
 public:
        ///
-       MathBigopInset(char const *, int, short st = LM_ST_TEXT);
+       MathBigopInset(string const &, int, short st = LM_ST_TEXT);
        ///
        MathedInset * Clone();
        ///
        void draw(Painter &, int, int);
        ///
-       void Write(std::ostream &);
+       void Write(std::ostream &, bool fragile);
        ///
        void Metrics();
        ///
@@ -173,7 +174,7 @@ public:
        ///
        void draw(Painter &, int x, int baseline);
        ///
-       void Write(std::ostream &);
+       void Write(std::ostream &, bool fragile);
        ///
        void Metrics();
        ///
@@ -196,7 +197,7 @@ public:
        ///
        void draw(Painter &, int x, int baseline);
        ///
-       void Write(std::ostream &);
+       void Write(std::ostream &, bool fragile);
        ///
        void Metrics();
        
@@ -242,7 +243,7 @@ public:
        ///
        void draw(Painter &, int, int);
        ///
-       void Write(std::ostream &);
+       void Write(std::ostream &, bool fragile);
        ///
        void Metrics();
 protected:
@@ -263,7 +264,7 @@ public:
        ///
        void draw(Painter &, int, int);
        ///
-       void Write(std::ostream &);
+       void Write(std::ostream &, bool fragile);
        ///
        void Metrics();
        ///
@@ -283,9 +284,7 @@ protected:
  
 inline
 MathFuncInset::~MathFuncInset()
-{
-    if (fname && GetType() == LM_OT_UNDEF) delete[] fname;
-}
+{}
 
 
 inline
@@ -296,7 +295,7 @@ bool MathFuncInset::GetLimits() const
 
 
 inline
-void MathFuncInset::Write(std::ostream & os)
+void MathFuncInset::Write(std::ostream & os, bool /* fragile */)
 {
        os << "\\" << name << ' ';
 }