X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FMetricsInfo.cpp;h=02a458dbeb04c1dc603176335780df1ada16893c;hb=42eb8a373a35da02c45c0d225d37f5d677ddfc2d;hp=b9c903f1435333ea0be178ded53351010ab867b4;hpb=ed1487dd8eeb86d20320472837c4ffdb36111a97;p=lyx.git diff --git a/src/MetricsInfo.cpp b/src/MetricsInfo.cpp index b9c903f143..02a458dbeb 100644 --- a/src/MetricsInfo.cpp +++ b/src/MetricsInfo.cpp @@ -18,13 +18,14 @@ #include "frontends/Painter.h" +#include "support/docstring.h" + #include +using namespace std; namespace lyx { -using std::string; - MetricsBase::MetricsBase() : bv(0), font(), style(LM_ST_TEXT), fontname("mathnormal"), @@ -32,25 +33,21 @@ MetricsBase::MetricsBase() {} -MetricsBase::MetricsBase(BufferView * b, Font const & f, int w) +MetricsBase::MetricsBase(BufferView * b, FontInfo const & f, int w) : bv(b), font(f), style(LM_ST_TEXT), fontname("mathnormal"), textwidth(w) {} - -MetricsInfo::MetricsInfo() -{} - - -MetricsInfo::MetricsInfo(BufferView * bv, Font const & font, int textwidth) - : base(bv, font, textwidth) +MetricsInfo::MetricsInfo(BufferView * bv, FontInfo const & font, int textwidth, + MacroContext const & mc) + : base(bv, font, textwidth), macrocontext(mc) {} - PainterInfo::PainterInfo(BufferView * bv, lyx::frontend::Painter & painter) - : pain(painter), ltr_pos(false), erased_(false), full_repaint(true) + : pain(painter), ltr_pos(false), erased_(false), full_repaint(true), + background_color(Color_background) { base.bv = bv; } @@ -113,9 +110,8 @@ ArrayChanger::ArrayChanger(MetricsBase & mb) {} - -ShapeChanger::ShapeChanger(Font & font, Font::FONT_SHAPE shape) - : Changer(font) +ShapeChanger::ShapeChanger(FontInfo & font, FontShape shape) + : Changer(font) { save_ = orig_.shape(); orig_.setShape(shape); @@ -160,9 +156,9 @@ FontSetChanger::FontSetChanger(MetricsBase & mb, char const * name) : Changer(mb) { save_ = mb; - Font::FONT_SIZE oldsize = save_.font.size(); + FontSize oldsize = save_.font.size(); mb.fontname = name; - mb.font = Font(); + mb.font = sane_font; augmentFont(mb.font, from_ascii(name)); mb.font.setSize(oldsize); } @@ -172,9 +168,9 @@ FontSetChanger::FontSetChanger(MetricsBase & mb, docstring const & name) : Changer(mb) { save_ = mb; - Font::FONT_SIZE oldsize = save_.font.size(); + FontSize oldsize = save_.font.size(); mb.fontname = to_utf8(name); - mb.font = Font(); + mb.font = sane_font; augmentFont(mb.font, name); mb.font.setSize(oldsize); } @@ -202,8 +198,8 @@ WidthChanger::~WidthChanger() -ColorChanger::ColorChanger(Font & font, string const & color) - : Changer(font) +ColorChanger::ColorChanger(FontInfo & font, string const & color) + : Changer(font) { save_ = lcolor.getFromLyXName(color); font.setColor(lcolor.getFromLyXName(color));