From 6adb9c9122a44ea59d3594b0619c34a0410d81ca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Fri, 12 Jul 2002 10:28:15 +0000 Subject: [PATCH] remove unneeded inset git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4616 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/Makefile.am | 2 -- src/mathed/formula.C | 10 +++++-- src/mathed/math_limitopinset.C | 54 ---------------------------------- src/mathed/math_limitopinset.h | 38 ------------------------ src/mathed/math_support.C | 2 +- 5 files changed, 8 insertions(+), 98 deletions(-) delete mode 100644 src/mathed/math_limitopinset.C delete mode 100644 src/mathed/math_limitopinset.h diff --git a/src/mathed/Makefile.am b/src/mathed/Makefile.am index d97a40e096..ace3629e13 100644 --- a/src/mathed/Makefile.am +++ b/src/mathed/Makefile.am @@ -79,8 +79,6 @@ libmathed_la_SOURCES = \ math_kerninset.h \ math_lefteqninset.C \ math_lefteqninset.h \ - math_limitopinset.C \ - math_limitopinset.h \ math_macro.C \ math_macro.h \ math_macroarg.C \ diff --git a/src/mathed/formula.C b/src/mathed/formula.C index 50bd5db958..0718df31fe 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -214,6 +214,10 @@ void InsetFormula::read(Buffer const *, LyXLex & lex) void InsetFormula::draw(BufferView * bv, LyXFont const & font, int y, float & xx, bool) const { + // This initiates the loading of the preview, so should come + // before the metrics are computed. + bool const use_preview = preview_->usePreview(); + int const x = int(xx); int const w = width(bv, font); int const d = descent(bv, font); @@ -222,9 +226,9 @@ void InsetFormula::draw(BufferView * bv, LyXFont const & font, MathPainterInfo pi(bv->painter()); - if (preview_->usePreview()) { + if (use_preview) { pi.pain.image(x + 1, y - a + 1, w - 2, h - 2, - *(preview_->pimage_->image())); + *(preview_->pimage_->image(*this, *bv))); } else { //pi.base.style = display() ? LM_ST_DISPLAY : LM_ST_TEXT; pi.base.style = LM_ST_TEXT; @@ -526,7 +530,7 @@ bool InsetFormula::PreviewImpl::usePreview() const if (!pimage_) return false; - return pimage_->image(); + return pimage_->image(parent_, *view); } diff --git a/src/mathed/math_limitopinset.C b/src/mathed/math_limitopinset.C deleted file mode 100644 index d901f52e15..0000000000 --- a/src/mathed/math_limitopinset.C +++ /dev/null @@ -1,54 +0,0 @@ -#include "math_limitopinset.h" -#include "math_support.h" -#include "math_mathmlstream.h" -#include "math_symbolinset.h" -#include "debug.h" - - -MathLimitOpInset::MathLimitOpInset(MathScriptInset const & scripts, - MathArray const & core) - : int_(new MathSymbolInset("int")), - scripts_(scripts), core_(core) -{} - - -MathInset * MathLimitOpInset::clone() const -{ - return new MathLimitOpInset(*this); -} - - -void MathLimitOpInset::write(WriteStream & os) const -{ - scripts_.write2(int_.nucleus(), os); - os << core_ << "d" << diff_; -} - - -void MathLimitOpInset::normalize(NormalStream &) const -{ - //os << "[int " << scripts_ << ' ' << core_ << ' ' << diff_ << ']' -} - - -void MathLimitOpInset::metrics(MathMetricsInfo &) const -{ - lyxerr << "should not happen\n"; -} - - -void MathLimitOpInset::draw(MathPainterInfo &, int, int) const -{ - lyxerr << "should not happen\n"; -} - - -void MathLimitOpInset::maplize(MapleStream &) const -{ - //os << name_ << '(' << cell(0) << ')'; -} - -void MathLimitOpInset::mathmlize(MathMLStream &) const -{ - //os << name_ << '(' << cell(0) << ')'; -} diff --git a/src/mathed/math_limitopinset.h b/src/mathed/math_limitopinset.h deleted file mode 100644 index 5c9e4c01b1..0000000000 --- a/src/mathed/math_limitopinset.h +++ /dev/null @@ -1,38 +0,0 @@ -// -*- C++ -*- -#ifndef MATH_LIMITOPINSET_H -#define MATH_LIMITOPINSET_H - -// /\sum_l^u f(x) in one block -// for interfacing external programs - -#include "math_scriptinset.h" - -class MathLimitOpInset : public MathInset { -public: - /// - MathLimitOpInset(MathScriptInset const &, MathArray const &); - /// - MathInset * clone() const; - /// - void metrics(MathMetricsInfo & st) const; - /// - void draw(MathPainterInfo &, int x, int y) const; - /// - void write(WriteStream & os) const; - /// - void normalize(NormalStream &) const; - /// - void maplize(MapleStream &) const; - /// - void mathmlize(MathMLStream &) const; -private: - /// - MathAtom int_; - /// - MathScriptInset scripts_; - /// - MathArray core_; - /// - MathArray diff_; -}; -#endif diff --git a/src/mathed/math_support.C b/src/mathed/math_support.C index 8d576ae111..ee875f25b6 100644 --- a/src/mathed/math_support.C +++ b/src/mathed/math_support.C @@ -526,7 +526,7 @@ LyXFont::FONT_SHAPE const inh_shape = LyXFont::INHERIT_SHAPE; // mathnormal should be the first, otherwise the fallback fuerther down // does not work fontinfo fontinfos[] = { - {"mathnormal", inh_family,inh_series, LyXFont::UP_SHAPE, LColor::math}, + {"mathnormal", inh_family, LyXFont::MEDIUM_SERIES, LyXFont::UP_SHAPE, LColor::math}, {"mathbf", inh_family, LyXFont::BOLD_SERIES, inh_shape, LColor::math}, {"mathcal",LyXFont::CMSY_FAMILY, inh_series, inh_shape, LColor::math}, {"mathfrak", LyXFont::EUFRAK_FAMILY, inh_series, inh_shape, LColor::math}, -- 2.39.2