src/frontends/xforms/FormMathsPanel.C
src/frontends/xforms/form_maths_space.C
src/frontends/xforms/FormMathsSpace.C
+src/frontends/xforms/form_maths_style.C
+src/frontends/xforms/FormMathsStyle.C
src/frontends/xforms/form_minipage.C
src/frontends/xforms/FormMinipage.C
src/frontends/xforms/form_paragraph.C
+2002-01-10 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * lyxrc.C (getDescription): document that document_path and
+ template_path can be empty.
+
+2002-01-09 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * LaTeXFeatures.C (getMacros):
+ * buffer.C (validate): rename feature "amsstyle" to "amsmath"
+
+ * buffer.C (makeLaTeXFile): remove test for "amsstyle" from here.
+
+ * LaTeXFeatures.C (useFloat): require "float" here instead of in
+ getPackages.
+ (getPackages): rename feature "floats" to "float". Use an array to
+ iterate over 'simple' features (i.e. just a \usepackage). Add
+ handling of "amsmath" (renamed from "amsstyle").
+
+2001-12-29 Michael A. Koziarski <michael@koziarski.org>
+
+ * LaTeXFeatures.C (require): Prevent duplicate entries in the
+ features list.
+
2002-01-08 Angus Leeming <a.leeming@ic.ac.uk>
* FuncStatus.C: small compile fix for DEC cxx. Doesn't like
void LaTeXFeatures::require(string const & name)
{
+ if (isRequired(name))
+ return;
+
// INSET_GRAPHICS: remove this when InsetFig is thrown.
if (name == "graphics") {
features.push_back("graphicx");
void LaTeXFeatures::useFloat(string const & name)
{
usedFloats.insert(name);
+ // We only need float.sty if we use non builtin floats, or if we
+ // use the "H" modifier. This includes modified table and
+ // figure floats. (Lgb)
+ Floating const & fl = floatList.getType(name);
+ if (!fl.type().empty() && !fl.builtin()) {
+ require("float");
+ }
}
return encodings;
}
+namespace {
+
+char const * simplefeatures[] = {
+ "array",
+ "verbatim",
+ "longtable",
+ "rotating",
+ "latexsym",
+ "pifont",
+ "subfigure",
+ "floatflt",
+ "varioref",
+ "prettyref",
+ "float"
+};
+
+const int nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
+
+}
string const LaTeXFeatures::getPackages() const
{
* These are all the 'simple' includes. i.e
* packages which we just \usepackage{package}
**/
-
- // array-package
- if (isRequired("array"))
- packages << "\\usepackage{array}\n";
-
- // verbatim.sty
- if (isRequired("verbatim"))
- packages << "\\usepackage{verbatim}\n";
-
- //longtable.sty
- if (isRequired("longtable"))
- packages << "\\usepackage{longtable}\n";
-
- //rotating.sty
- if (isRequired("rotating"))
- packages << "\\usepackage{rotating}\n";
-
-
- // latexsym.sty
- if (isRequired("latexsym"))
- packages << "\\usepackage{latexsym}\n";
-
- // pifont.sty
- if (isRequired("pifont"))
- packages << "\\usepackage{pifont}\n";
-
- // subfigure.sty
- if (isRequired("subfigure"))
- packages << "\\usepackage{subfigure}\n";
-
- // floatflt.sty
- if (isRequired("floatflt"))
- packages << "\\usepackage{floatflt}\n";
-
-
- // varioref.sty
- if (isRequired("varioref"))
- packages << "\\usepackage{varioref}\n";
-
- // prettyref.sty
- if (isRequired("prettyref"))
- packages << "\\usepackage{prettyref}\n";
-
+ for (int i = 0 ; i < nb_simplefeatures ; ++i) {
+ if (isRequired(simplefeatures[i]))
+ packages << "\\usepackage{"
+ << simplefeatures[i]
+ << "}\n";
+ }
+
/**
* The rest of these packages are somewhat more complicated
* than those above.
**/
+ if (isRequired("amsmath")
+ && ! tclass.provides(LyXTextClass::amsmath)) {
+ packages << "\\usepackage{amsmath}\n";
+ }
+
// color.sty
if (isRequired("color")) {
if (params.graphicsDriver == "default")
" {\\newcommand{\\url}{\\texttt}}\n";
// float.sty
- // We only need float.sty if we use non builtin floats, or if we
- // use the "H" modifier. This includes modified table and
- // figure floats. (Lgb)
- if (!usedFloats.empty()) {
- UsedFloats::const_iterator beg = usedFloats.begin();
- UsedFloats::const_iterator end = usedFloats.end();
- for (; beg != end; ++beg) {
- Floating const & fl = floatList.getType((*beg));
- if (!fl.type().empty() && !fl.builtin()) {
- const_cast<LaTeXFeatures *>(this)->require("floats");
- break;
- }
- }
- }
- if (isRequired("floats")) {
- packages << "\\usepackage{float}\n";
- }
-
// natbib.sty
if (isRequired("natbib")) {
packages << "\\usepackage[";
macros << guillemotright_def << '\n';
// Math mode
- if (isRequired("boldsymbol") && !isRequired("amsstyle"))
+ if (isRequired("boldsymbol") && !isRequired("amsmath"))
macros << boldsymbol_def << '\n';
- if (isRequired("binom") && !isRequired("amsstyle"))
+ if (isRequired("binom") && !isRequired("amsmath"))
macros << binom_def << '\n';
// other
<< name << "}\n";
// What missing here is to code to minimalize the code
- // outputted so that the same floatstyle will not be
+ // output so that the same floatstyle will not be
// used several times, when the same style is still in
// effect. (Lgb)
}
texrow.newline();
}
- if (features.isRequired("amsstyle")
- && !tclass.provides(LyXTextClass::amsmath)) {
- ofs << "\\usepackage{amsmath}\n";
- texrow.newline();
- }
-
if (tokenPos(tclass.opt_pagestyle(),
'|', params.pagestyle) >= 0) {
if (params.pagestyle == "fancy") {
// AMS Style is at document level
if (params.use_amsmath || tclass.provides(LyXTextClass::amsmath))
- features.require("amsstyle");
+ features.require("amsmath");
while (par) {
// We don't use "lyxerr.debug" because of speed. (Asger)
/**
* Constructs a file dialog attached to LyXView \param lv, with
- * title \param title. If param \a is \const LFUN_SELECT_FILE_SYNC
+ * title \param title. If \param a is \const LFUN_SELECT_FILE_SYNC
* then a value will be returned immediately upon performing a Select(),
* otherwise a callback Dispatch() will be invoked with the filename as
* argument, of action \param a.
*
- * Up to two optional extra buttons are allowed for specifying addtional
- * directories in the navigation.
+ * Up to two optional extra buttons are allowed for specifying
+ * additional directories in the navigation (an empty
+ * directory is interpreted as getcwd())
*/
- FileDialog(LyXView * lv, string const & title, kb_action a = LFUN_SELECT_FILE_SYNC,
- Button b1 = Button(string(), string()),
- Button b2 = Button(string(), string()));
+ FileDialog(LyXView * lv, string const & title,
+ kb_action a = LFUN_SELECT_FILE_SYNC,
+ Button b1 = Button(string(), string()),
+ Button b2 = Button(string(), string()));
~FileDialog();
/**
- * Choose a file for selection, starting in directory \param path, with the file
- * selection \param mask. The \param mask string is of the form :
+ * Choose a file for selection, starting in directory \param
+ * path, with the file selection \param mask. The \param mask
+ * string is of the form :
*
* <regular expression to match> | <description>
*
+2002-01-10 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * FormPreferences.C (input): allow empty values for document_path
+ and template_path.
+
+ * FormFiledialog.C (SetButton):
+ (FileDlgCB): do not disable directory buttons if they have an
+ empty path.
+ (SetDirectory): if the argument is an empty string, change to
+ cwd().
+
2002-01-09 Martin Vermeer <martin.vermeer@hut.fi>
* forms/form_maths_style.fd:
// SetDirectory: sets dialog current directory
void FileDialog::Private::SetDirectory(string const & Path)
{
+
string tmp;
-
- if (!pszDirectory.empty()) {
- string TempPath = ExpandPath(Path); // Expand ~/
- TempPath = MakeAbsPath(TempPath, pszDirectory);
- tmp = MakeAbsPath(TempPath);
- } else {
- tmp = MakeAbsPath(Path);
- }
+
+ if (Path.empty())
+ tmp = lyx::getcwd();
+ else
+ tmp = MakeAbsPath(ExpandPath(Path), pszDirectory);
// must check the directory exists
DIR * pDirectory = ::opendir(tmp.c_str());
pTemp = &pszUserPath2;
} else return;
- if (!pszName.empty() && !pszPath.empty()) {
+ if (!pszName.empty()) {
fl_set_object_label(pObject, pszName.c_str());
fl_show_object(pObject);
*pTemp = pszPath;
break;
case 12: // user button 1
- if (!pCurrentDlg->pszUserPath1.empty()) {
- pCurrentDlg->SetDirectory(pCurrentDlg->pszUserPath1);
- pCurrentDlg->SetMask(fl_get_input(pFileDlgForm
- ->PatBox));
- pCurrentDlg->Reread();
- }
+ pCurrentDlg->SetDirectory(pCurrentDlg->pszUserPath1);
+ pCurrentDlg->SetMask(fl_get_input(pFileDlgForm
+ ->PatBox));
+ pCurrentDlg->Reread();
break;
case 13: // user button 2
- if (!pCurrentDlg->pszUserPath2.empty()) {
- pCurrentDlg->SetDirectory(pCurrentDlg->pszUserPath2);
- pCurrentDlg->SetMask(fl_get_input(pFileDlgForm
- ->PatBox));
- pCurrentDlg->Reread();
- }
+ pCurrentDlg->SetDirectory(pCurrentDlg->pszUserPath2);
+ pCurrentDlg->SetMask(fl_get_input(pFileDlgForm
+ ->PatBox));
+ pCurrentDlg->Reread();
break;
}
// Select: launches dialog and returns selected file
-string const FileDialog::Private::Select(string const & title, string const & path,
- string const & mask, string const & suggested)
+string const FileDialog::Private::Select(string const & title,
+ string const & path,
+ string const & mask,
+ string const & suggested)
{
// handles new mask and path
bool isOk = true;
if (!ob || ob == dialog_->input_default_path) {
string const name = fl_get_input(dialog_->input_default_path);
- if (!RWInfo::WriteableDir(name)) {
+ if (!name.empty() && !RWInfo::WriteableDir(name)) {
parent_.printWarning(RWInfo::ErrorMessage());
return false;
}
if (!ob || ob == dialog_->input_template_path) {
string const name = fl_get_input(dialog_->input_template_path);
- if (!RWInfo::ReadableDir(name)) {
+ if (!name.empty() && !RWInfo::ReadableDir(name)) {
parent_.printWarning(RWInfo::ErrorMessage());
return false;
}
+2002-01-09 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * insetfloat.C (validate): require "float" instead of "floats".
+
2002-01-08 Martin Vermeer <martin.vermeer@hut.fi>
* insettabular.C (getStatus): use FuncStatus
void InsetFloat::validate(LaTeXFeatures & features) const
{
if (contains(placement(), "H")) {
- features.require("floats");
+ features.require("float");
}
features.useFloat(floatType_);
break;
case RC_DOCUMENTPATH:
- str = N_("The default path for your documents.");
+ str = N_("The default path for your documents. An empty value selects the directory LyX was started from.");
break;
case RC_TEMPLATEPATH:
- str = N_("The path that LyX will set when offering to choose a template.");
+ str = N_("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
break;
case RC_TEMPDIRPATH:
+2002-01-09 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * math_hullinset.C (validate): rename feature "amsstyle" to
+ "amsmath".
+
2002-01-09 Martin Vermeer <martin.vermeer@hut.fi>
* math_support.C: modified to support a mathed pop-up for math
void MathHullInset::validate(LaTeXFeatures & features) const
{
if (ams())
- features.require("amsstyle");
+ features.require("amsmath");
// Validation is necessary only if not using AMS math.