X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fmath_unknowninset.C;h=b7256c3d58e551822416ff2b12d8361aec1f0d1c;hb=c649284611c4198c9d70be8a16d153cdf1ec0700;hp=b58588e1fa0cb852391274200344ed414176b51d;hpb=2dabaa33dec0a1fa17c9309e3d6cf029d6a76509;p=lyx.git diff --git a/src/mathed/math_unknowninset.C b/src/mathed/math_unknowninset.C index b58588e1fa..b7256c3d58 100644 --- a/src/mathed/math_unknowninset.C +++ b/src/mathed/math_unknowninset.C @@ -5,17 +5,13 @@ #endif #include "math_unknowninset.h" -#include "frontends/Painter.h" #include "math_support.h" #include "math_mathmlstream.h" #include "math_streamstr.h" -extern LyXFont WhichFont(short type, int size); - - -MathUnknownInset::MathUnknownInset(string const & nm) - : name_(nm) +MathUnknownInset::MathUnknownInset(string const & nm, bool final, bool black) + : name_(nm), final_(final), black_(black) {} @@ -31,9 +27,9 @@ string const & MathUnknownInset::name() const } -void MathUnknownInset::setName(string const & n) +string & MathUnknownInset::name() { - name_ = n; + return name_; } @@ -56,16 +52,30 @@ void MathUnknownInset::normalize(NormalStream & os) const } -void MathUnknownInset::metrics(MathMetricsInfo const & mi) const +void MathUnknownInset::metrics(MathMetricsInfo & mi) const +{ + mathed_string_dim(mi.base.font, name_, ascent_, descent_, width_); +} + + +void MathUnknownInset::draw(MathPainterInfo & pi, int x, int y) const +{ + if (black_) + drawStrBlack(pi, x, y, name_); + else + drawStrRed(pi, x, y, name_); +} + + +void MathUnknownInset::finalize() { - whichFont(font_, LM_TC_TEX, mi); - mathed_string_dim(font_, name_, ascent_, descent_, width_); + final_ = true; } -void MathUnknownInset::draw(Painter & pain, int x, int y) const +bool MathUnknownInset::final() const { - drawStr(pain, font_, x, y, name_); + return final_; }