On Sat, Sep 07, 2002 at 12:54:27PM +0300, Dekel Tsur wrote: > In my opinion you can remove this.
Please review. It seems to work for me. 10 files changed, 33 insertions, 158 deletions thanks john -- "Are you willing to go out there and save the lives of our children, even if it means losing your own life ? Yes I am. I believe you, Jeru... you're ready."
Index: BufferView_pimpl.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v retrieving revision 1.310 diff -u -r1.310 BufferView_pimpl.C --- BufferView_pimpl.C 29 Aug 2002 13:41:58 -0000 1.310 +++ BufferView_pimpl.C 7 Sep 2002 18:35:06 -0000 @@ -1177,7 +1177,8 @@ case LFUN_CHILD_INSERT: { InsetInclude::Params p; - p.cparams.setFromString(ev.argument); + if (!ev.argument.empty()) + p.cparams.setFromString(ev.argument); p.masterFilename_ = buffer_->fileName(); InsetInclude * inset = new InsetInclude(p); Index: buffer.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v retrieving revision 1.384 diff -u -r1.384 buffer.C --- buffer.C 6 Sep 2002 14:47:58 -0000 1.384 +++ buffer.C 7 Sep 2002 18:35:45 -0000 @@ -3148,26 +3148,6 @@ if (lyxerr.debugging(Debug::LATEX)) { features.showStruct(); } -} - - -// This function should be in Buffer because it's a buffer's property (ale) -string const Buffer::getIncludeonlyList(char delim) -{ - string lst; - for (inset_iterator it = inset_iterator_begin(); - it != inset_iterator_end(); ++it) { - if (it->lyxCode() == Inset::INCLUDE_CODE) { - InsetInclude & inc = static_cast<InsetInclude &>(*it); - if (inc.isIncludeOnly()) { - if (!lst.empty()) - lst += delim; - lst += inc.getRelFileBaseName(); - } - } - } - lyxerr[Debug::INFO] << "Includeonly(" << lst << ')' << endl; - return lst; } Index: buffer.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.h,v retrieving revision 1.113 diff -u -r1.113 buffer.h --- buffer.h 6 Sep 2002 14:47:59 -0000 1.113 +++ buffer.h 7 Sep 2002 18:35:50 -0000 @@ -266,8 +266,6 @@ void validate(LaTeXFeatures &) const; /// - string const getIncludeonlyList(char delim = ','); - /// std::vector<std::pair<string, string> > const getBibkeyList() const; /// std::vector<string> const getLabelList() const; Index: lyxfunc.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v retrieving revision 1.375 diff -u -r1.375 lyxfunc.C --- lyxfunc.C 6 Sep 2002 01:41:00 -0000 1.375 +++ lyxfunc.C 7 Sep 2002 18:36:06 -0000 @@ -45,29 +45,8 @@ #include "undo_funcs.h" #include "ParagraphParameters.h" -#include "insets/inseturl.h" -#include "insets/insetlatexaccent.h" -#include "insets/insettoc.h" -#include "insets/insetref.h" -#include "insets/insetparent.h" -#include "insets/insetindex.h" -#include "insets/insetinclude.h" -#include "insets/insetbib.h" -#include "insets/insetcite.h" -#include "insets/insettext.h" -#include "insets/insetert.h" -#include "insets/insetexternal.h" -#include "insets/insetgraphics.h" -#include "insets/insetfoot.h" -#include "insets/insetmarginal.h" -#include "insets/insetminipage.h" -#include "insets/insetfloat.h" -#if 0 -#include "insets/insetlist.h" -#include "insets/insettheorem.h" -#endif +#include "insets/insetcommand.h" #include "insets/insettabular.h" -#include "insets/insetcaption.h" #include "mathed/formulamacro.h" #include "mathed/math_cursor.h" Index: paragraph.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.C,v retrieving revision 1.228 diff -u -r1.228 paragraph.C --- paragraph.C 6 Sep 2002 15:18:07 -0000 1.228 +++ paragraph.C 7 Sep 2002 18:36:20 -0000 @@ -29,9 +29,7 @@ #include "ParameterStruct.h" #include "gettext.h" -#include "insets/insetinclude.h" #include "insets/insetbib.h" -#include "insets/insettext.h" #include "insets/insetoptarg.h" #include "support/filetools.h" Index: frontends/controllers/ControlInclude.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlInclude.C,v retrieving revision 1.28 diff -u -r1.28 ControlInclude.C --- frontends/controllers/ControlInclude.C 5 Sep 2002 15:14:21 -0000 1.28 +++ frontends/controllers/ControlInclude.C 7 Sep 2002 18:37:03 -0000 @@ -55,7 +55,7 @@ string pattern; switch (in_type) { case INPUT: - pattern = _("*.tex| LaTeX Documents (*.tex)"); + pattern = _("*.(tex|lyx)| LaTeX/LyX Documents"); break; case VERBATIM: @@ -63,7 +63,7 @@ break; case INCLUDE: - pattern = _("*.lyx| LyX Documents (*.lyx)"); + pattern = _("*.(tex|lyx)| LaTeX/LyX Documents"); break; } @@ -87,18 +87,8 @@ string const fileWithAbsPath = MakeAbsPath(file, OnlyPath(params().masterFilename_)); - if (params().noload) { - - if (prefixIs(file, "../") || prefixIs(file, "/")) - Alert::alert(_("Warning!"), - _("On some systems, with this options only relative path names"), - _("inside the master file dir are allowed. You might get a LaTeX error!")); - } - if (IsFileReadable(fileWithAbsPath)) return true; - else - Alert::alert(_("Warning!"), _("Specified file doesn't exist")); - return false; + return false; } Index: frontends/xforms/FormInclude.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormInclude.C,v retrieving revision 1.33 diff -u -r1.33 FormInclude.C --- frontends/xforms/FormInclude.C 5 Sep 2002 15:14:22 -0000 1.33 +++ frontends/xforms/FormInclude.C 7 Sep 2002 18:37:11 -0000 @@ -17,6 +17,8 @@ #pragma implementation #endif +#include "debug.h" + #include "xformsBC.h" #include "ControlInclude.h" #include "FormInclude.h" @@ -46,7 +48,6 @@ bc().addReadOnly(dialog_->button_browse); bc().addReadOnly(dialog_->radio_verbatim); - bc().addReadOnly(dialog_->check_typeset); bc().addReadOnly(dialog_->radio_useinput); bc().addReadOnly(dialog_->radio_useinclude); } @@ -54,30 +55,12 @@ void FormInclude::update() { - #if 0 - // I believe this is not needed. - // Anyway, it is plain wrong (JSpitzm 3/7/02) - if (controller().params().noload) { - fl_set_input(dialog_->input_filename, ""); - fl_set_button(dialog_->check_typeset, 0); - fl_set_button(dialog_->radio_useinput, 0); - fl_set_button(dialog_->radio_useinclude, 1); - fl_set_button(dialog_->radio_verbatim, 0); - fl_set_button(dialog_->check_visiblespace, 0); - fl_deactivate_object(dialog_->check_visiblespace); - fl_set_object_lcol(dialog_->check_visiblespace, FL_INACTIVE); - return; - } - #endif - fl_set_input(dialog_->input_filename, controller().params().cparams.getContents().c_str()); string const cmdname = controller().params().cparams.getCmdName(); - fl_set_button(dialog_->check_typeset, - int(controller().params().noload)); - + lyxerr << cmdname << endl; if (cmdname == "input") fl_set_button(dialog_->check_preview, int(controller().params().cparams.preview())); @@ -106,7 +89,6 @@ void FormInclude::apply() { - controller().params().noload = fl_get_button(dialog_->check_typeset); controller().params().cparams .preview(fl_get_button(dialog_->check_preview)); @@ -151,7 +133,6 @@ } else if (ob == dialog_->button_load) { string const in_name = fl_get_input(dialog_->input_filename); if (!rtrim(in_name).empty() && controller().fileExists(in_name)) { -// ApplyButton(); controller().OKButton(); controller().load(rtrim(in_name)); action = ButtonPolicy::SMI_NOOP; Index: frontends/xforms/forms/form_include.fd =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/forms/form_include.fd,v retrieving revision 1.10 diff -u -r1.10 form_include.fd --- frontends/xforms/forms/form_include.fd 2 Aug 2002 18:25:25 -0000 1.10 +++ frontends/xforms/forms/form_include.fd 7 Sep 2002 18:37:17 -0000 @@ -10,7 +10,7 @@ Name: form_include Width: 340 Height: 250 -Number of Objects: 15 +Number of Objects: 14 -------------------- class: FL_BOX @@ -67,24 +67,6 @@ argument: 0 -------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 180 70 150 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Don't typeset|#D -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: check_typeset -callback: C_FormBaseInputCB -argument: 0 - --------------------- class: FL_BUTTON type: RETURN_BUTTON box: 120 210 100 30 @@ -159,7 +141,7 @@ -------------------- class: FL_CHECKBUTTON type: PUSH_BUTTON -box: 180 100 150 30 +box: 180 70 150 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER @@ -213,7 +195,7 @@ -------------------- class: FL_ROUND3DBUTTON type: RADIO_BUTTON -box: 10 100 160 30 +box: 10 70 160 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER @@ -231,7 +213,7 @@ -------------------- class: FL_ROUND3DBUTTON type: RADIO_BUTTON -box: 10 70 160 30 +box: 10 100 160 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER @@ -267,7 +249,7 @@ -------------------- class: FL_CHECKBUTTON type: PUSH_BUTTON -box: 180 130 150 30 +box: 180 100 150 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER Index: insets/insetinclude.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetinclude.C,v retrieving revision 1.87 diff -u -r1.87 insetinclude.C --- insets/insetinclude.C 13 Aug 2002 14:40:35 -0000 1.87 +++ insets/insetinclude.C 7 Sep 2002 18:37:22 -0000 @@ -113,7 +113,7 @@ bool InsetInclude::Params::operator==(Params const & o) const { if (cparams == o.cparams && flag == o.flag && - noload == o.noload && masterFilename_ == o.masterFilename_) + masterFilename_ == o.masterFilename_) return true; return false; @@ -130,26 +130,6 @@ { params_ = p; - // Just to be safe... - string command; - - switch (params_.flag) { - case INCLUDE: - command="include"; - break; - case VERB: - command="verbatiminput"; - break; - case INPUT: - command="input"; - break; - case VERBAST: - command="verbatiminput*"; - break; - } - - params_.cparams.setCmdName(command); - if (preview_->monitoring()) preview_->stopMonitoring(); @@ -252,7 +232,7 @@ bool InsetInclude::loadIfNeeded() const { - if (params_.noload || isVerbatim()) + if (isVerbatim()) return false; if (!IsLyXFilename(getFileName())) Index: insets/insetinclude.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetinclude.h,v retrieving revision 1.48 diff -u -r1.48 insetinclude.h --- insets/insetinclude.h 1 Aug 2002 17:28:59 -0000 1.48 +++ insets/insetinclude.h 7 Sep 2002 18:37:22 -0000 @@ -1,12 +1,11 @@ // -*- C++ -*- -/* This file is part of* - * ====================================================== +/** + * \file insetinclude.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * LyX, The Document Processor - * - * Copyright 1997 LyX Team (this file was created this year) - * - * ====================================================== */ + * Full author contact details are available in file CREDITS + */ #ifndef INSET_INCLUDE_H #define INSET_INCLUDE_H @@ -25,32 +24,27 @@ // Created by AAS 970521 -/** Used to include files - */ +/// for including tex/lyx files class InsetInclude: public InsetButton, boost::noncopyable { public: /// the type of inclusion enum Flags { - /// - INCLUDE = 0, - /// - VERB = 1, - /// - INPUT = 2, - /// - VERBAST = 3 + INCLUDE = 0, //< + VERB = 1, //< + INPUT = 2, //< + VERBAST = 3 //< }; struct Params { - Params(InsetCommandParams const & cp = InsetCommandParams(), - Flags f = INCLUDE, + Params(InsetCommandParams const & cp = InsetCommandParams("input"), + Flags f = INPUT, bool nl = false, string const & name = string()) - : cparams(cp), flag(f), noload(nl), + : cparams(cp), flag(f), masterFilename_(name) {} + InsetCommandParams cparams; Flags flag; - bool noload; string masterFilename_; /// @@ -63,7 +57,7 @@ InsetInclude(Params const &); /// InsetInclude(InsetCommandParams const &, Buffer const &); - /// + ~InsetInclude(); /// Override these InsetButton methods if Previewing @@ -121,9 +115,6 @@ /// return the filename stub of the included file string const getRelFileBaseName() const; - /// return true if the included file is not loaded - bool isIncludeOnly() const; - /// return true if the file is or got loaded. bool loadIfNeeded() const; @@ -160,10 +151,4 @@ return params_.flag == VERB || params_.flag == VERBAST; } - -inline bool InsetInclude::isIncludeOnly() const -{ - return params_.flag == INCLUDE && params_.noload; -} - -#endif +#endif // INSETINCLUDE_H