From 3b8b29831f3b2f38bca5f30cf918e128e33d354a Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Thu, 7 Mar 2002 15:45:52 +0000 Subject: [PATCH] remove redundant declarations of WorkAreai and other small things. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3692 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 8 ++++ src/ColorHandler.h | 1 - src/LyXSendto.C | 113 --------------------------------------------- src/LyXView.C | 5 -- src/lyx_gui.C | 4 -- src/lyxfunc.C | 4 +- 6 files changed, 9 insertions(+), 126 deletions(-) delete mode 100644 src/LyXSendto.C diff --git a/src/ChangeLog b/src/ChangeLog index 83dafbe1fc..321ef7ff1e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2002-03-07 Angus Leeming + + * LyXSendto.C: remove. + * LyXView.C (c-tor): clean-up Jürgen's #if 0 correctly. + * lyx_gui.C: remove now-redundant comment. + * ColorHandler.h: remove forward declaration of class WorkArea. + * lyxfunc.C: remove #include "WorkArea.h". + 2002-03-07 Juergen Vigna * undo_funcs.C (textHandleUndo): fix problems when the paragraph diff --git a/src/ColorHandler.h b/src/ColorHandler.h index b5864e0f6e..6a74288f4f 100644 --- a/src/ColorHandler.h +++ b/src/ColorHandler.h @@ -23,7 +23,6 @@ #include "PainterBase.h" class LyXFont; -class WorkArea; /** * This is a factory class that can produce GCs with a specific diff --git a/src/LyXSendto.C b/src/LyXSendto.C deleted file mode 100644 index 5b3d12188f..0000000000 --- a/src/LyXSendto.C +++ /dev/null @@ -1,113 +0,0 @@ -#include - -#include FORMS_H_LOCATION -#include "print_form.h" -#include "lyx_main.h" -#include "lyxrc.h" -#include "LString.h" -#include "buffer.h" -#include "gettext.h" -#include "bufferview_funcs.h" -#include "exporter.h" -#include "BufferView.h" - -#include "support/filetools.h" -#include "support/lstrings.h" -#include "support/path.h" -#include "support/systemcall.h" - -extern FD_form_sendto * fd_form_sendto; -extern BufferView * current_view; -extern int MakeLaTeXOutput(Buffer * buffer); -extern bool CreatePostscript(Buffer * buffer, bool wait); - -// Whereas this feature is under the menu item File->Export->Custom, -// I kept the old name sendto in the code because I am lazy (JMarc) - -void MenuSendto() -{ - static int ow = -1; - static int oh; - - // do this only if the command is empty - if (!fl_get_input(fd_form_sendto->input_cmd) && - !lyxrc.custom_export_command.empty()) - fl_set_input(fd_form_sendto->input_cmd, - lyxrc.custom_export_command.c_str()); - if (fd_form_sendto->form_sendto->visible) { - fl_raise_form(fd_form_sendto->form_sendto); - } else { - fl_show_form(fd_form_sendto->form_sendto, - FL_PLACE_MOUSE | FL_FREE_SIZE, FL_TRANSIENT, - _("Send Document to Command")); - if (ow < 0) { - ow = fd_form_sendto->form_sendto->w; - oh = fd_form_sendto->form_sendto->h; - } - fl_set_form_minsize(fd_form_sendto->form_sendto, ow, oh); - } -} - - -void SendtoApplyCB(FL_OBJECT *, long) -{ - if (!current_view->available()) - return; - - string command = fl_get_input(fd_form_sendto->input_cmd); - if (command.empty()) - return; - Buffer * buffer = current_view->buffer(); - string ftypeext; - if (fl_get_button(fd_form_sendto->radio_ftype_lyx)) - ftypeext = ".lyx"; - else if (fl_get_button(fd_form_sendto->radio_ftype_latex)) - ftypeext = ".tex"; - else if (fl_get_button(fd_form_sendto->radio_ftype_dvi)) - ftypeext = ".dvi"; - else if (fl_get_button(fd_form_sendto->radio_ftype_ascii)) - ftypeext = ".txt"; - else { - ftypeext = ".ps"; - if (!Exporter::Export(buffer, "ps", true)) - return; - } - - string const fname = OnlyFilename(ChangeExtension(buffer->getLatexName(), - ftypeext)); - if (!contains(command, "$$FName")) - command = "( " + command + " ) <$$FName"; - command = subst(command, "$$FName", fname); - command += " &"; // execute in background - // push directorypath, if necessary - string path = buffer->filePath(); - if (lyxrc.use_tempdir || !IsDirWriteable(path)) { - path = buffer->tmppath; - } - Path p(path); - // save the .lyx file in tmp_dir if this filetype is requested - if (fl_get_button(fd_form_sendto->radio_ftype_lyx)) - buffer->writeFile(fname, true); - // if the .tex file is requested save it to the tempdir - // as now we don't do the MakeLaTeXOutput anymore - if (fl_get_button(fd_form_sendto->radio_ftype_latex)) - buffer->makeLaTeXFile(fname, path, false); - // create the .txt file in tmp_dir if this filetype is requested - if (fl_get_button(fd_form_sendto->radio_ftype_ascii)) - buffer->writeFileAscii(fname, lyxrc.ascii_linelen); - Systemcall one; - one.startscript(Systemcall::Wait, command); -} - - -void SendtoCancelCB(FL_OBJECT *, long) -{ - fl_hide_form(fd_form_sendto->form_sendto); -} - - -void SendtoOKCB(FL_OBJECT * ob, long data) -{ - SendtoCancelCB(ob, data); - SendtoApplyCB(ob, data); -} diff --git a/src/LyXView.C b/src/LyXView.C index fae0afcce3..34b2d47850 100644 --- a/src/LyXView.C +++ b/src/LyXView.C @@ -58,12 +58,7 @@ LyXView::LyXView() autosave_timeout = new Timeout(5000); dialogs_ = new Dialogs(this); -#if 0 - dialogs_->hideBufferDependent - .connect(SigC::slot(&CloseAllBufferRelatedDialogs)); Dialogs::redrawGUI.connect(SigC::slot(this, &LyXView::redraw)); - Dialogs::redrawGUI.connect(SigC::slot(&RedrawAllBufferRelatedDialogs)); -#endif } diff --git a/src/lyx_gui.C b/src/lyx_gui.C index 3b54898c89..4515c4bbc6 100644 --- a/src/lyx_gui.C +++ b/src/lyx_gui.C @@ -264,10 +264,6 @@ void LyXGUI::create_forms() // From here down should be done by somebody else. (Lgb) - // - // Create forms - // - // This is probably as good a time as any to map the xform colours, // should a mapping exist. string const filename = AddName(user_lyxdir, "preferences.xform"); diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 7b1e22ce73..25b90bc5fd 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -33,7 +33,6 @@ #include "Lsstream.h" #include "trans_mgr.h" #include "layout.h" -#include "WorkArea.h" #include "bufferview_funcs.h" #include "minibuffer.h" #include "vspace.h" @@ -113,7 +112,6 @@ using std::back_inserter; extern BufferList bufferlist; extern LyXServer * lyxserver; extern bool selection_possible; -extern void MenuSendto(); extern boost::scoped_ptr toplevel_keymap; @@ -1118,7 +1116,7 @@ string const LyXFunc::dispatch(kb_action action, string argument) case LFUN_EXPORT: if (argument == "custom") - owner->getDialogs()->showSendto();//MenuSendto(); + owner->getDialogs()->showSendto(); else Exporter::Export(owner->buffer(), argument, false); break; -- 2.39.2