]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_biginset.C
Andreas' patch to prevent crash on click on previewd inset
[lyx.git] / src / mathed / math_biginset.C
index 5c02ff820749736f236d3bfe5e8d7653dd9c41b6..ade63c123b3c9671fcb3e54c6be67ed3021e3e15 100644 (file)
@@ -1,20 +1,33 @@
+/**
+ * \file math_biginset.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
 #include <config.h>
 
 #include "math_biginset.h"
 #include "math_support.h"
-#include "math_parser.h"
 #include "math_mathmlstream.h"
 #include "math_streamstr.h"
 
 
+using std::string;
+using std::auto_ptr;
+
+
 MathBigInset::MathBigInset(string const & name, string const & delim)
        : name_(name), delim_(delim)
 {}
 
 
-MathInset * MathBigInset::clone() const
+auto_ptr<InsetBase> MathBigInset::doClone() const
 {
-       return new MathBigInset(*this);
+       return auto_ptr<InsetBase>(new MathBigInset(*this));
 }
 
 
@@ -32,23 +45,23 @@ double MathBigInset::increase() const
                case 3:  return 0.7;
                default: return 0.0;
        }
-       return 0.0;
 }
 
 
-void MathBigInset::metrics(MetricsInfo & mi) const
+void MathBigInset::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        double const h = mathed_char_ascent(mi.base.font, 'I');
        double const f = increase();
        dim_.wid = 6;
        dim_.asc = int(h + f * h);
        dim_.des = int(f * h);
+       dim = dim_;
 }
 
 
 void MathBigInset::draw(PainterInfo & pi, int x, int y) const
 {
-       mathed_draw_deco(pi, x + 1, y - ascent(), 4, height(), delim_);
+       mathed_draw_deco(pi, x + 1, y - dim_.ascent(), 4, dim_.height(), delim_);
 }