X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyX.cpp;h=7e56d550eefbc42f1ae6e2ce825c149d075d9b55;hb=94f0968e9212f24997cfee0d17c6f060210edbc6;hp=8652b4b032efaef46ba7cb2f8720b60f21db82f9;hpb=1af61e659ce256a1288b8bab68cfcd213cd97962;p=lyx.git diff --git a/src/LyX.cpp b/src/LyX.cpp index 8652b4b032..7e56d550ee 100644 --- a/src/LyX.cpp +++ b/src/LyX.cpp @@ -44,12 +44,11 @@ #include "Server.h" #include "ServerSocket.h" #include "Session.h" +#include "WordList.h" #include "frontends/alert.h" #include "frontends/Application.h" -#include "graphics/Previews.h" - #include "support/lassert.h" #include "support/debug.h" #include "support/environment.h" @@ -193,8 +192,6 @@ struct LyX::Impl /// the parsed command line batch command if any vector batch_commands; - /// - graphics::Previews preview_; /// SpellChecker * spell_checker_; /// @@ -221,6 +218,7 @@ LyX::~LyX() { delete pimpl_; singleton_ = 0; + WordList::cleanupWordLists(); } @@ -450,8 +448,7 @@ void LyX::prepareExit() // Kill the application object before exiting. This avoids crashes // when exiting on Linux. - if (pimpl_->application_) - pimpl_->application_.reset(); + pimpl_->application_.reset(); } @@ -1058,6 +1055,9 @@ int parse_help(string const &, string const &, string &) " Look on Tools->Preferences->File formats->Format\n" " to get an idea which parameters should be passed.\n" " Note that the order of -e and -x switches matters.\n" + "\t-E [--export-to] fmt filename\n" + " where fmt is the export format of choice (see --export),\n" + " and filename is the destination filename.\n" "\t-i [--import] fmt file.xxx\n" " where fmt is the import format of choice\n" " and file.xxx is the file to be imported.\n" @@ -1127,6 +1127,24 @@ int parse_execute(string const & arg, string const &, string & batch) } +int parse_export_to(string const & type, string const & output_file, string & batch) +{ + if (type.empty()) { + lyxerr << to_utf8(_("Missing file type [eg latex, ps...] after " + "--export-to switch")) << endl; + exit(1); + } + if (output_file.empty()) { + lyxerr << to_utf8(_("Missing destination filename after " + "--export-to switch")) << endl; + exit(1); + } + batch = "buffer-export " + type + " " + output_file; + use_gui = false; + return 2; +} + + int parse_export(string const & type, string const &, string & batch) { if (type.empty()) { @@ -1220,8 +1238,10 @@ void LyX::easyParse(int & argc, char * argv[]) cmdmap["-userdir"] = parse_userdir; cmdmap["-x"] = parse_execute; cmdmap["--execute"] = parse_execute; - cmdmap["-e"] = parse_export; + cmdmap["-e"] = parse_export; cmdmap["--export"] = parse_export; + cmdmap["-E"] = parse_export_to; + cmdmap["--export-to"] = parse_export_to; cmdmap["-i"] = parse_import; cmdmap["--import"] = parse_import; cmdmap["-geometry"] = parse_geometry; @@ -1380,13 +1400,6 @@ Messages const & getGuiMessages() } -graphics::Previews & thePreviews() -{ - LASSERT(singleton_, /**/); - return singleton_->pimpl_->preview_; -} - - Session & theSession() { LASSERT(singleton_, /**/);