mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 13:31:49 +00:00
fix broken strerrors
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6638 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
a3e85a5c27
commit
a6737cd9b9
@ -46,7 +46,6 @@
|
|||||||
#include "BoostFormat.h"
|
#include "BoostFormat.h"
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <cerrno>
|
|
||||||
|
|
||||||
extern BufferList bufferlist;
|
extern BufferList bufferlist;
|
||||||
|
|
||||||
@ -321,16 +320,14 @@ bool BufferView::insertLyXFile(string const & filen)
|
|||||||
|
|
||||||
ifstream ifs(fname.c_str());
|
ifstream ifs(fname.c_str());
|
||||||
if (!ifs) {
|
if (!ifs) {
|
||||||
string const error = strerror(errno);
|
|
||||||
string const file = MakeDisplayPath(fname, 50);
|
string const file = MakeDisplayPath(fname, 50);
|
||||||
#if USE_BOOST_FORMAT
|
#if USE_BOOST_FORMAT
|
||||||
boost::format fmt(_("Could not open the specified document\n%1$s\ndue to the error: %2$s"));
|
boost::format fmt(_("Could not open the specified document\n%1$s."));
|
||||||
fmt % file;
|
fmt % file;
|
||||||
fmt % error;
|
|
||||||
string text = fmt.str();
|
string text = fmt.str();
|
||||||
#else
|
#else
|
||||||
string text = _("Could not open the specified document\n");
|
string text = _("Could not open the specified document\n");
|
||||||
text += file + _(" due to the error: ");
|
text += file + ".";
|
||||||
text += error;
|
text += error;
|
||||||
#endif
|
#endif
|
||||||
Alert::error(_("Could not open file"), text);
|
Alert::error(_("Could not open file"), text);
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2003-03-29 John Levon <levon@movementarian.org>
|
||||||
|
|
||||||
|
* BufferView.C:
|
||||||
|
* buffer.C: fix broken strerrors according to Lars
|
||||||
|
|
||||||
2003-03-29 John Levon <levon@movementarian.org>
|
2003-03-29 John Levon <levon@movementarian.org>
|
||||||
|
|
||||||
* converters.C: more Alert cleanups
|
* converters.C: more Alert cleanups
|
||||||
|
14
src/buffer.C
14
src/buffer.C
@ -954,17 +954,14 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
|
|||||||
{
|
{
|
||||||
ofstream ofs(fname.c_str());
|
ofstream ofs(fname.c_str());
|
||||||
if (!ofs) {
|
if (!ofs) {
|
||||||
string const error = strerror(errno);
|
|
||||||
string const file = MakeDisplayPath(fname, 50);
|
string const file = MakeDisplayPath(fname, 50);
|
||||||
#if USE_BOOST_FORMAT
|
#if USE_BOOST_FORMAT
|
||||||
boost::format fmt(_("Could not save the document\n%1$s\ndue to the error: %2$s"));
|
boost::format fmt(_("Could not save the document\n%1$s."));
|
||||||
fmt % file;
|
fmt % file;
|
||||||
fmt % error;
|
|
||||||
string text = fmt.str();
|
string text = fmt.str();
|
||||||
#else
|
#else
|
||||||
string text = _("Could not save the document\n");
|
string text = _("Could not save the document\n");
|
||||||
text += file + _(" due to the error: ");
|
text += file + ".";
|
||||||
text += error;
|
|
||||||
#endif
|
#endif
|
||||||
Alert::error(_("Could not save document"), text);
|
Alert::error(_("Could not save document"), text);
|
||||||
return;
|
return;
|
||||||
@ -994,17 +991,14 @@ void Buffer::makeLaTeXFile(string const & fname,
|
|||||||
|
|
||||||
ofstream ofs(fname.c_str());
|
ofstream ofs(fname.c_str());
|
||||||
if (!ofs) {
|
if (!ofs) {
|
||||||
string const error = strerror(errno);
|
|
||||||
string const file = MakeDisplayPath(fname, 50);
|
string const file = MakeDisplayPath(fname, 50);
|
||||||
#if USE_BOOST_FORMAT
|
#if USE_BOOST_FORMAT
|
||||||
boost::format fmt(_("Could not open the specified document\n%1$s\ndue to the error: %2$s"));
|
boost::format fmt(_("Could not open the specified document\n%1$s."));
|
||||||
fmt % file;
|
fmt % file;
|
||||||
fmt % error;
|
|
||||||
string text = fmt.str();
|
string text = fmt.str();
|
||||||
#else
|
#else
|
||||||
string text = _("Could not open the specified document\n");
|
string text = _("Could not open the specified document\n");
|
||||||
text += file + _(" due to the error: ");
|
text += file + ".";
|
||||||
text += error;
|
|
||||||
#endif
|
#endif
|
||||||
Alert::error(_("Could not open file"), text);
|
Alert::error(_("Could not open file"), text);
|
||||||
return;
|
return;
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#include <cerrno>
|
||||||
|
|
||||||
using std::vector;
|
using std::vector;
|
||||||
using std::ifstream;
|
using std::ifstream;
|
||||||
|
Loading…
Reference in New Issue
Block a user