]> git.lyx.org Git - features.git/commitdiff
subst fixes
authorLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 26 Oct 1999 23:33:30 +0000 (23:33 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 26 Oct 1999 23:33:30 +0000 (23:33 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@255 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/LyXSendto.C
src/buffer.C
src/insets/insetbib.C
src/insets/insetinclude.C
src/layout.C
src/lyx_cb.C
src/lyx_main.C
src/lyx_sendfax_main.C
src/support/filetools.C

index 91325f217b6a933abd08dd07fb72b8ccdbf4df6a..25e038603b7f2c410e43b2e183ca68ea185fe32a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,36 @@
+1999-10-27  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * src/support/filetools.C (CleanupPath): subst fix
+
+       * src/insets/insetbib.C (delDatabase): subst fix, this looks
+       _really_ weird.
+
+       * src/support/filetools.C (PutEnvPath): subst fix, how come nobody
+       complained about this one?
+
+       * src/insets/insetinclude.C (Latex): subst fix
+
+       * src/insets/insetbib.C (getKeys): subst fix
+
+       * src/LyXSendto.C (SendtoApplyCB): subst fix
+
+       * src/lyx_main.C (init): subst fix
+
+       * src/layout.C (Read): subst fix
+
+       * src/lyx_sendfax_main.C (button_send): subst fix
+
+       * src/buffer.C (RoffAsciiTable): subst fix
+
+       * src/lyx_cb.C (MenuFax): subst fix
+       (PrintApplyCB): subst fix
+
+1999-10-26  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * development/lyx.spec.in (%build): add CFLAGS also.
+
+       * src/screen.C (drawFrame): removed another warning.
+
 1999-10-25  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * renamed WHATSNEW to NEWS (usual GNU style), CHANGES to
@@ -9,12 +42,6 @@
        unbreakable if we are in freespacing mode (LyX-Code), but not in
        latex mode.
 
-1999-10-26  Lars Gullik Bjønnes  <larsbj@lyx.org>
-
-       * development/lyx.spec.in (%build): add CFLAGS also.
-
-       * src/screen.C (drawFrame): removed another warning.
-
 1999-10-25  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
        * src/BackStack.h: fixed initialization order in constructor
index 2c95a3089b9a8782e0995ed59699723d46bc9042..34285484e6f21e319e564d5f9cc6ded8a53dec61 100644 (file)
@@ -82,7 +82,7 @@ void SendtoApplyCB(FL_OBJECT *, long)
                                              ftypeext, true));
     if (!contains(command, "$$FName"))
         command = "( " + command + " ) <$$FName";
-    subst(command, "$$FName",fname);
+    command = subst(command, "$$FName",fname);
     command += " &"; // execute in background
     // push directorypath, if necessary 
     string path = OnlyPath(buffer->getFileName());
index 93894891c28da33675120bfc7516d8cd33cbb75d..d7cd5a4c0699d7da544b107b708477667ef0bd0e 100644 (file)
@@ -3539,7 +3539,7 @@ void Buffer::RoffAsciiTable(FILE *file, LyXParagraph *par)
        par->table->RoffEndOfCell(fp, cell);
        fclose(fp);
        string cmd = lyxrc->ascii_roff_command + " >" + fname2;
