]> git.lyx.org Git - lyx.git/blobdiff - src/metricsinfo.C
more cursor dispatch
[lyx.git] / src / metricsinfo.C
index 1202520b80e97eb7b2e2c62739aa6f4397408962..1283c687f2e5b8fb2f75bd10b2d411c5acd4964f 100644 (file)
@@ -1,12 +1,22 @@
+/**
+ * \file metricsinfo.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
 
 #include <config.h>
 
 #include "metricsinfo.h"
 #include "mathed/math_support.h"
 #include "frontends/Painter.h"
-#include "debug.h"
 #include "BufferView.h"
+#include "LColor.h"
 
+using std::string;
 
 
 MetricsBase::MetricsBase()
@@ -136,9 +146,11 @@ FontSetChanger::FontSetChanger(MetricsBase & mb, char const * name)
 {
        save_ = mb;
        mb.fontname = name;
+       mb.font = LyXFont();
        augmentFont(mb.font, name);
 }
 
+
 FontSetChanger::~FontSetChanger()
 {
        orig_ = save_;
@@ -149,7 +161,7 @@ WidthChanger::WidthChanger(MetricsBase & mb, int w)
        :       Changer<MetricsBase>(mb)
 {
        save_ = mb;
-       mb.textwidth     = w;
+       mb.textwidth = w;
 }
 
 
@@ -157,3 +169,19 @@ WidthChanger::~WidthChanger()
 {
        orig_ = save_;
 }
+
+
+
+
+ColorChanger::ColorChanger(LyXFont & font, string const & color)
+       : Changer<LyXFont, string>(font)
+{
+       save_ = lcolor.getFromLyXName(color);
+       font.setColor(lcolor.getFromLyXName(color));
+}
+
+
+ColorChanger::~ColorChanger()
+{
+       orig_.setColor(lcolor.getFromLyXName(save_));
+}