]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSymbol.cpp
nullptr
[lyx.git] / src / mathed / InsetMathSymbol.cpp
index 276fab9ddcc8918836bdc3ab9725f5105fae1132..291dabb3b9d037e85d1ce57b8ea69dfb7295abc6 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "support/debug.h"
 #include "support/docstream.h"
-#include "support/lyxlib.h"
 #include "support/textutils.h"
 #include "support/unique_ptr.h"
 
@@ -59,23 +58,22 @@ docstring InsetMathSymbol::name() const
 
 
 /// The default limits value
-Limits InsetMathSymbol::defaultLimits() const
+Limits InsetMathSymbol::defaultLimits(bool display) const
 {
-       return (allowsLimitsChange() && sym_->extra != "func")
-                       ? LIMITS : NO_LIMITS;
+       if (allowsLimitsChange() && sym_->extra != "func" && display)
+               return LIMITS;
+       else
+               return NO_LIMITS;
 }
 
 
 void InsetMathSymbol::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       mathedSymbolDim(mi.base, dim, sym_);
+       // set dim
+       // FIXME: this should depend on BufferView
+       // set negative kerning_ so that a subscript is moved leftward
+       kerning_ = -mathedSymbolDim(mi.base, dim, sym_);
        if (sym_->draw != sym_->name) {
-               // set dim
-               // FIXME: this should depend on BufferView
-               // set kerning_
-               kerning_ = mathed_char_kerning(mi.base.font,
-                                              mathedSymbol(mi.base, sym_).back());
-
                // align character vertically
                // FIXME: this should depend on BufferView
                h_ = 0;
@@ -158,7 +156,7 @@ void InsetMathSymbol::mathematica(MathematicaStream & os) const
 }
 
 
-void InsetMathSymbol::mathmlize(MathStream & ms) const
+void InsetMathSymbol::mathmlize(MathMLStream & ms) const
 {
        // FIXME We may need to do more interesting things
        // with MathMLtype.
@@ -207,7 +205,7 @@ void InsetMathSymbol::octave(OctaveStream & os) const
 }
 
 
-void InsetMathSymbol::write(WriteStream & os) const
+void InsetMathSymbol::write(TeXMathStream & os) const
 {
        unique_ptr<MathEnsurer> ensurer;
        if (currentMode() != TEXT_MODE)