]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlCharacter.C
John's character.C patch (bug fix).
[lyx.git] / src / frontends / controllers / ControlCharacter.C
index 10cce2c8ce8ba7d669b0532b6df05e979970aa7d..39a4cba3132e79397244c61ce7d2b581790b06ed 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright 2001 The LyX Team.
  * See the file COPYING.
  *
- * \author Angus Leeming, a.leeming@.ac.uk
+ * \author Angus Leeming, a.leeming@ic.ac.uk
  */
 
 #include <vector>
 #include "bufferview_funcs.h" // ToggleAndShow
 #include "gettext.h"
 #include "language.h"
+#include "BufferView.h"
 
 using Liason::setMinibuffer;
 using SigC::slot;
 using std::vector;
 
+
 ControlCharacter::ControlCharacter(LyXView & lv, Dialogs & d)
        : ControlDialog<ControlConnectBD>(lv, d),
          font_(0), toggleall_(false)
 {
-       d_.showLayoutCharacter.connect(slot(this, &ControlCharacter::show));
+       d_.showCharacter.connect(slot(this, &ControlCharacter::show));
        d_.setUserFreeFont.connect(slot(this, &ControlCharacter::apply));
 }
 
@@ -67,7 +69,7 @@ void ControlCharacter::apply()
        if (lv_.view()->available())
                view().apply();
 
-       ToggleAndShow(lv_.view(), *(font_.get()), toggleall_);
+       toggleAndShow(lv_.view(), *(font_.get()), toggleall_);
        lv_.view()->setState();
        lv_.buffer()->markDirty();
        setMinibuffer(&lv_, _("Character set"));
@@ -81,11 +83,13 @@ LyXFont::FONT_FAMILY ControlCharacter::getFamily() const
        return LyXFont::IGNORE_FAMILY;
 }
 
+
 void ControlCharacter::setFamily(LyXFont::FONT_FAMILY val)
 {
        font_->setFamily(val);
 }
 
+
 LyXFont::FONT_SERIES ControlCharacter::getSeries() const
 {
        if (font_.get())
@@ -93,11 +97,13 @@ LyXFont::FONT_SERIES ControlCharacter::getSeries() const
        return LyXFont::IGNORE_SERIES;
 }
 
+
 void ControlCharacter::setSeries(LyXFont::FONT_SERIES val)
 {
        font_->setSeries(val);
 }
 
+
 LyXFont::FONT_SHAPE ControlCharacter::getShape() const
 {
        if (font_.get())
@@ -105,11 +111,13 @@ LyXFont::FONT_SHAPE ControlCharacter::getShape() const
        return LyXFont::IGNORE_SHAPE;
 }
 
+
 void ControlCharacter::setShape(LyXFont::FONT_SHAPE val)
 {
        font_->setShape(val);
 }
 
+
 LyXFont::FONT_SIZE ControlCharacter::getSize() const
 {
        if (font_.get())
@@ -117,11 +125,13 @@ LyXFont::FONT_SIZE ControlCharacter::getSize() const
        return LyXFont::IGNORE_SIZE;
 }
 
+
 void ControlCharacter::setSize(LyXFont::FONT_SIZE val)
 {
        font_->setSize(val);
 }
 
+
 character::FONT_STATE ControlCharacter::getBar() const
 {
        if (font_.get()) {
@@ -133,13 +143,11 @@ character::FONT_STATE ControlCharacter::getBar() const
 
                else if (font_->noun() != LyXFont::IGNORE)
                        return character::NOUN_TOGGLE;
-
-               else if (font_->latex() != LyXFont::IGNORE)
-                       return character::LATEX_TOGGLE;
        }
        return character::IGNORE;
 }
 
+
 void ControlCharacter::setBar(character::FONT_STATE val)
 {
        switch (val) {
@@ -147,7 +155,6 @@ void ControlCharacter::setBar(character::FONT_STATE val)
                font_->setEmph(LyXFont::IGNORE);
                font_->setUnderbar(LyXFont::IGNORE);
                font_->setNoun(LyXFont::IGNORE);
-               font_->setLatex(LyXFont::IGNORE);
                break;
 
        case character::EMPH_TOGGLE:
@@ -162,19 +169,15 @@ void ControlCharacter::setBar(character::FONT_STATE val)
                font_->setNoun(LyXFont::TOGGLE);
                break;
 
-       case character::LATEX_TOGGLE:
-               font_->setLatex(LyXFont::TOGGLE);
-               break;
-
        case character::INHERIT:
                font_->setEmph(LyXFont::INHERIT);
                font_->setUnderbar(LyXFont::INHERIT);
                font_->setNoun(LyXFont::INHERIT);
-               font_->setLatex(LyXFont::INHERIT);
                break;
        }
 }
 
+
 LColor::color ControlCharacter::getColor() const
 {
        LColor::color col = LColor::ignore;
@@ -202,6 +205,7 @@ LColor::color ControlCharacter::getColor() const
        return col;
 }
 
+
 void ControlCharacter::setColor(LColor::color val)
 {
        switch (val) {
@@ -250,6 +254,7 @@ bool ControlCharacter::getToggleAll() const
        return toggleall_;
 }
 
+
 void ControlCharacter::setToggleAll(bool t)
 {
        toggleall_ = t;