mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
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
This commit is contained in:
parent
601889d75d
commit
4ca043181f
11
ChangeLog
11
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>
|
2000-03-16 Dekel Tsur <dekel@math.tau.ac.il>
|
||||||
* src/lyxfont.h Replaced the member variable bits.direction by the
|
* src/lyxfont.h Replaced the member variable bits.direction by the
|
||||||
member variable lang. Made many changes in other files.
|
member variable lang. Made many changes in other files.
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
#include "vc-backend.h"
|
#include "vc-backend.h"
|
||||||
#include "TextCache.h"
|
#include "TextCache.h"
|
||||||
|
|
||||||
extern int RunLinuxDoc(BufferView *, int, string const &);
|
|
||||||
extern BufferView * current_view; // called too many times in this file...
|
extern BufferView * current_view; // called too many times in this file...
|
||||||
|
|
||||||
using std::find;
|
using std::find;
|
||||||
@ -426,26 +425,6 @@ Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles)
|
|||||||
// make sure our path is absolute
|
// make sure our path is absolute
|
||||||
string s = MakeAbsPath(filename);
|
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?
|
// file already open?
|
||||||
if (exists(s)) {
|
if (exists(s)) {
|
||||||
if (AskQuestion(_("Document is already open:"),
|
if (AskQuestion(_("Document is already open:"),
|
||||||
|
35
src/lyx_cb.C
35
src/lyx_cb.C
@ -1283,7 +1283,6 @@ void LayoutsCB(int sel, void *)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* SGML Linuxdoc support:
|
* SGML Linuxdoc support:
|
||||||
* (flag == -1) import SGML file
|
|
||||||
* (flag == 0) make TeX output
|
* (flag == 0) make TeX output
|
||||||
* (flag == 1) make dvi output
|
* (flag == 1) make dvi output
|
||||||
*/
|
*/
|
||||||
@ -1302,37 +1301,27 @@ int RunLinuxDoc(BufferView * bv, int flag, string const & filename)
|
|||||||
}
|
}
|
||||||
Path p(path);
|
Path p(path);
|
||||||
|
|
||||||
if (flag != -1) {
|
if (!bv->available())
|
||||||
if (!bv->available())
|
return 0;
|
||||||
return 0;
|
bv->buffer()->makeLinuxDocFile(name, 0);
|
||||||
bv->buffer()->makeLinuxDocFile(name, 0);
|
|
||||||
#ifdef WITH_WARNINGS
|
#ifdef WITH_WARNINGS
|
||||||
#warning remove this once we have a proper geometry class
|
#warning remove this once we have a proper geometry class
|
||||||
#endif
|
#endif
|
||||||
BufferParams::PAPER_SIZE ps = static_cast<BufferParams::PAPER_SIZE>(bv->buffer()->params.papersize);
|
BufferParams::PAPER_SIZE ps = static_cast<BufferParams::PAPER_SIZE>(bv->buffer()->params.papersize);
|
||||||
switch (ps) {
|
switch (ps) {
|
||||||
case BufferParams::PAPER_A4PAPER:
|
case BufferParams::PAPER_A4PAPER:
|
||||||
add_flags = "-p a4";
|
add_flags = "-p a4";
|
||||||
break;
|
break;
|
||||||
case BufferParams::PAPER_USLETTER:
|
case BufferParams::PAPER_USLETTER:
|
||||||
add_flags = "-p letter";
|
add_flags = "-p letter";
|
||||||
break;
|
break;
|
||||||
default: /* nothing to be done yet ;-) */ break;
|
default: /* nothing to be done yet ;-) */ break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ProhibitInput();
|
ProhibitInput();
|
||||||
|
|
||||||
Systemcalls one;
|
Systemcalls one;
|
||||||
switch (flag) {
|
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 */
|
case 0: /* TeX output asked */
|
||||||
bv->owner()->getMiniBuffer()->Set(_("Converting LinuxDoc SGML to TeX file..."));
|
bv->owner()->getMiniBuffer()->Set(_("Converting LinuxDoc SGML to TeX file..."));
|
||||||
s2 = "sgml2latex " + add_flags + " -o tex "
|
s2 = "sgml2latex " + add_flags + " -o tex "
|
||||||
|
@ -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)
|
// Substitutes spaces with underscores in filename (and path)
|
||||||
string MakeLatexName(string const & file)
|
string MakeLatexName(string const & file)
|
||||||
{
|
{
|
||||||
|
@ -77,9 +77,6 @@ int IsFileWriteable (string const & path);
|
|||||||
///
|
///
|
||||||
bool IsLyXFilename(string const & filename);
|
bool IsLyXFilename(string const & filename);
|
||||||
|
|
||||||
///
|
|
||||||
bool IsSGMLFilename(string const & filename);
|
|
||||||
|
|
||||||
/** Returns the path of a library data file.
|
/** Returns the path of a library data file.
|
||||||
Search the file name.ext in the subdirectory dir of
|
Search the file name.ext in the subdirectory dir of
|
||||||
\begin{enumerate}
|
\begin{enumerate}
|
||||||
|
Loading…
Reference in New Issue
Block a user