Experiment: limit size of strings read from lib/symbols
Coverity complains that we might read strings that are arbitrary
large, and that this can be a security issue. This is a problem in
particular, when we feed these strings to from_utf8(), which coverity
flags as dangerous for some reason.
The best solution would be IMO to model from_utf8() properly, but I do
not know how to do that. Here I try a different solution, where I
cannot read a string larger than 64k from the file.
Let's see whether this removes part of coverity warnings.
Coverity does not find it obvious that p is never negative. Normally
it is the case (because the items have been filtered), but it is
better to play safe.
Kornel Benko [Tue, 7 Mar 2017 13:27:08 +0000 (14:27 +0100)]
Cmake build: Adapt handling of mytheslib to automek behaviour
The added cmake-parameter is:
-DLYX_EXTERNAL_MYTHES=<value>
where <value> is one of
AUTO (Default) Search first on system for mythes (lib and include)
ON Use installed only (errors if not installed)
OFF Compile the provided source in 3rdparty
Now configure searches in this order
1. system-installed library
2. code bundled with LyX
If --with-included-mythes or if no mythes library is installed, then
the script selects the bundled version. There should be no cases
leading to error message.
Guillaume Munch [Fri, 17 Feb 2017 20:35:30 +0000 (21:35 +0100)]
Fix color of todo notes
Yellow on blue causes display issues (some text elements that become black on
blue, math insets that are no longer readable). Switch to black on orange to
match the pdf output.
Instead of using a coverity annotation (that does not work) it is
better to really iinitialize the members of the object, just in case
somebody decides to actually use the DisplayPath() constructor.
The configure code suggests that the default for
--with-included-(iconv|zlib|hunspell) is "yes", which is wrong: by
default is indeed to use the system libraries.
Change the MyThes detection to use the system version by default.
Also add to the verison information a line which lists the bundled libraries.
Günter Milde [Wed, 1 Mar 2017 22:16:59 +0000 (23:16 +0100)]
ctests: Add test file for "exotic" inputencoding cp858.
Encoding cp858 is only supported by some iconv variants
Gnu iconv only supports it, if configured with "--enable-extra-encodings"
(see https://www.gnu.org/software/libiconv/)
Coverity correctly spotted that the existing code creates a temporary
map and returns a value from it. It is not possible to make the map
const& directly because operator[] may change the map.
Allow Input of local includes from local layout files
When including files, LyX always searches the user and the system
directory, in that order. This means that when using local layout
files broken down into multiple includes, the various includes should
be specified with a path relative to the user layouts directory
(typically ~/.lyx/layouts), making this very impractical.
This commit allows including local files by specifying their path
as explicitly relative to the main layout file position, i.e., by
specifying their path with either "./" or "../". If the main layout
is not loaded from a local file, the usual search order is used,
even if the path are explicitly relative. So, for system layouts,
both "Input ./name.inc" and "Input name.inc" are equivalent.
Guillaume Munch [Sun, 26 Feb 2017 21:15:50 +0000 (22:15 +0100)]
Remove LyXToolBox
It extended QToolBox with size calculation to fix UI issues with the previous
design of GuiCitation. Since it always needed some kind of hack and since
QToolBoxes do not appear so popular, it probably won't be used anymore.
Günter Milde [Sun, 26 Feb 2017 18:33:00 +0000 (19:33 +0100)]
ctests: sort inverted unreliable tests.
We don't invert unreliable tests for the same reason they are
inverted but, e.g., a nonstandard test that fails for some reason even with the
additional requirements installed or a test that shows wrong output
but also an error.
Because latex allows to do so, and there is no easy way to achieve this.
This was apparently implemented to allow cycling between the various dash
types, but it was a bad idea bringing no benefit and causing griefs.
Scott Kostyshak [Fri, 11 Nov 2016 16:55:31 +0000 (11:55 -0500)]
Theorem style: set NextNoIndent to 0
After a Theorem environment, LaTeX does by default indent the
following paragraph.
I checked various classes and no ModifyStyle was needed. The
hollywood and broadway classes are strange cases where there is an
indent after the Theorem environment, but it is much smaller than
the normal indent. The indent is the same as the opening indent of
normal text, which we currently ignore. Further, I don't expect it
is common to use theorems in these classes.
Scott Kostyshak [Wed, 22 Feb 2017 16:48:42 +0000 (11:48 -0500)]
Remove a \textipa that snuck into es/UserGuide.lyx
This empty inset caused problems with LuaTeX + system fonts (see b863fb07). Although these problems seem to be resolved, this empty
inset is not supposed to be there.
xunicode (only) needs to be loaded for tipa emulation.
Previous fontspec loaded xunicode internally, for recent version, this
is no longer desired. However, we still need it for tipa emulation.
We use fontspec's trick to bypass XeTeX test with LuaTeX.
Guillaume Munch [Tue, 21 Feb 2017 20:04:50 +0000 (21:04 +0100)]
Allow more translations of OutlinerNames
Allow comments at the end.
Although comments seem to be valid at the end of lines in layouts, few of the
regexps take this into account. However, OutlinerName was the only one where
there were actual lines with comments at the end. Not touching the others as
there is no one-size-fits-all solution with these regexps.