Commit Graph

104 Commits

Author SHA1 Message Date
Scott Kostyshak
fc19148f6d Fix a GCC warning: comparing signed vs. unsigned
This also changes the type of an int to an ssize_t.

nRead is initialized as an ssize_t because it could
be negative. It is cast to a size_t for comparison
to the size of a vector, but only after we check
that nRead is not negative.
2014-05-20 08:01:49 -04:00
Scott Kostyshak
1821c6d8a3 Centralize substitution of python commands
The code for detecting python commands and substituting in the
correct prefix is now merged with what used to be libScriptSearch()
and is now renamed to commandPrep(). This commit does not change
any functionality and just improves organization to reduce the
chance of bugs in the future.
2014-05-14 15:45:20 -04:00
Scott Kostyshak
8b66f9cedf Centralize replacement of "$$s"
Now the replacement is done in startScript(). In addition to making
the code cleaner and more consistent, this commit fixes a bug where
"$$s" was not replaced when "latex=" was specified in the extra flags
of a converter.

Note that the temporary fix at 731b8610 is reverted with this commit.
2014-05-14 15:45:20 -04:00
Richard Heck
fdbe775b9f This is the result of an audit of all static variables, looking
for possible thread conflicts, of the sort Georg resolved at
6a30211f. I have made static variables const where possible,
and marked cases that looked potentially problematic with the
comment:
	// FIXME THREAD
Many of these definitely are vulnerable to concurrent access, such
as the static variables declared at the start of output_latex.cpp.
Suppose, e.g., we were outputting latex and also displaying the
source of a different document.

I'd appreciate it if others could grep for "FIXME THREAD" and see
if some of these are harmless, or what.
2014-04-21 11:51:57 -04:00
Pavel Sanda
0f8a2d2860 Squash gcc warning.
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg183142.html
2014-03-27 01:12:26 -07:00
Kornel Benko
5efd59733a Remove warning 2014-01-05 10:04:23 +01:00
Kornel Benko
805e51eff8 Implement file locking and apply to configure
Functions for file locking are added. They are used for ensuring that
for specified userdir only one LyX process runs configure.
2013-11-20 19:40:32 +01:00
Jean-Marc Lasgouttes
14e01a92a4 Rename Path.h to PathChanger.h (actual name of the class) 2013-02-06 11:51:06 +01:00
Jean-Marc Lasgouttes
16fd47ad8f Fix bug #7741: incorrect locale when starting R from LyX?
The goal here is to get rid of the old code that modified variables
LANGUAGE and LC_ALL, therefore creating the problems mentionned
in the ticket.

