]> git.lyx.org Git - lyx.git/blobdiff - src/LyXRC.cpp
Fix scale parameter for fonts.
[lyx.git] / src / LyXRC.cpp
index 80b85141d25145e2a3eab443aae6030d480e19b1..2cc0369a631f633b3bc3e3148b2ccc05be5dd3a6 100644 (file)
@@ -40,6 +40,7 @@
 #include "support/lstrings.h"
 #include "support/os.h"
 #include "support/Package.h"
+#include "support/TempFile.h"
 #include "support/userinfo.h"
 
 #include <fstream>
@@ -407,7 +408,8 @@ bool LyXRC::read(FileName const & filename, bool check_format)
                return retval == ReadOK;
 
        LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
-       FileName const tempfile = FileName::tempName("convert_lyxrc");
+       TempFile tmp("convert_lyxrc");
+       FileName const tempfile = tmp.name();
        bool const success = prefs2prefs(filename, tempfile, false);
        if (!success) {
                LYXERR0 ("Unable to convert " << filename.absFileName() <<
@@ -422,7 +424,6 @@ bool LyXRC::read(FileName const & filename, bool check_format)
                LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
                retval = read(lexrc2, check_format);
        }
-       tempfile.removeFile();
        return retval == ReadOK;
 }
 
@@ -2829,8 +2830,9 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                        break;
        }
        case RC_DEFAULT_OTF_VIEW_FORMAT:
-               if (ignore_system_lyxrc ||
-                   default_otf_view_format != system_lyxrc.default_otf_view_format) {
+        if ((ignore_system_lyxrc ||
+            default_otf_view_format != system_lyxrc.default_otf_view_format)
+            && !default_otf_view_format.empty()) {
                        os << "\\default_otf_view_format " << default_otf_view_format << '\n';
                }
                if (tag != RC_LAST)