]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetlabel.C
pos=string::npos for regex not found, use handcoded transform in lstring.C, fix the...
[lyx.git] / src / insets / insetlabel.C
index 6ef9e342a8b22222210db400d1023adba3ea1e5a..b669e72b24318cb303be0bed3cb22627675a5a51 100644 (file)
@@ -6,7 +6,7 @@
  *         Copyright 1995 Matthias Ettrich
  *          Copyright 1995-1999 The LyX Team.
  *
- * ======================================================*/
+ * ====================================================== */
 
 #include <config.h>
 
@@ -25,15 +25,9 @@ InsetLabel::InsetLabel(string const & cmd)
 }
 
 
-InsetLabel::~InsetLabel()
+Inset * InsetLabel::Clone() const
 {
-}
-
-
-Inset * InsetLabel::Clone()
-{
-       InsetLabel * result = new InsetLabel(getCommand());
-       return result;
+       return new InsetLabel(getCommand());
 }
 
 
@@ -48,9 +42,10 @@ string InsetLabel::getLabel(int) const
        return contents;
 }
 
-int InsetLabel::Latex(FILE * file, signed char /*fragile*/)
+
+int InsetLabel::Latex(ostream & os, signed char /*fragile*/)
 {
-       fprintf(file, "%s", escape(getCommand()).c_str());
+       os << escape(getCommand());
        return 0;
 }
 
@@ -82,7 +77,7 @@ string InsetLabel::escape(string const & lab) const {
        char hexdigit[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
                              '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
        string enc;
-       for (string::size_type i=0; i < lab.length(); ++i) {
+       for (string::size_type i= 0; i < lab.length(); ++i) {
                unsigned char c = lab[i];
                if (c >= 128 || c == '=' || c == '%') {
                        enc += '=';