*
* Copyright 1997 Asger Alstrup
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
#include "debug.h"
#include "LaTeXFeatures.h"
-InsetSpecialChar::InsetSpecialChar()
-{
-}
-
-
InsetSpecialChar::InsetSpecialChar(Kind k)
: kind(k)
-{
-}
-
-
-InsetSpecialChar::~InsetSpecialChar()
-{
-}
+{}
-int InsetSpecialChar::Ascent(LyXFont const&font) const
+int InsetSpecialChar::Ascent(LyXFont const & font) const
{
return font.maxAscent();
}
-int InsetSpecialChar::Descent(LyXFont const&font) const
+int InsetSpecialChar::Descent(LyXFont const & font) const
{
return font.maxDescent();
}
-int InsetSpecialChar::Width(LyXFont const&font) const
+int InsetSpecialChar::Width(LyXFont const & font) const
{
LyXFont f = font;
switch (kind) {
}
-void InsetSpecialChar::Draw(LyXFont font, LyXScreen &scr,
- int baseline, float &x)
+void InsetSpecialChar::Draw(LyXFont font, LyXScreen & scr,
+ int baseline, float & x)
{
switch (kind) {
case HYPHENATION:
// In lyxf3 this will be just LaTeX
-void InsetSpecialChar::Write(FILE *file)
+void InsetSpecialChar::Write(ostream & os)
{
string command;
switch (kind) {
case LDOTS: command = "\\ldots{}"; break;
case MENU_SEPARATOR: command = "\\menuseparator"; break;
}
- fprintf(file, "\\SpecialChar %s\n", command.c_str());
+ os << "\\SpecialChar " << command << "\n";
}
// This function will not be necessary when lyx3
-void InsetSpecialChar::Read(LyXLex &lex)
+void InsetSpecialChar::Read(LyXLex & lex)
{
lex.nextToken();
string command = lex.GetString();
- if (command=="\\-")
+ if (command == "\\-")
kind = HYPHENATION;
- else if (command=="\\@.")
+ else if (command == "\\@.")
kind = END_OF_SENTENCE;
- else if (command=="\\ldots{}")
+ else if (command == "\\ldots{}")
kind = LDOTS;
- else if (command=="\\menuseparator")
+ else if (command == "\\menuseparator")
kind = MENU_SEPARATOR;
else
lex.printError("InsetSpecialChar: Unknown kind: `$$Token'");
}
-int InsetSpecialChar::Latex(FILE *file, signed char /*fragile*/)
+int InsetSpecialChar::Latex(ostream & os, signed char /*fragile*/)
{
string command;
signed char dummy = 0;
Latex(command, dummy);
- fprintf(file, "%s", command.c_str());
+ os << command;
return 0;
}
-int InsetSpecialChar::Latex(string &file, signed char /*fragile*/)
+int InsetSpecialChar::Latex(string & file, signed char /*fragile*/)
{
switch (kind) {
case HYPHENATION: file += "\\-"; break;
}
-int InsetSpecialChar::Linuxdoc(string &file)
+int InsetSpecialChar::Linuxdoc(string & file)
{
switch (kind) {
case HYPHENATION: file += ""; break;
}
-int InsetSpecialChar::DocBook(string &file)
+int InsetSpecialChar::DocBook(string & file)
{
switch (kind) {
case HYPHENATION: file += ""; break;
}
-Inset* InsetSpecialChar::Clone()
+Inset * InsetSpecialChar::Clone() const
{
- InsetSpecialChar *result = new InsetSpecialChar(kind);
- return result;
+ return new InsetSpecialChar(kind);
}
-void InsetSpecialChar::Validate(LaTeXFeatures& features) const
+void InsetSpecialChar::Validate(LaTeXFeatures & features) const
{
if (kind == MENU_SEPARATOR) {
features.lyxarrow = true;