]> git.lyx.org Git - features.git/commitdiff
Implement '*' in "buffer-export <FORMAT> <DEST>"
authorScott Kostyshak <skostysh@lyx.org>
Tue, 7 Mar 2017 08:09:42 +0000 (03:09 -0500)
committerScott Kostyshak <skostysh@lyx.org>
Wed, 8 Mar 2017 05:36:28 +0000 (00:36 -0500)
For the variant of buffer-export that allows a format and a
filename, the substitution must be done after the argument is split.

Related to 494ce664.

src/Buffer.cpp

index 60dcc51ce309d7b7c37e6284c6d412886a8107b8..d01336ee9beceef93cddcbd1470567c1970fbdf0 100644 (file)
@@ -4231,6 +4231,8 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir
        if (pos != string::npos) {
                dest_filename = target.substr(pos + 1, target.length() - pos - 1);
                format = target.substr(0, pos);
+               if (format == "*")
+                       format = params().getDefaultOutputFormat();
                runparams.export_folder = FileName(dest_filename).onlyPath().realPath();
                FileName(dest_filename).onlyPath().createPath();
                LYXERR(Debug::FILES, "format=" << format << ", dest_filename=" << dest_filename << ", export_folder=" << runparams.export_folder);