-/* 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"
return kind_;
}
+
int InsetSpecialChar::ascent(BufferView *, LyXFont const & font) const
{
return font_metrics::maxAscent(font);
case HYPHENATION:
{
int w = font_metrics::width('-', font);
- if (w > 5)
+ if (w > 5)
w -= 2; // to make it look shorter
return w;
}
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);
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;
}
command = "\\menuseparator";
break;
case PROTECTED_SEPARATOR:
- //command = "\\protected_separator";
command = "~";
break;
}
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'");
os << "\\lyxarrow{}";
break;
case PROTECTED_SEPARATOR:
- os << (free_space ? " " : "~");
+ os << (free_space ? ' ' : '~');
break;
}
return 0;
case LIGATURE_BREAK:
break;
case END_OF_SENTENCE:
- os << ".";
+ os << '.';
break;
case LDOTS:
os << "...";
os << "->";
break;
case PROTECTED_SEPARATOR:
- os << " ";
+ os << ' ';
break;
}
return 0;
case LIGATURE_BREAK:
break;
case END_OF_SENTENCE:
- os << ".";
+ os << '.';
break;
case LDOTS:
os << "...";
}
-int InsetSpecialChar::docbook(Buffer const *, ostream & os) const
+int InsetSpecialChar::docbook(Buffer const *, ostream & os, bool) const
{
switch (kind_) {
case HYPHENATION:
case LIGATURE_BREAK:
break;
case END_OF_SENTENCE:
- os << ".";
+ os << '.';
break;
case LDOTS:
os << "...";