In the new system, there is no explicit "GUI" message handler, that
needs to be reset at each language change. Instead, getGuiMessages
calls getMessages with the correct parameter. This allows to simplify
greatly the code and to remove a lot of old cruft.
2012-07-15 22:22:10 +02:00
Georg Baum
9fe72c3501 Move readBB_from_PSFile() out of support (no code change),
since it soon will need to use the Formats class.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40757 a592a061-630c-0410-9148-cb99ea01b6c8
2012-02-15 20:50:52 +00:00
Georg Baum
a6f843aacb get rid of dead code and silly function
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40605 a592a061-630c-0410-9148-cb99ea01b6c8
2012-01-12 19:48:08 +00:00
Jean-Marc Lasgouttes
d7320ad89b Fix shortenng of file names in MakeDisplayPath: it is not a good idea to slice an utf8 string at arbitrary offsets, we have to work on a docstring instead. We need unfortunately to switch back and orth between utf8 and docstring.
This is a candidate for branch too, although the bug is minor.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40149 a592a061-630c-0410-9148-cb99ea01b6c8
2011-11-06 22:36:14 +00:00
Georg Baum
07fc1c3abc Replace a half-baked attempt to remove \lyxdot from the directory part of
file names with a proper one: Only replace dots in the base name, and only
request the lyxdot feature if it is needed. This is a partial fix of bug #7650.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40115 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-31 20:27:21 +00:00
Enrico Forestieri
37ba87cfb1 Avoid unnecessary spaces with the Windows shell.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39824 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-09 21:53:35 +00:00
Enrico Forestieri
9c365e841e Apparently, the env program does not strip quotes around the values of the
environment variables. So, replace single quotes by double ones, such that
the QProcess parser will strip them, and strip them by ourselves in ForkedCall.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39761 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-25 20:33:06 +00:00
Enrico Forestieri
b53445e6cd Adjust the simple parser in ForkedCalls.cpp to also account for quotes
don't delimiting an entire word and adapt the quoting such that it works
for Systemcall, ForkedCall, and also for the case when QProcess in not used.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39759 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-25 16:32:31 +00:00
Enrico Forestieri
e5cc5ac2e8 Manage the setting of the latex environment for Systemcall and ForkedCall
in a central place.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39758 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-25 13:35:42 +00:00
Enrico Forestieri
6eabcc2dd3 Protect against autorun commands on Windows (see also bug #7718).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39550 a592a061-630c-0410-9148-cb99ea01b6c8
2011-08-28 16:53:38 +00:00
Enrico Forestieri
d68309ee17 On Windows, also fix call to octave (related to bug #7715).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39513 a592a061-630c-0410-9148-cb99ea01b6c8
2011-08-23 18:45:46 +00:00
Enrico Forestieri
f3f38f492b Fix #7715 (Lyx 2.0.0 doesn't work with Mathematica 8: call to 'math' problem?)
The fix also allows to execute again batch files when using runCommand.
Unfortunately, this is still not possible with QProcess as that code is not
under our control.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39504 a592a061-630c-0410-9148-cb99ea01b6c8
2011-08-22 01:39:49 +00:00
John C. McCabe-Dansted
2885ea3921 Fix bug #7467: build failure on GNU/Hurd, which doesn't define PATH_MAX.
(Patch from Pino, adapted for trunk by Sven)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39333 a592a061-630c-0410-9148-cb99ea01b6c8
2011-07-17 12:32:00 +00:00
Enrico Forestieri
1717ef203c Introduce the possibility of setting a prefix for the TEXINPUTS environment
variable. This is done in the preferences, much like as the PATH prefix.
A single '.' in the paths will get replaced with the current document dir
and also non-absolute paths will be prefixed with that dir.

The default semantics of TEXINPUTS apply, such that, for example, if a
path is terminated with a double slash, all subdirectories will be also
searched by both the TeX engine and ancillary programs such as dvi
previewers or dvips. As an example, if the prefix is set to ".:figs", the
TEXINPUTS variable will be set as ".:<docdir>:<docdir>/figs:$ORIGTEXINPUTS",
where <docdir> is the document directory.

The initial '.' is necessary to address the actual current dir (this will
be the temp dir at preview time), while if TEXINPUTS was initially unset,
such that $ORIGTEXINPUTS is empty, a colon (or semicolon on Windows) will
end the path list. This is very important, because we don't want to replace
the system directories but to complement them and, in order to do that, an
empty element has to be present in the list. Indeed, according to the
TEXINPUTS semantics, an empty element means the standard search path.
This works whether TEXINPUTS is originally set or not, because if the
original TEXINPUTS starts with a colon (meaning that the standard search
path is wanted there) we will have an empty element at that point,
otherwise the final colon will simply serve as a path separator.

Of course, on Windows a ';' has to be used as a path separator. LyX will
take care of transforming the platform path list into one understandable
by the TeX engine. For example, this will be the case for a Cygwin version
of LyX using a native Windows TeX engine or viceversa. I tested all of
this and it works for me.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38681 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-09 23:25:51 +00:00
Peter Kümmel
dd64477e3b #7407, home_dir could be a static function and also be called by the
Package constructor


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38370 a592a061-630c-0410-9148-cb99ea01b6c8
2011-04-13 19:11:55 +00:00
Enrico Forestieri
a99340cd10 Infrastructure for choosing different icon sets. This currently works
through the rc setting \icon_set. Preferences dialog will follow shortly.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38038 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-25 01:59:34 +00:00
Joost Verburg
1e190a2af2 use return value of regex_match to check whether a match was found
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37722 a592a061-630c-0410-9148-cb99ea01b6c8
2011-02-17 19:39:07 +00:00
Joost Verburg
75218491f9 fix replacement of multiple environment variables (result was not cleared for next iteration)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37699 a592a061-630c-0410-9148-cb99ea01b6c8
2011-02-16 18:59:19 +00:00
Stephan Witt
9e16f14464 introduce the lyx_dir() of Package, automatically set LyXDir environment, correct the replaceEnvironmentPath() function (see #4177) and replace environment variables in path_prefix at runtime
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37326 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-25 21:10:49 +00:00
Richard Heck
f7bfb018a7 Update error message.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37244 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-17 21:49:28 +00:00
Richard Heck
0e2828917b Utility functions for converting preference files.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37230 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-16 19:51:02 +00:00
Jürgen Spitzmüller
0a34b1e047 fix some typos. Patch by Yuri Chornoivan.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37039 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-29 16:57:04 +00:00
Jean-Marc Lasgouttes
bbea06a0c6 fix comment
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36905 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-16 17:51:30 +00:00
Georg Baum
53a72a4526 fix bug #6584
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36687 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-03 17:48:06 +00:00
Uwe Stöhr
b33182bc3d filetools.cpp: introduce a new method to be able to distinguish between valid LaTeX filenames and filenames causing troubles on some DVI viewers.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35514 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-27 02:39:22 +00:00
Uwe Stöhr
f772315090 filetools.cpp: revert r35499 until we found a proper solution as discussed in http://article.gmane.org/gmane.editors.lyx.devel/129471
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35500 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-25 16:04:52 +00:00
Uwe Stöhr
052f689daa filetools.cpp: fix #6916 - round parentheses are valid in filenames (they are even standard in paths in WinXP 64bit); they should also make no problems on UNIX systems
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35499 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-25 14:25:19 +00:00
Abdelrazak Younes
ef3c8c10e1 Fix gcc warning.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35294 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-06 07:11:27 +00:00
Abdelrazak Younes
cb40d51906 whitespace
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35293 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-06 07:10:35 +00:00
Peter Kümmel
615d42d357 TR1: use std::tr1 regex with msvc10
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34725 a592a061-630c-0410-9148-cb99ea01b6c8
2010-06-29 17:09:40 +00:00
Joost Verburg
23df7e16a9 Include io.h only on Windows
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34723 a592a061-630c-0410-9148-cb99ea01b6c8
2010-06-29 13:23:33 +00:00
Joost Verburg
e6254e6fb2 Launch external Windows processes for e.g. display image conversion using CreateProcess with a CREATE_NO_WINDOW flag, allowing LyX to be compiled as a GUI application without console windows popping up.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34721 a592a061-630c-0410-9148-cb99ea01b6c8
2010-06-28 17:45:04 +00:00
Pavel Sanda
bb59d0fd0a support:
isLyXFilename -> isLyXFilename
isValidLaTeXFilename -> isValidLaTeXFileName
isSGMLFilename -> isSGMLFileName

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34242 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-21 01:19:31 +00:00
Pavel Sanda
72a6c77a51 support:
frontends:
onlyFilename -> onlyFileName

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34240 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-21 01:19:28 +00:00
Pavel Sanda
62ca7f3ae5 Proper camel case for FileName.absFilename
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34234 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-21 01:19:09 +00:00
Pavel Sanda
a7b921aeeb Fix unsafe use of fixed width arrays.
Fix crash when MathMatrix has more than 80 columns

Patch from John McCabe-Dansted, approved from Andre.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33641 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-06 14:57:16 +00:00
Enrico Forestieri
5ec9d5f956 Fix bug #4063: LyX cannot handle apostrophe characters ' in path names
when QProcess is disabled.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32592 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-19 19:29:53 +00:00
Enrico Forestieri
04580d2122 Improve the command-line parser meant to be used for QProcess.
Now, both single- and double-quotes posix-like quoting styles are implemented,
such that a command-line meant for the shell can also be used for QProcess.
However, only redirecting the output to a file is supported. Supporting piping
would require a (major?) rewrite of the Systemcall class.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32590 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-19 17:26:09 +00:00
Enrico Forestieri
5ad8d44ce2 Allow double quotes in file names passed to converters.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32583 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-18 22:15:46 +00:00
Uwe Stöhr
8f3acbb484 remove unused includes of convert.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29772 a592a061-630c-0410-9148-cb99ea01b6c8
2009-05-21 21:02:14 +00:00
Enrico Forestieri
c73eb3497a Fix QProcess code on posix systems and reenable it by default, in order
to catch early possible problems.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29634 a592a061-630c-0410-9148-cb99ea01b6c8
2009-05-11 22:03:52 +00:00
Vincent van Ravesteijn
b5fc687888 Fix bug #4177: Lyx fails to open files with a $ character in their name.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29587 a592a061-630c-0410-9148-cb99ea01b6c8
2009-05-09 17:06:54 +00:00