X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FMetricsInfo.cpp;h=02a458dbeb04c1dc603176335780df1ada16893c;hb=9337d73f1f9a6d4dae2e239e9f679a7452660c40;hp=0ddf21ca17ec11b5d930ae5b8adff6b72629354c;hpb=bc6304d760f5bd8ef67065fdc73279e1aa792c85;p=lyx.git diff --git a/src/MetricsInfo.cpp b/src/MetricsInfo.cpp index 0ddf21ca17..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,26 +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), - background_color(Color::background) + background_color(Color_background) { base.bv = bv; } @@ -114,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); @@ -161,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); } @@ -173,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); } @@ -203,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));