]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathMacro.cpp
nullptr
[lyx.git] / src / mathed / InsetMathMacro.cpp
index 24409512e1ba7344d39031a195e8bdc6537aa32a..d2c35c7e5bea913e1d857fc319871945de87d0db 100644 (file)
@@ -169,7 +169,7 @@ public:
        ///
        void mathematica(MathematicaStream & ms) const override { ms << mathMacro_->cell(idx_); }
        ///
-       void mathmlize(MathStream & ms) const override { ms << mathMacro_->cell(idx_); }
+       void mathmlize(MathMLStream & ms) const override { ms << mathMacro_->cell(idx_); }
        ///
        void htmlize(HtmlStream & ms) const override { ms << mathMacro_->cell(idx_); }
        ///
@@ -1133,7 +1133,7 @@ bool InsetMathMacro::folded() const
 }
 
 
-void InsetMathMacro::write(WriteStream & os) const
+void InsetMathMacro::write(TeXMathStream & os) const
 {
        mode_type mode = currentMode();
        MathEnsurer ensurer(os, mode == MATH_MODE, true, mode == TEXT_MODE);
@@ -1214,8 +1214,11 @@ void InsetMathMacro::write(WriteStream & os) const
        }
 
        // add space if there was no argument
-       if (first)
+       // or add braces if we have optionals but none are present and [ follows
+       if (first) {
                os.pendingSpace(true);
+               os.useBraces(d->optionals_ > 0);
+       }
 
        // write \(no)limits modifiers if relevant
        writeLimits(os);
@@ -1240,7 +1243,7 @@ void InsetMathMacro::mathematica(MathematicaStream & os) const
 }
 
 
-void InsetMathMacro::mathmlize(MathStream & ms) const
+void InsetMathMacro::mathmlize(MathMLStream & ms) const
 {
        // macro_ is 0 if this is an unknown macro
        LATTEST(d->macro_ || d->displayMode_ != DISPLAY_NORMAL);