]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetlabel.C
Add support for compilers which do not have cname headers
[lyx.git] / src / insets / insetlabel.C
index 8e0e8c8f13dfa850742b5426ad1c88b32337118f..2ebb685295e86b4ca01490d5b20c2308b010f4aa 100644 (file)
@@ -3,10 +3,10 @@
  * 
  *           LyX, The Document Processor
  *      
- *         Copyright (C) 1995 Matthias Ettrich
- *          Copyright (C) 1995-1998 The LyX Team.
+ *         Copyright 1995 Matthias Ettrich
+ *          Copyright 1995-1999 The LyX Team.
  *
- *======================================================*/
+ * ======================================================*/
 
 #include <config.h>
 
 
 #include "insetlabel.h"
 
-//     $Id: insetlabel.C,v 1.1 1999/09/27 18:44:39 larsbj Exp $        
-
-#if !defined(lint) && !defined(WITH_WARNINGS)
-static char vcid[] = "$Id: insetlabel.C,v 1.1 1999/09/27 18:44:39 larsbj Exp $";
-#endif /* lint */
-
 /* Label. Used to insert a label automatically */
 
 
-InsetLabel::InsetLabel(LString const & cmd)
+InsetLabel::InsetLabel(string const & cmd)
 {
        scanCommand(cmd);
 }
@@ -49,7 +43,7 @@ int InsetLabel::GetNumberOfLabels() const
 }
 
 
-LString InsetLabel::getLabel(int) const
+string InsetLabel::getLabel(int) const
 {
        return contents;
 }
@@ -61,21 +55,21 @@ int InsetLabel::Latex(FILE *file, signed char /*fragile*/)
 }
 
 
-int InsetLabel::Latex(LString &file, signed char /*fragile*/)
+int InsetLabel::Latex(string &file, signed char /*fragile*/)
 {
        file += escape(getCommand());
        return 0;
 }
 
 
-int InsetLabel::Linuxdoc(LString &file)
+int InsetLabel::Linuxdoc(string &file)
 {
        file += "<label id=\"" + getContents() +"\" >";
        return 0;
 }
 
 
-int InsetLabel::DocBook(LString &file)
+int InsetLabel::DocBook(string &file)
 {
        file += "<anchor id=\"" + getContents() +"\" >";
        return 0;
@@ -84,11 +78,11 @@ int InsetLabel::DocBook(LString &file)
 
 // This function escapes 8-bit characters and other problematic characters
 // It's exactly the same code as in insetref.C.
-LString InsetLabel::escape(LString const & lab) const {
+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' };
-       LString enc;
-       for (int i=0; i<lab.length(); i++) {
+       string enc;
+       for (string::size_type i=0; i<lab.length(); i++) {
                unsigned char c=lab[i];
                if (c >= 128 || c=='=' || c=='%') {
                        enc += '=';