+ ReturnValues retval = read(lexrc, check_format);
+ if (!check_format || retval != FormatMismatch)
+ return retval == ReadOK;
+
+ LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
+ FileName const tempfile = FileName::tempName("convert_lyxrc");
+ bool const success = prefs2prefs(filename, tempfile, false);
+ if (!success) {
+ LYXERR0 ("Unable to convert " << filename.absFileName() <<
+ " to format " << LYXRC_FILEFORMAT);
+ return false;
+ }
+ Lexer lexrc2(lyxrcTags);
+ lexrc2.setFile(tempfile);
+ LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
+ retval = read(lexrc2, check_format);
+ tempfile.removeFile();
+ return retval == ReadOK;