]> git.lyx.org Git - features.git/commitdiff
Removed the automatic import of linuxdoc at start, it will be added later
authorJosé Matox <jamatos@lyx.org>
Fri, 17 Mar 2000 17:17:43 +0000 (17:17 +0000)
committerJosé Matox <jamatos@lyx.org>
Fri, 17 Mar 2000 17:17:43 +0000 (17:17 +0000)
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

ChangeLog
src/bufferlist.C
src/lyx_cb.C
src/support/filetools.C
src/support/filetools.h

index aac704719420c2ede84238451dc82710f3f46a55..e68528e0959da8ada4198f3454446775b468c85f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+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.
index 329af0882344077f9614442291f7cef09480dca6..47f2e9b25805ac28e6f0e739cae43bc0b3028e8b 100644 (file)
@@ -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:"), 
index af74982dfb7b790545d3a96957e965b48d1043e0..c94abb3c4c4be3d2365324db2e0f08a6b750047d 100644 (file)
@@ -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<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 "
index 1efd55bffe87b1cc63660ee5568433f89cac0ab6..996b064852b95eb8d0de3b4d18d7f95fa3c6c6ae 100644 (file)
@@ -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)
 {
index efe21a5f49b9160c9a378e34d64e5efdd07c88b0..ca549b518c27617133589dfd166ab0726b861da4 100644 (file)
@@ -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}