Commit Graph

22989 Commits

Author SHA1 Message Date
Stephan Witt
faef2f93dd fix GIT - version control for LyX documents not detected 2016-01-17 08:03:57 +01:00
Enrico Forestieri
5c891242f3 Don't merge next paragraph when removing a separator inset 2016-01-16 16:44:26 +01:00
Enrico Forestieri
55b3374f3e Always place the cursor before a separator inset when clicking 2016-01-16 16:41:04 +01:00
Enrico Forestieri
1c3b6807db Insert a plain separator instead of a parbreak one.
When hitting Enter after a non-standard layout a plain separator is
now inserted. This seems to be preferred and more in line with what
is obtained with the "Alt+M P" shortcut.
2016-01-14 20:57:52 +01:00
Enrico Forestieri
a8ab3379d9 Insert a separator only when the paragraph is empty. 2016-01-13 22:49:33 +01:00
Guillaume Munch
467bc27aea Update tex2lyx tests
Just add \save_transient_properties as expected.
2016-01-12 21:25:34 +00:00
Guillaume Munch
5c2d049996 Add \save_transient_properties parameter (#9841)
Increment LyX format to 504.

With this new parameter, the user can indicate that some other parameters that
are frequently switched must not be recorded in the file (as if they were a
setting specific to the user or transient, rather than a document setting). This
will play nicer with version control systems.

See the discussion, e.g.:
http://thread.gmane.org/gmane.editors.lyx.devel/157824/focus=157993 (third
solution mentioned)

TODO:
* The interface remains to be set up. We cannot change this setting from LyX
  for now.
* If save_transient_properties is false, we should read the user setting as a
  per-user-per-document (session) setting (e.g. like the cursor position).
* Once the above is done, we can treat \justification the same way (but it would
  be even better if \justification was moved to lyxrc).
2016-01-12 21:25:34 +00:00
Guillaume Munch
f475795b92 Revert "Work around bug #9841"
This reverts commit dc016de34e.

See discussion at http://mid.gmane.org/n53ar8$1tj$1@ger.gmane.org
2016-01-12 21:25:34 +00:00
Guillaume Munch
b529a2ffe5 Amend fd4d23b4
http://mid.gmane.org/3790287.D9aVANvQPJ@linux-22mz
2016-01-12 21:25:34 +00:00
Jean-Marc Lasgouttes
626f8d4448 Fix compilation error with clang's libc++
The bug is probably fixed for clang 3.7.1 or 3.8.0
2016-01-11 11:18:20 +01:00
Enrico Forestieri
71ff50b753 Make sure the origin tag is properly terminated. 2016-01-10 23:17:59 +01:00
Georg Baum
d80fa17175 Do not apply \origin at existing files
The current behaviour of the \origin parameter replaces relative file names
with the absolute original names if a document has been moved even if the
files have been moved as well. This behaviour is annoying e.g. for editing the
LyX docs in a git checkout.

Now file names are only replaced if the referenced file sdo not exist.
2016-01-10 19:46:01 +01:00
Stephan Witt
7e72c1d0d3 Call lyx::next and lyx::prev explicitely. In case libc++ provides
std::next even when not in C++11 mode this is necessary. E.g. with
clang from Xcode7 on Mac OS X.
2016-01-10 18:06:15 +01:00
Stephan Witt
34cbec9074 remove unused minizip include; avoid putting zlib include dir before others, this causes use of external boost headers if they are at the same location 2016-01-10 18:06:15 +01:00
Enrico Forestieri
bbb5a1a28f Always place the cursor before a separator inset when moving up or down. 2016-01-10 00:08:10 +01:00
Enrico Forestieri
c8aaaff15a Avoid inserting multiple consecutive parbreak separators. 2016-01-10 00:05:24 +01:00
Günter Milde
3a70340a95 Use polyglossia also with DVI (LuaTeX).
Simplify the logic for language package selection and make it more consistent:

Use polyglossia with non-TeX fonts (system fonts/Unicode fonts) for all
export flavours (XeTeX, LuaTeX, DVI-LuaTeX), if the language package setting
is "auto" and there is no language not supported by Babel and no package
providing Babel.

This solves some Babel-related autotest cases and leads to some new failures
due to the polyglossia language nesting problem.
2016-01-08 22:52:28 +01:00
Georg Baum
f35ed0c168 Improve \AA and \aa tex2lyx import
The lib/unicodesymbols part is based on work by Günter Milde:

