X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FMetricsInfo.cpp;h=a90a62bc176d7fa3c5662f8412bb646ed35286b9;hb=4a75fe0310ac64a079edab0c07d8f8eebaf519c0;hp=514693e4a686f01a85d4c001c840be3e068c5ed5;hpb=eea79637c78bb9916031924eca7b305cfb8e83df;p=lyx.git diff --git a/src/MetricsInfo.cpp b/src/MetricsInfo.cpp index 514693e4a6..a90a62bc17 100644 --- a/src/MetricsInfo.cpp +++ b/src/MetricsInfo.cpp @@ -18,12 +18,13 @@ #include "frontends/Painter.h" -#include +#include "support/docstring.h" +#include "support/lassert.h" -namespace lyx { +using namespace std; -using std::string; +namespace lyx { MetricsBase::MetricsBase() @@ -32,23 +33,18 @@ 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) @@ -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));