]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_cb.C
Fix natbib bug spotted by JMarc.
[lyx.git] / src / lyx_cb.C
index 3e41b36bfff59ed31c1f449a069fef4b04b0e495..56a059d7fffb2465a92cce0188f04fa0b7180f75 100644 (file)
 #include "support/systemcall.h"
 #include "support/lstrings.h"
 
+#include "BoostFormat.h"
+
 #include <fstream>
 #include <algorithm>
 #include <utility>
-#include <iostream>
 
 using std::vector;
 using std::ifstream;
@@ -116,7 +117,7 @@ bool WriteAs(BufferView * bv, Buffer * buffer, string const & filename)
 
                FileDialog::Result result =
                        fileDlg.save(OnlyPath(fname),
-                                      _("*.lyx|LyX Documents (*.lyx)"),
+                                      _("*.lyx| LyX Documents (*.lyx)"),
                                       OnlyFilename(fname));
 
                if (result.first == FileDialog::Later)
@@ -268,8 +269,11 @@ private:
 
 int AutoSaveBuffer::start()
 {
-       command_ = _("Auto-saving $$f");
-       command_ = subst(command_, "$$f", fname_);
+#if USE_BOOST_FORMAT
+       command_ = boost::io::str(boost::format(_("Auto-saving %1$s")) % fname_);
+#else
+       command_ = _("Auto-saving ") + fname_;
+#endif
        return runNonBlocking();
 }
 
@@ -317,7 +321,7 @@ int AutoSaveBuffer::generateChild()
        }
        return pid;
 }
+
 } // namespace anon
 
 
@@ -338,13 +342,13 @@ void AutoSave(BufferView * bv)
 
        // create autosave filename
        string fname = bv->buffer()->filePath();
-       fname += "#";
+       fname += '#';
        fname += OnlyFilename(bv->buffer()->fileName());
-       fname += "#";
+       fname += '#';
 
        AutoSaveBuffer autosave(*bv, fname);
        autosave.start();
-       
+
        bv->buffer()->markBakClean();
        bv->owner()->resetAutosaveTimer();
 }
@@ -440,7 +444,7 @@ string getContentsOfAsciiFile(BufferView * bv, string const & f, bool asParagrap
 
        ifstream ifs(fname.c_str());
        if (!ifs) {
-               Alert::err_alert(_("Error! Cannot open specified file: "),
+               Alert::err_alert(_("Error! Cannot open specified file:"),
                             MakeDisplayPath(fname, 50));
                return string();
        }
@@ -487,7 +491,7 @@ void MenuInsertLabel(BufferView * bv, string const & arg)
                if (layout->latexname() == "theorem")
                        text = "thm"; // Create a correct prefix for prettyref
 
-               text += ":";
+               text += ':';
                if (layout->latextype == LATEX_PARAGRAPH ||
                    lyxrc.label_init_length < 0)
                        text.erase();