Both, \r{A} and \AA (rsp. \r{a} and \aa) are equivalent standard LICR macros
for Aring/aring  as well as the deprecated "angstrom sign" character (212B).

However, with \AA for 212B and \r{A} for 00C5, tex2lyx converts \AA to the
deprecated "angstrom sign" which is missing in many fonts including the
Unicode version of Latin Modern.

I added the normalize_c() calls so that tex2lyx prefers the precomposed forms
(these are better editable in LyX) and the deprecated flag.
2016-01-08 21:06:24 +01:00
Georg Baum
ac1cd1ad9a Add symbol tests for A WITH RING ABOVE
The conversion is not completely correct yet, but adding the test before the
fix has the advantage that the fix can easily be documented by changing the
test reference.
2016-01-06 22:34:12 +01:00
Peter Kümmel
936ec66124 fix merged build 2016-01-06 13:07:59 +01:00
Richard Heck
0407364392 Fix bug #9907: We get a crash if we first close a master buffer one of
whose children is also a child of another buffer, then try to close that
one.

The problem is that we do not check properly to make sure that the child
is not a child of some other buffer. Now we do.
2016-01-05 09:59:31 -05:00
Richard Heck
e8ffb0c97a Rewrite the BufferList::releaseChild method so that it only checks
whether a given child Buffer is also a child of some other parent.
Then do the releasing or resetting where this method is called.

There should be no change of behavior with this patch.
2016-01-05 09:59:31 -05:00
Jean-Marc Lasgouttes
01fc62b78e When moving cursor, always reset anchor
This applies to BufferView::moveToPosition, which is used for bookmarks and initial cursor position (on loading).

Fixes bug #9912.
2016-01-05 15:05:27 +01:00
Jean-Marc Lasgouttes
d3c0044617 Fix entering inset in visual cursor mode
Improve the test whether cursor has moved in Cursor::posVisLeft. The code for posVisRight had already been fixed for #5764 at 0730c923, but this replaces both tests by the proper == operator.

Fixes bug #9913.
2016-01-05 15:03:30 +01:00
Guillaume Munch
18918f1c1b Amend bb344452 2016-01-04 03:43:08 +00:00
Scott Kostyshak
752c67ada9 Do not initialize a var to a val that's never used
By initializing 'to' to a value, the code made it seem like that
value mattered. But the value is overwritten in getWord().

Further, now if 'to' is used before it is initialized, there might
be a useful compiler warning that could point to a bug.
2016-01-03 11:57:19 -05:00
Stephan Witt
f1a21f8250 #9889 slightly improved layout management to avoid too small popup window for advanced F&R 2015-12-28 10:36:25 +01:00
Jean-Marc Lasgouttes
30cf941cb3 Avoid swapping a cell with itself
Gcc STL debugging feature asserts when swapping an object with itself. This happens in some cases with math grids that have only one column.

A quick review of other uses of swap() in the code base did not reveal any other dubious case.

