]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathDots.cpp
Fix bug 5802 (http://bugzilla.lyx.org/show_bug.cgi?id=5802)
[lyx.git] / src / mathed / InsetMathDots.cpp
index d90b0bdbd332fca2a207c07bd808e827355e1f54..8052f1a82030b1f3511d7972440fc38850d06657 100644 (file)
@@ -4,7 +4,7 @@
  * Licence details can be found in the file COPYING.
  *
  * \author Alejandro Aguilar Sierra
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
 #include <config.h>
 
 #include "InsetMathDots.h"
+
+#include "LaTeXFeatures.h"
 #include "MathStream.h"
 #include "MathSupport.h"
 #include "MathParser.h"
+#include "MetricsInfo.h"
 
 #include "frontends/FontMetrics.h"
 
@@ -47,19 +50,19 @@ void InsetMathDots::metrics(MetricsInfo & mi, Dimension & dim) const
        }
        else if (key_->name == "ddots")
                dh_ = dim.asc;
-       dim = dim_;
 }
 
 
 void InsetMathDots::draw(PainterInfo & pain, int x, int y) const
 {
-       mathed_draw_deco(pain, x + 2, y - dh_, dim_.width() - 2, dim_.ascent(),
+       Dimension const dim = dimension(*pain.base.bv);
+       mathed_draw_deco(pain, x + 2, y - dh_, dim.width() - 2, dim.ascent(),
                key_->name);
        if (key_->name == "vdots" || key_->name == "ddots")
                ++x;
        if (key_->name != "vdots")
                --y;
-       mathed_draw_deco(pain, x + 2, y - dh_, dim_.width() - 2, dim_.ascent(),
+       mathed_draw_deco(pain, x + 2, y - dh_, dim.width() - 2, dim.ascent(),
                key_->name);
        setPosCache(pain, x, y);
 }
@@ -71,4 +74,11 @@ docstring InsetMathDots::name() const
 }
 
 
+void InsetMathDots::validate(LaTeXFeatures & features) const
+{
+       if (!key_->requires.empty())
+               features.require(to_utf8(key_->requires));
+}
+
+
 } // namespace lyx