Give a warning when system boost and stdlib-debug are used together
In general this would lead to an immediate runtime crash because the
runtime checks of libstdc++ change the layout of some STL objects.
Therefore, this will only work when the boost libraries have been
compiled with this same flag. At this time, it is not known whether
any linux distribution contains such libraries.
- the long awaited MiKTeX installer is available, this fixes many installation errors in LyX is installed for the first time (I will provide a new installer build as soon as I find more time)
Georg Baum [Sun, 20 Sep 2015 19:39:59 +0000 (21:39 +0200)]
Remove unused variables found by cppcheck
There are still a few warnings of the kind
(style) Variable 'x' is assigned a value that is never used.
since I did not touch code where I was not sure whether there might be a real
bug, and I kept some for symmetry reasons as well.
Georg Baum [Sun, 20 Sep 2015 17:43:06 +0000 (19:43 +0200)]
Forbid wrong compiler generated copy constructors
This fixes cppcheck warnings (style) 'class x' does not have a copy constructor
which is recommended since the class contains a pointer to allocated memory.
Georg Baum [Sun, 20 Sep 2015 11:05:30 +0000 (13:05 +0200)]
Create module for paralist.sty
paralist.sty extends the standard list environments by some more compact
versions. Support for this has already been requested 15 years ago, and
now I needed it myself.
Georg Baum [Sun, 20 Sep 2015 08:42:35 +0000 (10:42 +0200)]
Fix cppcheck variable scope warnings
These were all flagged by "(style) The scope of the variable 'x' can be reduced."
Narowing the scope improves readability, and if it is in a loop then the
compiler will be clever enough to produce efficient code, we do not need
manual optimization for POD types.
Georg Baum [Thu, 17 Sep 2015 20:11:18 +0000 (22:11 +0200)]
Refuse to run tex2lyx tests with in-source builds
As Günter found out running the tex2lyx tests overwrites the test references
if the build directory is identical to the source directory. Therefore the
tests would always pass, but git diff would show a non-empty diff if the tests
should have failed. Since it is better anyway to build in a separate directory
we simply do not support srcdir = builddir for the tests and abort with an
error.
Guillaume Munch [Sat, 1 Aug 2015 07:05:33 +0000 (08:05 +0100)]
Math commands used in text mode now always use the current selection as contents
(#9762)
* fixes a bug where this was already the expected behaviour of
math-subscript and math-superscript but failed.
* corrects the behaviour where if there is \newcommand in the
selection, then a corresponding macro template is introduced
instead of a math inset.
* fixes a bug where math-display, math-subscript and math-supscript
would also introduce such a macro template in a way unrelated to
their function. Now it only happens with math-mode without
arguments.
* fixes a bug where a text that does not denote a macro definition,
e.g. "aaa\newcommandaaa", would produce \invalidmacro.
Georg Baum [Sun, 13 Sep 2015 17:47:21 +0000 (19:47 +0200)]
Add some missing member variable initializations
These were all found by cppcheck. Even in constructors that are there "only
because of std containers" the class should be initialized correctly. You can
never know whether such an object does not get used, and then a nice crash
caused by dereferencing a NULL-pointer is better than undefined behaviour.
Georg Baum [Sun, 13 Sep 2015 08:04:16 +0000 (10:04 +0200)]
Work around a gcc5 bug
The old code produced crashes with gcc5 caused by calling the copy
constructor (see https://bugzilla.redhat.com/show_bug.cgi?id=1260976).
This has been filed as gcc bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67557
It is currently being marked as invalid (they claim the code is not valid and
produces undefined behaviour), but I don't think that this is correct.
Fortunately i does not matter for us whether the old code was valid or not,
since the new version is easier to understand and works with all compilers.
Georg Baum [Fri, 11 Sep 2015 21:04:59 +0000 (23:04 +0200)]
Make destructor virtual
Base classes with virtual methods should have a virtual destructor.
See Scott Meyers, Effective C++ item 7: Declare destructors virtual in
polymorphic base classes.
Guillaume Munch [Tue, 4 Aug 2015 22:16:40 +0000 (23:16 +0100)]
Improvements to the display of the source.
Fix bugs #6501 and #7359.
* Selection highlighting has been broken since a conflict with
reverse-search was repaired (at 00a62b7c), is now fixed.
* The selection highlighting was not accurate, for LaTeX formats (in
full source view), and meaningless, for non LaTeX formats.
* fix regression at cc00b9aa: force_getcontent_ was always true
therefore the code to detect changes in the generated source was
dead. The consequence is that the source view would jump to the
beginning at each updateView() even if no change occurred. Cc00b9aa
was meant to fix #5600, which I cannot reproduce with the new
implementation.
* Various improvements:
* When the position-to-line conversion is unavailable (LyXHTML, LyX
source, etc.) we focus on the first difference instead.
* Get some space around the cursor
* Respect the scrollbars
* Highlight with QTextEdit::ExtraSelections instead of cursor
selection (the latter used to break syntax highlighting of the
TeX code... which was not so much of an issue before because the
wrong part was selected)
Known issues:
* The highlighting is off by one line in very last paragraph of a
document. This appears to be a bug in TexRow.cpp.
* The highlighting is off for any kind of inset. This could be
solved by adapting TexRow so that it accepts CursorSlices as
and argument for the conversion to line number. (this is bug
#4725)
Improve the performance of the source panel by using a QTimer.
Fix bug #9493. The source panel was very slow with auto-update on. Now
we use a timer that ensures that the source is generated only at
rest. The delay is short or long depending on whether we show the
source of a paragraph or the whole source.
When using -std=c++11, the cygwin compiler automatically defines
__STRICT_ANSI__ which is used as a guard for not declaring essential
unix standard calls such as setenv, popen, etc. As a result,
compilation stops with errors such as "xxxx has not been declared".
By undefining the guard, compilation succeeds and lyx works Ok.
In order to adjust the path of an included file, when deciding
whether the document was moved or not, it is not sufficient
comparing the paths because the document could have been accessed
through a symbolic link.
Compiler that are known to support C++11 (gcc >= 4.3 and clang) are
now used in this mode by default. It is still possible to override
this choice using --(en|dis)able-cxx11.
Moreover, c++11 mode is detected from the compiler itself, not from
the use of --enable-cxx11. This allows to support compilers other
than gcc or clang.
Update INSTALL file accordingly and clean it a little bit.
Georg Baum [Fri, 4 Sep 2015 19:24:01 +0000 (21:24 +0200)]
Work around crash on command line export
This was a regression of 0c093a626472c7. The crash was found by the tex2lyx
test case test-insets.tex: Running lyx -f main -e pdflatex test-insets.lyx.lyx
did crash. This is not a real fix, but will do for now since previews are not
needed in command line mode (I wonder why they are generated at all?) In the
long term, we need theApp() to return a console application in commandline
mode to eliminate the existing sifferences between export from GUI and
commandline.
This replaces commit 329eae56 with a better solution. Indeed, while
__cpluplus is useless with g++ 4.[3-6] because its value is always 1,
these compilers define __GXX_EXPERIMENTAL_CXX0X__ when "-std c++0x" is used.
Therefore the code now relies on both macros to detect C++11 mode
instead of setting it when --enable-cxx11 is used.
Also, use pure c++ mode instead of gnu++ extensions on gcc
Günter Milde [Wed, 26 Aug 2015 22:04:19 +0000 (00:04 +0200)]
Remove problematic workaround for "exotic" problem
Greek and Times under MikTeX with auto-install may fail due to a half-installed
font package. However, the workaround in LyX stands in the way of
alternative approaches (see bug #6469).
Günter Milde [Thu, 13 Aug 2015 09:15:19 +0000 (11:15 +0200)]
New lfun "accent-perispomeni".
This function inserts a COMBINING GREEK PERISPOMENI character that is
normalized to pre-composed characters for base characters where a
corresponding WITH PERISPOMENI character exists.
When a row is too large due to a wide inset, it does not make sense to
break text before if the problem is the same in the next row.
Therefore give up breaking in this case.
Note that this was explicitely taken care of in the old-world
rowBreakPoint code.
Scott Kostyshak [Wed, 19 Aug 2015 01:55:59 +0000 (21:55 -0400)]
Refresh file cache before checking existence
This is done only inside LFUN_BUFFER_VIEW_CACHE so as to preserve
the benefits of caching in other places.
Without this commit, if a converter or a user (re)moves the preview
file and then calls buffer-view-cache LyX will launch the viewer for
a file that does not exist.
For a discussion and use case, see:
https://www.mail-archive.com/search?l=mid&q=55D393D7.6050403@lyx.org
Both \origin and \textclass tags may be paths and contain spaces.
In this case, enclose them in double quotes such that they can be
correctly read by the lexer.