Fixes bug #9902.
2015-12-26 13:59:25 +01:00
Peter Kümmel
e1c893127f boost dir is used for out-of-source build detection 2015-12-20 14:00:04 +01:00
Peter Kümmel
3c3141dc23 3rdparty/boost: build with cmake 2015-12-20 13:41:00 +01:00
Guillaume Munch
fd4d23b448 Amend f441590c
Remove runtime warning "QMetaObject::connectSlotsByName: No matching signal for
on_copyPB_clicked()".
2015-12-19 23:54:42 +00:00
Georg Baum
5e3165e9cc Improve directory name juggling
The old code did not ensure that the path was only broken into parts at
directory separators. The new code ensures it.
2015-12-19 16:49:52 +01:00
Guillaume Munch
54a28ca2dc Hide OptSubmenus (#9717) (for real this time)
Amend 6cc69343 and d449e7e6. See the latter for the rationale behind this
change.
2015-12-17 23:48:47 +00:00
Guillaume Munch
6cc6934378 Hide OptSubmenus (#9717)
At d449e7e6 it has been decided that submenus are going to be displayed even if
all their items are disabled. Here we make an exception for OptSubmenus.

Example of submenu no longer shown: Insert > Insert Regexp
Example of submenu always shown: Edit > Math > Limit Type, Macro Definition
2015-12-17 21:54:41 +00:00
Guillaume Munch
dc016de34e Work around bug #9841
\output_changes is now output at a distance from \tracking_changes.

Since both parameters can be seen as per-user preferences, they can cause
undesirable merge conflicts, in a multi-author setting, were it treated as a
single block by the version control system, as was the case before this patch.
2015-12-17 20:40:54 +00:00
Guillaume Munch
2dfb5f80ce Limit the size of navigation menus for performance.
After d5a5fbb8, as indicated in the commit log, it remained to make sure that
the sub-menus of the navigation menu showing the TOCs are generated in a delayed
fashion, to avoid corner cases regarding performance when documents have very
lengthy tocs (e.g. in a document with 1000 sections it takes a few hundreds
milliseconds for the menu to be refreshed). But this idea actually requires
substantial changes to the way menus are computed, so it is not for now.

In the meanwhile, I reintroduce a max size for menus, after which it is cut
off. This differs from the one that I removed at d5a5fbb8 in two ways: 1) if
there are more items than the max size, then we still show something instead of
nothing, 2) we allow ourselves to rely on qt's scrollable menus and therefore
allow bigger menus than before the above commit. The philosophy is that it is
better to show something than nothing, that it's better to show a scrollable
menu than to cut the menu to fit the screen, and that beyond a certain size the
scrollable menu becomes useless anyways.
2015-12-17 20:38:04 +00:00
Jean-Marc Lasgouttes
91b385166d Do not use a static variable as QTextLayout cache
It is a bad idea to have a QObject variable that oulives the main QApplication object. See for example:
https://www.ics.com/designpatterns/book/globals.html

Here the QTextLayout object was static to the anonymous namespace getTextLayout function, and got destroyed after the freetype renderer had been disposed of by QApplication.

This causes segmentation faults when quitting LyX on some systems.

This patch moves the cache together with other GuiFontMetrics caches. It means that one will have one such QTextLayout per font type, but this will not change much.
2015-12-16 10:34:43 +01:00
Peter Kümmel
3bd2cfecf0 move 3rdparty dir out of src/ 2015-12-15 13:20:13 +01:00
Peter Kümmel
6cc83c5072 bundled iconv uses const 2015-12-15 13:20:11 +01:00
Peter Kümmel
584c3a6f7b build with msvc2013 2015-12-15 13:20:10 +01:00
Peter Kümmel
b46ea7fac0 integrate 3rdparty libs 2015-12-15 13:20:10 +01:00
Peter Kümmel
31b5da479d build zlib with cmake 2015-12-15 13:20:09 +01:00
Peter Kümmel
a34b5376c2 add stripped down zlib 1.2.8 2015-12-15 13:20:08 +01:00
Peter Kümmel
72540e8b87 build libiconv with cmake 2015-12-15 13:20:08 +01:00
Peter Kümmel
69be7ebfa2 add stripped down libiconv 1.4 2015-12-15 13:20:08 +01:00
Peter Kümmel
34c822cf65 build hunspell with cmake 2015-12-15 13:20:07 +01:00
Peter Kümmel
37b951c77a add stripped down hunspell 1.3.3 2015-12-15 13:20:06 +01:00
Stephan Witt
4fd4c31bb6 #9875 disable the modifier check for LFUN_SELF_INSERT on Mac 2015-12-15 01:24:31 +01:00
Stephan Witt
6bac894042 #9875 add checks for having a current_view_ before using it 2015-12-15 01:14:53 +01:00
Guillaume Munch
3c9b62a69d Layout format update: AddToToc, IsTocCaption, OutlinerName
Preliminary work for addressing #7790. Thanks to Richard for providing initial
files this is based on.

Adding to TextClass:
    OutlinerName <string> <string>
    (the second string is translated)
e.g.:
    OutlinerName thm "Definitions & Theorems"

Adding to Layout:
    AddToToc <string>     (default "", means no)
    IsTocCaption <bool>   (default 0)
e.g.:
    AddToToc thm
    IsTocCaption 1

Adding to InsetLayout:
    AddToToc <string>     (default "", means no)
    IsTocCaption <bool>   (default 0)
e.g.:
    AddToToc literate

Adding to inset arguments:
    IsTocCaption <bool>   (default 0)
2015-12-13 19:56:49 +00:00