Georg Baum [Sun, 21 Dec 2014 16:23:56 +0000 (17:23 +0100)]
Improve llvm libc++ detection
The old detection did only work if CFLAGS contained -std=c++11, since ciso646
was only included for __cplusplus > 199711.
Thanks to Koernel for the cmake part.
Georg Baum [Mon, 8 Dec 2014 21:25:40 +0000 (22:25 +0100)]
Make Encoding class thread-safe
Now all const methods may be called without additional locking.
This is assumed by the threaded LaTeX export, which always useses a globally
unique instance for each encoding.
Georg Baum [Sun, 7 Dec 2014 17:26:44 +0000 (18:26 +0100)]
Make Language and Encoding threadsafe
Read-only access to these classes is now threadsafe, with one exception:
The encoding neds to be already initialized (i.e. init() must not be called).
This makes bug 9336 unreproducable on my machine, although it is not completely
fixed yet.
Georg Baum [Sun, 7 Dec 2014 12:12:26 +0000 (13:12 +0100)]
Make trivstring class ready for use
The interface is now 100% unit tested, and the typedefs depend on the new
STD_STRING_USES_COW configuration variable. The only missing bit is to detect
clang and disable STD_STRING_USES_COW for clang.
Georg Baum [Sun, 7 Dec 2014 09:50:18 +0000 (10:50 +0100)]
First version of trivstring class (bug #9336)
As discused on the list. This is not used yet, but it is intended to provide
thread-safe read-access without the need for synchronization if the used STL
implementation does not provide it for std::basic_string. This is the case for
all implementations using copy-on-write.
Georg Baum [Wed, 3 Dec 2014 20:08:13 +0000 (21:08 +0100)]
Remove unneeded typedef
docstring is already defined in strfwd.h (which is included from docstring.h).
There are only two possible cases:
Either the typedef in docstring.h defines an identical type (then it is not
needed), or it defines a different type (then it generates a compilation error)
=> it is not needed.
Fix bug #9235: LyX 2.2's tex2lyx fails in general on Windows
The reason being the backslashes in the path. Note that escaping
does not work here because the path is being interpreted multiple
times (how many times I don't know) and that would be fragile.
For this same reason, the change is not limited to Windows.
Fix bug #9342: LaTeX build get stuck for unconventional path name
The reason being that the TEXINPUTS path list was not quoted on Windows.
This was no problem with spaces but some special characters are
interpreted by the shell and can cause problems. In this particular
case, the '&' character was being interpreted as a command separator.
Georg Baum [Wed, 26 Nov 2014 21:06:15 +0000 (22:06 +0100)]
Better fix for bug #8679
Thanks to Enrico, who noticed that the previous fix did not take into account
the case of nonempty length argument + the next line beginning with [.
Now the parsing is exactly the inverse of InsetMathGrid::eolString().
Let the Foot inset have a different Layout when inside a title
This allows to address two main issues
* \thanks does only accept one paragraph, while \footnote allows several (ticket #2666)
* footnotes in titling environments were not numbered on screen.
Moreover, the code reduces hardcoding of features, which is always a good thing.
There are several pieces in this commit:
* new numbering type \fnsymbol for counters
* the Foot inset changes its layoutName() to Foot:InTitle when inside a paragraph with InTitle property. This is set when running updateBuffer.
* Foot:intitle uses the \thanks command, does not allow multiple paragraphs and marks its contents as moving argument.
* The InsetLayouts for Foot now have properLaTeXName/Type, so that InsetFoot::latex can be removed; further code simplification is probably possible.
Georg Baum [Thu, 20 Nov 2014 21:05:05 +0000 (22:05 +0100)]
Fix unwanted curly braces in formula (bug #8679)
There was an unsymmetry between reading and writing: InsetMathGrid::eolString()
adds curly braces if the first cell of the next line starts with [ to prevent
misparsing as optional argument of \\. These braces were not removed on reading.
Scott Kostyshak [Tue, 18 Nov 2014 01:14:22 +0000 (20:14 -0500)]
C-a is now bound to inset-select-all
C-M-a is bound to the global "select all". The
reason for this change is that selecting an inset
is a more common operation that selecting an entire
document.
Georg Baum [Wed, 19 Nov 2014 21:47:36 +0000 (22:47 +0100)]
Fix viewer file paths on windows (bug #8892)
Some applications do not accept forward slashes, so call external viewers
and editors with backward slashes which is the usual convention under windows.
Georg Baum [Tue, 18 Nov 2014 19:51:21 +0000 (20:51 +0100)]
Make document_language non-mutable
The many occurances of the mutable keyword in LyX sources make it quite
difficult to understand what is really const and what not, and to debug
multithreading memory problems. In this particular case it is not needed
at all to have a mutable member, so make it non-mutable.
Scott Kostyshak [Thu, 13 Nov 2014 01:31:38 +0000 (20:31 -0500)]
Do nothing if converting to the same type of Note
The advantage is that the buffer will no longer be
marked as dirty when converting to the same type.
A quick break here is done instead of disabling the
LFUN because disabling the LFUN would lead to a greyed out
entry, which might confuse users. In the future, we might
want to have a radio button for switching between notes.
Georg Baum [Mon, 17 Nov 2014 21:08:21 +0000 (22:08 +0100)]
Fix memory error detected by valgrind
The assignment name = sub.str(1) reads from the first argument given to
regex_match(), but previously this was a temporary object which was already
out of scope. This did probably not matter much in practice, but invoked
undefined behaviour, and as we all know this is allowed ton format your hard
disk or kill to your cat, so better fix this.
Georg Baum [Sun, 16 Nov 2014 19:51:42 +0000 (20:51 +0100)]
Make doExport() helper private
One declaration of doExport() was not used, and the other one was only used by
Buffer, so make it private since returning the exported file name is a bit
strange if it can also appear as input argument.
Georg Baum [Sun, 16 Nov 2014 11:43:52 +0000 (12:43 +0100)]
Convert updatelayouts.sh to python
This makes the script usable on windows and speeds it up by an order of
magnitude, since no new process needs to be forked for each layout file.
It also does not conevrt .old files again.
Georg Baum [Fri, 14 Nov 2014 20:30:42 +0000 (21:30 +0100)]
Fix recursive math macro crash (bug #9140)
This is different from bug #8999, since in this case a new macro instance is
created. You still get a TeX capacity exceeded error if you try to typeset the
exported document, but this is the same as for bug #8999 and better than a
crash.
Georg Baum [Fri, 14 Nov 2014 19:20:35 +0000 (20:20 +0100)]
Load footmisc.sty instead of using outdated code
This is a patch I originally sent to lyx-devel in 2012 with subject
'Load footmisc.sty instead of using copied code from obsolete stblftnt.sty'.
It now takes all comments into account: It works also if the user loads the
package herself, it can be disabled by providing the footmisc feature in a
layout, and it does not use the ugly \AtBeginDocument{}.
The symptoms are the same as the original #9224, but the reason is different. In the new code, the width of justified rows includes the Row::separator value. Therefore the CRC computed in ParagrahMetrics::computeRowSignature is not updated in some cases.
The fix is to add Row::separator as one of the elements of the row crc.