From: José Matox Date: Fri, 17 Mar 2000 17:17:43 +0000 (+0000) Subject: Removed the automatic import of linuxdoc at start, it will be added later X-Git-Tag: 1.6.10~22330 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=4ca043181f63b198506735ea0325cf17e76fbd1e;p=features.git Removed the automatic import of linuxdoc at start, it will be added later with uniform interface with latex, literate and text import. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@620 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/ChangeLog b/ChangeLog index aac7047194..e68528e095 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2000-03-17 José Abílio Matos + * 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 * src/lyxfont.h Replaced the member variable bits.direction by the member variable lang. Made many changes in other files. diff --git a/src/bufferlist.C b/src/bufferlist.C index 329af08823..47f2e9b258 100644 --- a/src/bufferlist.C +++ b/src/bufferlist.C @@ -36,7 +36,6 @@ #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; @@ -426,26 +425,6 @@ Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles) // 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:"), diff --git a/src/lyx_cb.C b/src/lyx_cb.C index af74982dfb..c94abb3c4c 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -1283,7 +1283,6 @@ void LayoutsCB(int sel, void *) /* * SGML Linuxdoc support: - * (flag == -1) import SGML file * (flag == 0) make TeX output * (flag == 1) make dvi output */ @@ -1302,37 +1301,27 @@ int RunLinuxDoc(BufferView * bv, int flag, string const & filename) } 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(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(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 " diff --git a/src/support/filetools.C b/src/support/filetools.C index 1efd55bffe..996b064852 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -64,12 +64,6 @@ bool IsLyXFilename(string const & filename) } -bool IsSGMLFilename(string const & filename) -{ - return contains(filename, ".sgml"); -} - - // Substitutes spaces with underscores in filename (and path) string MakeLatexName(string const & file) { diff --git a/src/support/filetools.h b/src/support/filetools.h index efe21a5f49..ca549b518c 100644 --- a/src/support/filetools.h +++ b/src/support/filetools.h @@ -77,9 +77,6 @@ int IsFileWriteable (string const & path); /// 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}