]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_macro.C
Hopefully fix the problem with stateText() in lyxfont.C
[lyx.git] / src / mathed / math_macro.C
index 269e8c31882deda3a88ba8342e80e1c18e8fcd38..a68705933dd2997f19462f4a2e88fa6a6fa4e0f7 100644 (file)
@@ -30,6 +30,8 @@
 #include "support/lstrings.h"
 #include "debug.h"
 
+using std::ostream;
+using std::endl;
 
 ostream & operator<<(ostream & o, MathedTextCodes mtc)
 {
@@ -156,13 +158,13 @@ void MathMacro::SetFocus(int x, int y)
 }
 
 
-void MathMacro::Write(ostream & os)
+void MathMacro::Write(ostream & os, bool fragile)
 {
     if (tmplate->flags & MMF_Exp) {
            lyxerr[Debug::MATHED] << "Expand " << tmplate->flags
                                  << ' ' << MMF_Exp << endl; 
        tmplate->update(this);
-       tmplate->Write(os);
+       tmplate->Write(os, fragile);
     } else {
        if (tmplate->flags & MMF_Env) {
                os << "\\begin{"
@@ -182,7 +184,7 @@ void MathMacro::Write(ostream & os)
        
        for (int i = 0; i < nargs; ++i) {
            array = args[i].array;
-           MathParInset::Write(os);
+           MathParInset::Write(os, fragile);
            if (i < nargs - 1)  
                    os << "}{";
        }   
@@ -216,7 +218,7 @@ void MathMacroArgument::draw(Painter & pain, int x, int baseline)
        MathParInset::draw(pain, x, baseline);
     } else {
 #ifdef HAVE_SSTREAM
-           ostringstream ost;
+           std::ostringstream ost;
            ost << '#' << number;
            drawStr(pain, LM_TC_TEX, size, x, baseline, 
                    reinterpret_cast<byte const *>(ost.str().c_str()), 2);
@@ -237,7 +239,7 @@ void MathMacroArgument::Metrics()
        MathParInset::Metrics();
     } else {
 #ifdef HAVE_SSTREAM
-           ostringstream ost;
+           std::ostringstream ost;
            ost << '#' << number;
            width = mathed_string_width(LM_TC_TEX, size, 
                                        reinterpret_cast<byte const *>(ost.str().c_str()), 2);
@@ -259,10 +261,10 @@ void MathMacroArgument::Metrics()
 }
 
 
-void MathMacroArgument::Write(ostream & os)
+void MathMacroArgument::Write(ostream & os, bool fragile)
 {
     if (expnd_mode) {
-       MathParInset::Write(os);
+       MathParInset::Write(os, fragile);
     } else {
            os << '#' << number << ' ';
     }
@@ -373,7 +375,7 @@ void MathMacroTemplate::update(MathMacro * macro)
 }
     
 
-void MathMacroTemplate::WriteDef(ostream & os)
+void MathMacroTemplate::WriteDef(ostream & os, bool fragile)
 {
        os << "\n\\newcommand{\\" << name << "}";
       
@@ -385,7 +387,7 @@ void MathMacroTemplate::WriteDef(ostream & os)
     for (int i = 0; i < nargs; ++i) {
        args[i].setExpand(false);
     }   
-    Write(os); 
+    Write(os, fragile); 
     os << "}\n";
 }