]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Try another way to signal a false positive to coverity
[lyx.git] / src / Buffer.cpp
index 7641741076553a6b9a3131f0bddf1acdeb12a44d..86da237eec9bb3736dfa9f573b0064a287b7884f 100644 (file)
@@ -423,7 +423,8 @@ Buffer::Impl::Impl(Buffer * owner, FileName const & file, bool readonly_,
          checksum_(0), wa_(0),  gui_(0), undo_(*owner), bibinfo_cache_valid_(false),
          bibfile_cache_valid_(false), cite_labels_valid_(false), preview_error_(false),
          inset(0), preview_loader_(0), cloned_buffer_(cloned_buffer),
-         clone_list_(0), doing_export(false), parent_buffer(0),
+         clone_list_(0), doing_export(false),
+         tracked_changes_present_(0), parent_buffer(0),
          word_count_(0), char_count_(0), blank_count_(0)
 {
        if (!cloned_buffer_) {
@@ -2533,7 +2534,8 @@ bool Buffer::getStatus(FuncRequest const & cmd, FuncStatus & flag)
                        enable = true;
                        break;
                }
-               string format = to_utf8(arg);
+               string format =
+                       arg.empty() ? params().getDefaultOutputFormat() : to_utf8(arg);
                size_t pos = format.find(' ');
                if (pos != string::npos)
                        format = format.substr(0, pos);
@@ -2641,11 +2643,13 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
                break;
 
        case LFUN_BUFFER_EXPORT: {
-               ExportStatus const status = doExport(argument, false);
+               string const format =
+                       argument.empty() ? params().getDefaultOutputFormat() : argument;
+               ExportStatus const status = doExport(format, false);
                dr.setError(status != ExportSuccess);
                if (status != ExportSuccess)
                        dr.setMessage(bformat(_("Error exporting to format: %1$s."),
-                                             func.argument()));
+                                             from_utf8(format)));
                break;
        }
 
@@ -4641,7 +4645,7 @@ Buffer::ReadStatus Buffer::loadThisLyXFile(FileName const & fn)
 void Buffer::bufferErrors(TeXErrors const & terr, ErrorList & errorList) const
 {
        for (auto const & err : terr) {
-               TexRow::TextEntry start, end = TexRow::text_none;
+               TexRow::TextEntry start = TexRow::text_none, end = TexRow::text_none;
                int errorRow = err.error_in_line;
                Buffer const * buf = 0;
                Impl const * p = d;