]> git.lyx.org Git - features.git/blobdiff - src/Buffer.cpp
#10285 and #10542 - Add sips as a fallback converter for Mac to provide preview of...
[features.git] / src / Buffer.cpp
index 3d0f7800631082cca22f528e4d023865fa22e5b7..239bacd06425061861b2a7634be2c0554ec7bd0c 100644 (file)
@@ -729,7 +729,7 @@ BufferParams const & Buffer::masterParams() const
 double Buffer::fontScalingFactor() const
 {
        return isExporting() ? 75.0 * params().html_math_img_scale
-               : 0.01 * lyxrc.dpi * lyxrc.zoom * lyxrc.preview_scale_factor * params().display_pixel_ratio;
+               : 0.01 * lyxrc.dpi * lyxrc.currentZoom * lyxrc.preview_scale_factor * params().display_pixel_ratio;
 }
 
 
@@ -1179,22 +1179,14 @@ Buffer::ReadStatus Buffer::readFile(FileName const & fn)
        if (file_format != LYX_FORMAT) {
                FileName tmpFile;
                ReadStatus ret_clf = convertLyXFormat(fn, tmpFile, file_format);
+               if (ret_clf != ReadSuccess)
+                       return ret_clf;
+               ret_clf = readFile(tmpFile);
                if (ret_clf == ReadSuccess) {
-                       ret_clf = readFile(tmpFile);
-                       if (ret_clf == ReadSuccess) {
-                               d->file_format = file_format;
-                               d->need_format_backup = true;
-                               return ret_clf;
-                       }
-               }
-               if (ret_clf != ReadSuccess) {
-                       int const ret = Alert::prompt(_("Document format failure"),
-                               _("Fileformat unrecognized by lyx2lyx. Trying to load anyway, "
-                                 "but some contents might be lost and LyX might crash!\n"
-                                 "Would you like to proceed ?"), 0, 1, _("&No"), _("&Yes"));
-                       if (ret == 0)
-                               return ret_clf;
+                       d->file_format = file_format;
+                       d->need_format_backup = true;
                }
+               return ret_clf;
        }
 
        // FIXME: InsetInfo needs to know whether the file is under VCS
@@ -3957,6 +3949,7 @@ unique_ptr<TexRow> Buffer::getSourceCode(odocstream & os, string const & format,
                        ots.texrow().newlines(2);
                        if (master)
                                runparams.is_child = true;
+                       updateBuffer();
                        writeLaTeXSource(ots, string(), runparams, output);
                        texrow = ots.releaseTexRow();
                }
@@ -5330,8 +5323,10 @@ void Buffer::updateChangesPresent() const
 
 void Buffer::Impl::refreshFileMonitor()
 {
-       if (file_monitor_ && file_monitor_->filename() == filename.absFileName())
-               return file_monitor_->refresh();
+       if (file_monitor_ && file_monitor_->filename() == filename.absFileName()) {
+               file_monitor_->refresh();
+               return;
+       }
 
        // The previous file monitor is invalid
        // This also destroys the previous file monitor and all its connections