]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathNest.cpp
* src/mathed/InsetMathHull.cpp:
[lyx.git] / src / mathed / InsetMathNest.cpp
index 372c30786a9fa182ddbaf76449f063305be58048..c77b24068f3bdc616fb0bc34013b6ba61b54b284 100644 (file)
@@ -336,9 +336,8 @@ MathData InsetMathNest::glue() const
 
 void InsetMathNest::write(WriteStream & os) const
 {
-       bool textmode = os.textMode();
-       os.textMode(currentMode() == TEXT_MODE);
-       docstring const latex_name = name().c_str();
+       ModeSpecifier specifier(os, currentMode());
+       docstring const latex_name = name();
        os << '\\' << latex_name;
        for (size_t i = 0; i < nargs(); ++i)
                os << '{' << cell(i) << '}';
@@ -348,13 +347,12 @@ void InsetMathNest::write(WriteStream & os) const
                os << "\\lyxlock";
                os.pendingSpace(true);
        }
-       os.textMode(textmode);
 }
 
 
 void InsetMathNest::normalize(NormalStream & os) const
 {
-       os << '[' << name().c_str();
+       os << '[' << name();
        for (size_t i = 0; i < nargs(); ++i)
                os << ' ' << cell(i);
        os << ']';
@@ -363,7 +361,8 @@ void InsetMathNest::normalize(NormalStream & os) const
 
 int InsetMathNest::latex(odocstream & os, OutputParams const & runparams) const
 {
-       WriteStream wi(os, runparams.moving_arg, true, runparams.dryrun);
+       WriteStream wi(os, runparams.moving_arg, true, runparams.dryrun,
+                       runparams.encoding);
        write(wi);
        return wi.line();
 }