]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_macro.C
fix typo that put too many include paths for most people
[lyx.git] / src / mathed / math_macro.C
index b1360a33a5e8fdfa859b97ab33208366d8b41f6c..3cf76db27b4908c164e563e8cd0d792c05b77fd0 100644 (file)
@@ -66,6 +66,12 @@ bool MathMacro::defining() const
 }
 
 
+void MathMacro::expand() const
+{
+       expanded_ = tmplate_->xcell(tmplate_->cell(1).empty() ? 0 : 1);
+}
+
+
 void MathMacro::metrics(MathMetricsInfo const & mi) const
 {
        whichFont(font_, LM_TC_TEX, mi);
@@ -77,7 +83,7 @@ void MathMacro::metrics(MathMetricsInfo const & mi) const
        }
 
        if (editing()) {
-               expanded_ = tmplate_->xcell(0);
+               expand();
                expanded_.metrics(mi_);
                width_   = expanded_.width()   + 4;
                ascent_  = expanded_.ascent()  + 2;
@@ -100,7 +106,7 @@ void MathMacro::metrics(MathMetricsInfo const & mi) const
                return;
        }
 
-       expanded_ = tmplate_->xcell(0);
+       expand();
        expanded_.data_.substitute(*this);
        expanded_.metrics(mi_);
        width_   = expanded_.width();
@@ -232,6 +238,6 @@ void MathMacro::write(WriteStream & os) const
 
 void MathMacro::updateExpansion() const
 {
-       expanded_ = tmplate_->xcell(0);
+       expand();
        expanded_.data_.substitute(*this);
 }