+2000-03-17 José Abílio Matos <jamatos@lyx.org>
+ * src/lyx_cb.C (RunLinuxDoc) Removed the flag==-1 option for linuxdoc
+ import based on the filename.
+
+ * src/bufferlist.C () Removed the call to RunLinuxDoc where a linuxdoc
+ file would be imported at start, if the filename where of a sgml file.
+
+ * src/support/filetools.C (IsSGMLfilename) Removed, no longer needed.
+
+ * src/support/filetools.h (IsSGMLfilename) Removed, no longer needed.
+
2000-03-16 Dekel Tsur <dekel@math.tau.ac.il>
* src/lyxfont.h Replaced the member variable bits.direction by the
member variable lang. Made many changes in other files.
#include "vc-backend.h"
#include "TextCache.h"
-extern int RunLinuxDoc(BufferView *, int, string const &);
extern BufferView * current_view; // called too many times in this file...
using std::find;
// make sure our path is absolute
string s = MakeAbsPath(filename);
- // Is this done too early?
- // Is it LinuxDoc?
- if (IsSGMLFilename(s)) {
- FileInfo fi(s);
- if (fi.exist() && fi.readable()) {
- if (!RunLinuxDoc(current_view, -1, s)) {
- s = ChangeExtension (s, ".lyx", false);
- } else { // sgml2lyx failed
- WriteAlert(_("Error!"),
- _("Could not convert file"), s);
- return 0;
- }
- } else {
- // just change the extension and it will be
- // handled like a regular lyx file that does
- // not exist.
- s = ChangeExtension(s, ".lyx", false);
- }
- }
-
// file already open?
if (exists(s)) {
if (AskQuestion(_("Document is already open:"),
/*
* SGML Linuxdoc support:
- * (flag == -1) import SGML file
* (flag == 0) make TeX output
* (flag == 1) make dvi output
*/
}
Path p(path);
- if (flag != -1) {
- if (!bv->available())
- return 0;
- bv->buffer()->makeLinuxDocFile(name, 0);
+ if (!bv->available())
+ return 0;
+ bv->buffer()->makeLinuxDocFile(name, 0);
#ifdef WITH_WARNINGS
#warning remove this once we have a proper geometry class
#endif
- BufferParams::PAPER_SIZE ps = static_cast<BufferParams::PAPER_SIZE>(bv->buffer()->params.papersize);
- switch (ps) {
- case BufferParams::PAPER_A4PAPER:
- add_flags = "-p a4";
- break;
- case BufferParams::PAPER_USLETTER:
- add_flags = "-p letter";
- break;
- default: /* nothing to be done yet ;-) */ break;
- }
+ BufferParams::PAPER_SIZE ps = static_cast<BufferParams::PAPER_SIZE>(bv->buffer()->params.papersize);
+ switch (ps) {
+ case BufferParams::PAPER_A4PAPER:
+ add_flags = "-p a4";
+ break;
+ case BufferParams::PAPER_USLETTER:
+ add_flags = "-p letter";
+ break;
+ default: /* nothing to be done yet ;-) */ break;
}
ProhibitInput();
Systemcalls one;
switch (flag) {
- case -1: /* Import file */
- bv->owner()->getMiniBuffer()->Set(_("Importing LinuxDoc SGML file `"),
- MakeDisplayPath(filename), "'...");
- s2 = "sgml2lyx " + lyxrc.sgml_extra_options + ' '
- + name;
- if (one.startscript(Systemcalls::System, s2))
- errorcode = 1;
- break;
case 0: /* TeX output asked */
bv->owner()->getMiniBuffer()->Set(_("Converting LinuxDoc SGML to TeX file..."));
s2 = "sgml2latex " + add_flags + " -o tex "
}
-bool IsSGMLFilename(string const & filename)
-{
- return contains(filename, ".sgml");
-}
-
-
// Substitutes spaces with underscores in filename (and path)
string MakeLatexName(string const & file)
{
///
bool IsLyXFilename(string const & filename);
-///
-bool IsSGMLFilename(string const & filename);
-
/** Returns the path of a library data file.
Search the file name.ext in the subdirectory dir of
\begin{enumerate}