]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetspecialchar.C
pos=string::npos for regex not found, use handcoded transform in lstring.C, fix the...
[lyx.git] / src / insets / insetspecialchar.C
index 111b55218a7d00ca3b96c6c010e041ccb60201e6..f1074c604f4b0d5276ae906f46f90adb8e28f296 100644 (file)
 #include "debug.h"
 #include "LaTeXFeatures.h"
 
-InsetSpecialChar::InsetSpecialChar()
-{
-}
-
-
 InsetSpecialChar::InsetSpecialChar(Kind k)
        : kind(k)
-{
-}
-
-
-InsetSpecialChar::~InsetSpecialChar()
-{
-}
+{}
 
 
 int InsetSpecialChar::Ascent(LyXFont const & font) const
@@ -117,7 +106,7 @@ void InsetSpecialChar::Draw(LyXFont font, LyXScreen & scr,
 
 
 // In lyxf3 this will be just LaTeX
-void InsetSpecialChar::Write(FILE * file)
+void InsetSpecialChar::Write(ostream & os)
 {
        string command;
        switch (kind) {
@@ -126,7 +115,7 @@ void InsetSpecialChar::Write(FILE * file)
        case LDOTS:             command = "\\ldots{}";  break;
        case MENU_SEPARATOR:    command = "\\menuseparator"; break;
        }
-       fprintf(file, "\\SpecialChar %s\n", command.c_str());
+       os << "\\SpecialChar " << command << "\n";
 }
 
 
@@ -149,12 +138,12 @@ void InsetSpecialChar::Read(LyXLex & lex)
 }
 
 
-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;
 }
 
@@ -195,10 +184,9 @@ int InsetSpecialChar::DocBook(string & file)
 }
 
 
-Inset * InsetSpecialChar::Clone()
+Inset * InsetSpecialChar::Clone() const
 {
-       InsetSpecialChar * result = new InsetSpecialChar(kind);
-       return result;
+       return new InsetSpecialChar(kind);
 }