-       subst(cmd, "$$FName",fname1);
+       cmd = subst(cmd, "$$FName", fname1);
        Systemcalls one(Systemcalls::System, cmd);
        if (!(lyxerr.debugging(Debug::ROFF))) {
                remove(fname1.c_str());
index 7b2838171257b04583001e462df41a9d3c346e7d..c95b013648121653b8d79034211f8d184d860d30 100644 (file)
@@ -408,8 +408,10 @@ string InsetBibtex::getKeys()
                                // At end of each line check if line begins with '@'
                                if ( c == '\n') {
                                        if (prefixIs(linebuf, "@") ) {
-                                               subst(linebuf, '{','(');
-                                               linebuf=split(linebuf, tmp,'(');
+                                               linebuf = subst(linebuf,
+                                                               '{', '(');
+                                               linebuf = split(linebuf,
+                                                               tmp, '(');
                                                tmp = lowercase(tmp);
                                                if (!prefixIs(tmp, "@string") && !prefixIs(tmp, "@preamble") ) {
                                                        linebuf = split(linebuf, tmp,',');
@@ -470,9 +472,10 @@ bool InsetBibtex::delDatabase(string const &db)
                string bd = db;
                int n = tokenPos(contents, ',', bd);
                if (n > 0) {
+                       // Weird code, would someone care to explain this?(Lgb)
                        string tmp(",");
                        tmp += bd;
-                       subst(contents, tmp.c_str(), ",");
+                       contents = subst(contents, tmp.c_str(), ",");
                } else if (n==0)
                        contents = split(contents, bd, ',');
                else 
index 554ae2a3cb8a9e04c2ca0229f3f78d320656b66f..283eb0a1f14a3fe939c53aa1f4932ca7ac5598f7 100644 (file)
@@ -352,9 +352,9 @@ int InsetInclude::Latex(string &file, signed char /*fragile*/)
                writefile = ChangeExtension(getFileName(), ".tex", false);
                if (!master->tmppath.empty()
                    && !master->niceFile) {
-                       subst(incfile, '/','@');
+                       incfile = subst(incfile, '/','@');
                        #ifdef __EMX__
-                       subst(incfile, ':', '$');
+                       incfile = subst(incfile, ':', '$');
                        #endif
                        writefile = AddName(master->tmppath, incfile);
                } else
index 9de9933f24940f206a537cf9011e0e6280e3341d..7c73af5362cba619e95bd507049e079cc1cb375b 100644 (file)
@@ -523,8 +523,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXLayoutList * list)
 
                case LT_LABELSEP:       /* label separator */
                        if (lexrc.next()) {
-                               labelsep = lexrc.GetString();
-                               subst(labelsep, 'x', ' ');
+                               labelsep = subst(lexrc.GetString(), 'x', ' ');
                        }
                        break;
 
@@ -882,10 +881,9 @@ int LyXTextClass::Read (string const &filename, LyXLayoutList *list)
 
                case LT_STYLE:
                        if (lexrc.next()) {
-                               string name = lexrc.GetString();
                                bool is_new = false;
 
-                               subst(name, '_',' ');
+                               string name = subst(lexrc.GetString(), '_', ' ');
                                tmpl = l->GetLayout(name);
                                if (!tmpl) {
                                        is_new = true;
index 5a6679495ed32a04fb02cca4949c588f70e70176..fdb155bbd55e1a8d9d83b85992a9e7539780282f 100644 (file)
@@ -757,8 +757,7 @@ void MenuFax(Buffer *buffer)
        }
        Path p(path);
        if (!lyxrc->fax_program.empty()) {
-               string help2 = lyxrc->fax_program;
-                subst(help2, "$$FName",ps);
+                string help2 = subst(lyxrc->fax_program, "$$FName", ps);
                 help2 += " &";
                 Systemcalls one(Systemcalls::System, help2);
        } else
@@ -3286,11 +3285,9 @@ extern "C" void PrintApplyCB(FL_OBJECT *, long)
 // Changes by Stephan Witt (stephan.witt@beusen.de), 19-Jan-99
 // User may give a page (range) list
 // User may print multiple (unsorted) copies
-       string pages = fl_get_input(fd_form_print->input_pages);
-       subst(pages, ';',',');
-       subst(pages, '+',',');
-       pages = strip (pages) ;
-       pages = frontStrip (pages) ;
+       string pages = subst(fl_get_input(fd_form_print->input_pages), ';',',');
+       pages = subst(pages, '+',',');
+       pages = frontStrip(strip(pages)) ;
        while (!pages.empty()) { // a page range was given
                string piece ;
                pages = split (pages, piece, ',') ;
index 68402565ecb0673986fce1ecd9130a8fadb6c27b..53113e06d84c22302ca54f56d307c58f29c65656 100644 (file)
@@ -158,8 +158,8 @@ void LyX::init(int */*argc*/, char **argv)
        // Determine path of binary
        //
 
-       string fullbinpath, binpath = argv[0];
-       subst(binpath, '\\', '/');
+       string fullbinpath;
+       string binpath = subst(argv[0], '\\', '/');
        string binname = OnlyFilename(argv[0]);
        // Sorry for system specific code. (SMiyata)
        if (suffixIs(binname, ".exe")) binname.erase(binname.length()-4, string::npos);
index 1939dfd6523a745712814d47ad6059bb95a9dfef..e497427032fe3d24619d8048ee1c0497b38cd5e8 100644 (file)
@@ -115,12 +115,12 @@ bool button_send(string const &fname, string const &sendcmd)
     cmd = sendcmd + " >";
     cmd += logfile + " 2>";
     cmd += logfile;
-    subst(cmd, "$$Host",host);
-    subst(cmd, "$$Comment",comment);
-    subst(cmd, "$$Enterprise",enterprise);
-    subst(cmd, "$$Name",name);
-    subst(cmd, "$$Phone",phone);
-    subst(cmd, "$$FName",fname);
+    cmd = subst(cmd, "$$Host", host);
+    cmd = subst(cmd, "$$Comment", comment);
+    cmd = subst(cmd, "$$Enterprise", enterprise);
+    cmd = subst(cmd, "$$Name", name);
+    cmd = subst(cmd, "$$Phone", phone);
+    cmd = subst(cmd, "$$FName", fname);
     lyxerr << "CMD: " << cmd << endl;
     Systemcalls one(Systemcalls::System, cmd);
     show_logfile(logfile,false);
index 460020c88876195e4e1334bfb6a917d40a5b4324..0057188406bd5f685680854753d0d763393d71ca 100644 (file)
@@ -79,7 +79,7 @@ string SpaceLess(string const & file)
        string temp = AddName(path, name);
        // Replace spaces with underscores, also in directory
        // No!!! I checked it that it is not necessary.
-       // temp.subst(' ','_');
+       // temp = subst(temp, ' ', '_');
 
        return temp;
 }
@@ -331,8 +331,8 @@ bool PutEnvPath(string const & envstr)
         string pathlist = envstr;
 #warning Verify that this is correct.
 #ifdef __EMX__
-        pathlist.subst(':', ';');
-        pathlist.subst('/', '\\');
+        pathlist = subst(pathlist, ':', ';');
+        pathlist = subst(pathlist, '/', '\\');
 #endif
         return PutEnv(pathlist);
 }
@@ -690,9 +690,8 @@ string NormalizePath(string const & path)
 string CleanupPath(string const & path) 
 {
 #ifdef __EMX__   /* SMiyata: This should fix searchpath bug. */
-       string temppath(path);
-       subst(tmppath, '\\', '/');
-       subst(tmppath, "//", "/");
+       string temppath = subst(path, '\\', '/');
+       temppath = subst(temppath, "//", "/");
        return lowercase(temppath);
 #else // On unix, nothing to do
        return path;