diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 8475f9eb13..dd2fbaba55 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,8 @@ +2003-12-28 Angus Leeming + + * xforms_helpers.C (read, write): output a diagnostic message if + we fail to open preferences.xform for read/write. + 2003-12-15 Angus Leeming * Color.h (NamedColor): store both the LyX and the GUI name. diff --git a/src/frontends/xforms/xforms_helpers.C b/src/frontends/xforms/xforms_helpers.C index 597e9938d2..d8e49c4cea 100644 --- a/src/frontends/xforms/xforms_helpers.C +++ b/src/frontends/xforms/xforms_helpers.C @@ -12,6 +12,7 @@ #include "xforms_helpers.h" +#include "debug.h" #include "gettext.h" #include "lyxgluelength.h" #include "lyxlex.h" @@ -319,9 +320,13 @@ const int xformCount = sizeof(xformTags) / sizeof(keyword_item); bool XformsColor::read(string const & filename) { + FileInfo const f(filename); LyXLex lexrc(xformTags, xformCount); - if (!lexrc.setFile(filename)) - return false; + if (f.readable() && !lexrc.setFile(filename)) { + lyxerr << "XformsColor::read(" << filename << ")\n" + << _("Failed to open file.") << std::endl; + return false; + } while (lexrc.isOK()) { int const le = lexrc.lex(); @@ -362,8 +367,11 @@ bool XformsColor::read(string const & filename) bool XformsColor::write(string const & filename) { ofstream os(filename.c_str()); - if (!os) - return false; + if (!os) { + lyxerr << "XformsColor::write(" << filename << ")\n" + << _("Failed to open file.") << std::endl; + return false; + } os << "###" << "### file " << filename << "\n\n"