]> git.lyx.org Git - lyx.git/blobdiff - src/FontInfo.cpp
Be a bit more careful about setting and restoring the last reference
[lyx.git] / src / FontInfo.cpp
index e611288ff4422ef58d6b370b13162de02fd12bea..9edf97e52e9e7ee56e63d9e7da738a502bec1595 100644 (file)
@@ -21,6 +21,7 @@
 #include "support/debug.h"
 #include "support/docstring.h"
 #include "support/lstrings.h"
+#include "support/RefChanger.h"
 
 #include <ostream>
 #include <sstream>
@@ -245,6 +246,26 @@ FontInfo & FontInfo::realize(FontInfo const & tmplt)
 }
 
 
+Changer FontInfo::changeColor(ColorCode const color, bool cond)
+{
+       return make_change(color_, color, cond);
+}
+
+
+Changer FontInfo::changeShape(FontShape const shape, bool cond)
+{
+       return make_change(shape_, shape, cond);
+}
+
+
+Changer FontInfo::change(FontInfo font, bool realiz, bool cond)
+{
+       if (realiz)
+               font.realize(*this);
+       return make_change(*this, font, cond);
+}
+
+
 /// Updates a misc setting according to request
 static FontState setMisc(FontState newfont,
        FontState org)