]> git.lyx.org Git - features.git/commitdiff
Fix a bunch of assertions.
authorVincent van Ravesteijn <vfr@lyx.org>
Sat, 15 Aug 2009 20:47:46 +0000 (20:47 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sat, 15 Aug 2009 20:47:46 +0000 (20:47 +0000)
The first thing that bformat does is to check whether the string contains "%1$s". Otherwise it asserts.

Why didn't we see this happen before ? This was revealed by the emergency saves that Richard introduced in the Buffer dtor.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31062 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
src/frontends/qt4/qt_helpers.cpp

index 3981d8d5acc2f28024c3b040b958745c6dc3f974..26e816b73d5e139bd75edae520e54656e1e7c94c 100644 (file)
@@ -967,7 +967,7 @@ docstring Buffer::emergencyWrite()
                LYXERR0("  " << s);
                if (writeFile(FileName(s))) {
                        markClean();
-                       user_message += bformat(_("  Saved to %1$. Phew.\n"), from_utf8(s));
+                       user_message += bformat(_("  Saved to %1$s. Phew.\n"), from_utf8(s));
                        return user_message;
                } else {
                        user_message += _("  Save failed! Trying again...\n");
@@ -980,7 +980,7 @@ docstring Buffer::emergencyWrite()
        lyxerr << ' ' << s << endl;
        if (writeFile(FileName(s))) {
                markClean();
-               user_message += bformat(_("  Saved to %1$. Phew.\n"), from_utf8(s));
+               user_message += bformat(_("  Saved to %1$s. Phew.\n"), from_utf8(s));
                return user_message;
        }
 
@@ -994,7 +994,7 @@ docstring Buffer::emergencyWrite()
        lyxerr << ' ' << s << endl;
        if (writeFile(FileName(s))) {
                markClean();
-               user_message += bformat(_("  Saved to %1$. Phew.\n"), from_utf8(s));
+               user_message += bformat(_("  Saved to %1$s. Phew.\n"), from_utf8(s));
                return user_message;
        }
 
index 6c011440085ef22175f51841f2b121aa3763f801..92a052048747837b018e33543298cf6052cf0550 100644 (file)
@@ -213,7 +213,7 @@ void rescanTexStyles()
                return;
        // FIXME UNICODE
        frontend::Alert::error(_("Could not update TeX information"),
-               bformat(_("The script `%s' failed."), from_utf8(command.absFilename())));
+               bformat(_("The script `%1$s' failed."), from_utf8(command.absFilename())));
 }