]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetspecialchar.C
fix #832
[lyx.git] / src / insets / insetspecialchar.C
index 7dcbc23afce438745a765e2f59f92dfa57f579b6..23a30b53d4f0ec0f17a0b37b416884cb2ce0c172 100644 (file)
@@ -1,17 +1,17 @@
-/* This file is part of
- * ======================================================
+/**
+ * \file insetspecialchar.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
+ * \author Asger Alstrup Nielsen
+ * \author Jean-Marc Lasgouttes
+ * \author Lars Gullik Bjønnes
  *
- *         Copyright 1997 Asger Alstrup
- *
- * ====================================================== */
+ * Full author contact details are available in file CREDITS
+ */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "insetspecialchar.h"
 #include "debug.h"
@@ -35,6 +35,7 @@ InsetSpecialChar::Kind InsetSpecialChar::kind() const
        return kind_;
 }
 
+
 int InsetSpecialChar::ascent(BufferView *, LyXFont const & font) const
 {
        return font_metrics::maxAscent(font);
@@ -84,7 +85,7 @@ int InsetSpecialChar::width(BufferView *, LyXFont const & font) const
 
 
 void InsetSpecialChar::draw(BufferView * bv, LyXFont const & f,
-                           int baseline, float & x, bool) const
+                           int baseline, float & x) const
 {
        Painter & pain = bv->painter();
        LyXFont font(f);
@@ -93,21 +94,21 @@ void InsetSpecialChar::draw(BufferView * bv, LyXFont const & f,
        case HYPHENATION:
        {
                font.setColor(LColor::special);
-               pain.text(int(x), baseline, "-", font);
+               pain.text(int(x), baseline, '-', font);
                x += width(bv, font);
                break;
        }
        case LIGATURE_BREAK:
        {
                font.setColor(LColor::special);
-               pain.text(int(x), baseline, "|", font);
+               pain.text(int(x), baseline, '|', font);
                x += width(bv, font);
                break;
        }
        case END_OF_SENTENCE:
        {
                font.setColor(LColor::special);
-               pain.text(int(x), baseline, ".", font);
+               pain.text(int(x), baseline, '.', font);
                x += width(bv, font);
                break;
        }
@@ -182,7 +183,6 @@ void InsetSpecialChar::write(Buffer const *, ostream & os) const
                command = "\\menuseparator";
                break;
        case PROTECTED_SEPARATOR:
-               //command = "\\protected_separator";
                command = "~";
                break;
        }
@@ -206,8 +206,7 @@ void InsetSpecialChar::read(Buffer const *, LyXLex & lex)
                kind_ = LDOTS;
        else if (command == "\\menuseparator")
                kind_ = MENU_SEPARATOR;
-       else if (command == "\\protected_separator"
-                || command == "~")
+       else if (command == "~")
                kind_ = PROTECTED_SEPARATOR;
        else
                lex.printError("InsetSpecialChar: Unknown kind: `$$Token'");
@@ -234,7 +233,7 @@ int InsetSpecialChar::latex(Buffer const *, ostream & os, bool /*fragile*/,
                os << "\\lyxarrow{}";
                break;
        case PROTECTED_SEPARATOR:
-               os << (free_space ? " " : "~");
+               os << (free_space ? ' ' : '~');
                break;
        }
        return 0;
@@ -248,7 +247,7 @@ int InsetSpecialChar::ascii(Buffer const *, ostream & os, int) const
        case LIGATURE_BREAK:
                break;
        case END_OF_SENTENCE:
-               os << ".";
+               os << '.';
                break;
        case LDOTS:
                os << "...";
@@ -257,7 +256,7 @@ int InsetSpecialChar::ascii(Buffer const *, ostream & os, int) const
                os << "->";
                break;
        case PROTECTED_SEPARATOR:
-               os << " ";
+               os << ' ';
                break;
        }
        return 0;
@@ -271,7 +270,7 @@ int InsetSpecialChar::linuxdoc(Buffer const *, ostream & os) const
        case LIGATURE_BREAK:
                break;
        case END_OF_SENTENCE:
-               os << ".";
+               os << '.';
                break;
        case LDOTS:
                os << "...";
@@ -294,7 +293,7 @@ int InsetSpecialChar::docbook(Buffer const *, ostream & os, bool) const
        case LIGATURE_BREAK:
                break;
        case END_OF_SENTENCE:
-               os << ".";
+               os << '.';
                break;
        case LDOTS:
                os << "...";