* This code is under the GNU General Public Licence version 2 or later.
*/
+#include <config.h>
#include "math_macro.h"
#include "math_support.h"
using std::max;
+using std::auto_ptr;
+using std::endl;
MathMacro::MathMacro(string const & name)
-MathInset * MathMacro::clone() const
+auto_ptr<InsetBase> MathMacro::clone() const
{
- return new MathMacro(*this);
+ return auto_ptr<InsetBase>(new MathMacro(*this));
}
}
-Dimension MathMacro::metrics(MetricsInfo & mi) const
+void MathMacro::metrics(MetricsInfo & mi, Dimension & dim) const
{
augmentFont(font_, "lyxtex");
mi_ = mi;
}
- return dim_;
+ dim = dim_;
}
void MathMacro::draw(PainterInfo & pi, int x, int y) const
{
- metrics(mi_);
+ metrics(mi_, dim_);
LyXFont texfont;
augmentFont(texfont, "lyxtex");
void MathMacro::dump() const
{
MathMacroTable::dump();
- lyxerr << "\n macro: '" << this << "'\n";
- lyxerr << " name: '" << name() << "'\n";
- lyxerr << " template: '";
+ lyxerr << "\n macro: '" << this << "'\n"
+ << " name: '" << name() << "'\n"
+ << " template: '";
WriteStream wi(lyxerr);
tmplate_->write(wi);
- lyxerr << "'\n";
+ lyxerr << "'" << endl;
}