#include "BufferView.h"
#include "Cursor.h"
-#include "debug.h"
-#include "gettext.h"
-#include "Color.h"
+#include "support/debug.h"
+#include "support/gettext.h"
#include "Lexer.h"
#include "OutputParams.h"
#include <sstream>
-using std::string;
-using std::auto_ptr;
-using std::ostream;
-using std::endl;
+using namespace std;
+using namespace lyx::support;
namespace lyx {
-using support::bformat;
-
InsetFormulaMacro::InsetFormulaMacro()
: InsetMathNest(2), name_("unknownA")
InsetFormulaMacro::InsetFormulaMacro(string const & s)
: InsetMathNest(2), name_("unknownB")
{
- std::istringstream is(s);
+ istringstream is(s);
read(is);
}
-auto_ptr<Inset> InsetFormulaMacro::clone() const
+Inset * InsetFormulaMacro::clone() const
{
- return auto_ptr<Inset>(new InsetFormulaMacro(*this));
+ return new InsetFormulaMacro(*this);
}
}
-void InsetFormulaMacro::read(std::istream & is)
+void InsetFormulaMacro::read(istream & is)
{
auto_ptr<MathMacroTemplate> p(new MathMacroTemplate(is));
name_ = p->name();
}
-bool InsetFormulaMacro::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetFormulaMacro::metrics(MetricsInfo & mi, Dimension & dim) const
{
//lyxerr << "InsetFormulaMacro: " << this << " -- " << &tmpl() << endl;
tmpl()->metrics(mi, dim);
dim.asc += 5;
dim.des += 5;
dim.wid += 10 + theFontMetrics(mi.base.font).width(prefix());
- bool const changed = dim_ != dim;
dim_ = dim;
- return changed;
}
{
// label
Font font = p.base.font;
- font.setColor(Color::math);
+ font.setColor(Color_math);
PainterInfo pi(p.base.bv, p.pain);
pi.base.style = LM_ST_TEXT;
int const w = dim_.wid - 2;
int const h = dim_.height() - 2;
- // Color::mathbg used to be "AntiqueWhite" but is "linen" now, too
- pi.pain.fillRectangle(x, a, w, h, Color::mathmacrobg);
- pi.pain.rectangle(x, a, w, h, Color::mathframe);
+ // Color_mathbg used to be "AntiqueWhite" but is "linen" now, too
+ pi.pain.fillRectangle(x, a, w, h, Color_mathmacrobg);
+ pi.pain.rectangle(x, a, w, h, Color_mathframe);
-#ifdef WITH_WARNINGS
-#warning FIXME
-#endif
+ // FIXME
#if 0
Cursor & cur = p.base.bv->cursor();
if (cur.isInside(this))