#include <config.h>
+#include "BufferView.h"
+#include "LColor.h"
#include "metricsinfo.h"
+
#include "mathed/math_support.h"
+
#include "frontends/Painter.h"
-#include "BufferView.h"
-#include "LColor.h"
+
+#include <boost/assert.hpp>
using std::string;
{}
-
MetricsBase::MetricsBase(BufferView * b, LyXFont const & f, int w)
: bv(b), font(f), style(LM_ST_TEXT), fontname("mathnormal"),
textwidth(w)
-PainterInfo::PainterInfo(BufferView * bv)
- : pain(bv->painter())
+PainterInfo::PainterInfo(BufferView * bv, Painter & painter)
+ : pain(painter), ltr_pos(false)
{
base.bv = bv;
}
StyleChanger::StyleChanger(MetricsBase & mb, Styles style)
: Changer<MetricsBase>(mb)
{
- static const int diff[4][4] = { { 0, 0, -3, -5 },
- { 0, 0, -3, -5 },
- { 3, 3, 0, -2 },
- { 5, 5, 2, 0 } };
+ static const int diff[4][4] =
+ { { 0, 0, -3, -5 },
+ { 0, 0, -3, -5 },
+ { 3, 3, 0, -2 },
+ { 5, 5, 2, 0 } };
save_ = mb;
int t = diff[mb.style][style];
if (t > 0)
: Changer<MetricsBase>(mb)
{
save_ = mb;
+ LyXFont::FONT_SIZE oldsize = save_.font.size();
mb.fontname = name;
mb.font = LyXFont();
augmentFont(mb.font, name);
+ mb.font.setSize(oldsize);
}
ColorChanger::ColorChanger(LyXFont & font, string const & color)
: Changer<LyXFont, string>(font)
{
- save_ = lcolor.getFromGUIName(color);
- font.setColor(lcolor.getFromGUIName(color));
+ save_ = lcolor.getFromLyXName(color);
+ font.setColor(lcolor.getFromLyXName(color));
}
ColorChanger::~ColorChanger()
{
- orig_.setColor(lcolor.getFromGUIName(save_));
+ orig_.setColor(lcolor.getFromLyXName(save_));
}