Commit Graph

22963 Commits

Author SHA1 Message Date
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
Kornel Benko
f7a8c5b4eb \origin handling. Use realPath() intead of absFileName()
This change avoids misinterpreting paths containing symbolic parts.
Without this, lyx may not find its own sysdir.
2015-12-13 12:25:32 +01:00
Richard Heck
947aaf7a57 There does not appear to be any need to update the entire Buffer
after each entry into mathed. Instead, we just update the TOC for
anything the mathed happens to be inside.
2015-12-12 17:19:33 -05:00
Richard Heck
cf64064db7 Use the much faster forOutliner also to get the tooltip text. 2015-12-12 17:19:33 -05:00
Richard Heck
a5ea77410e Do not try even to hide buffers that are being processed by LyX.
Should fix #9711.
2015-12-12 13:00:20 -05:00
Richard Heck
394fc5cf15 Simplify logic. 2015-12-12 13:00:20 -05:00
Guillaume Munch
87861bc6d5 Use AMS align instead of eqnarray on newline-insert by default (#2543) 2015-12-11 19:28:32 +00:00
Jean-Marc Lasgouttes
9c43747cc9 Make text margin size dependent on zoom and dpi
The default hardcoded value of 10 corresponds to 2.5mm at 100dpi, but does not make much sense on a HiDpi screen.
2015-12-11 12:26:07 +01:00
Enrico Forestieri
b6880470b3 Fix bug #9898: inset info cannot show specified icon 2015-12-11 08:51:37 +01:00
Georg Baum
92573c9ddc Fix crash in info inset dialog apply (bug 9896)
posBackward() is the exact inverse of posForward(), not backwardPos().
2015-12-10 20:21:20 +01:00
Uwe Stöhr
219b5645c2 Inset files: add includes to compile with cxx11
see the list thread "Re: use FindCXX11Compiler.cmake also for MSVC"
2015-12-10 01:15:16 +01:00
Jean-Marc Lasgouttes
7dbd63e2b9 When counting hfills, make sure that they are active
The active/inactive status of hfills was not checked in numberOfHFills.

The code is reorganized a bit, but the important part is the change in the above function.

Part of bug #9870.
2015-12-09 17:16:00 +01:00
Peter Kümmel
8028110578 qtmain also needed for Qt5 on Windows 2015-12-09 16:45:15 +01:00
Jean-Marc Lasgouttes
f3cdf74e68 Remember the last used QTextLayout object
This crude caching mecanism is useful in the particular case of a screen with many misspelling dotted lines. In this case, it is necessary to build a QTextLayout in order to know where to put the start/end of the spell line. Since rows typically contains text snippets longer than a word, we may be in a situation where the same QTextLayout is constructed repeatedly.

This commit is useful in this particular use case, and should not be costly in other cases. A better fix would be to remember the QTextLayout associated to each row element. This is a bit more work, so this fix should be sufficient for now.

Additionally, do not paint misspelled marks when painting is disabled.

Fixes bug #9890.
2015-12-09 11:57:52 +01:00
Enrico Forestieri
db363ab19f Remove unneeded png images.
Fixes #9857.
2015-12-07 19:14:44 +01:00
Jean-Marc Lasgouttes
79bb97b1ba Detect properly when cursor position cannot be computed
Replace old ad-hoc test by a better one that inspects the coordcache to see whether all the insets in the cursor are known.

Fixes bug #9881.
2015-12-07 13:25:10 +01:00
Scott Kostyshak
acadb4d608 Fix a debug comment 2015-12-07 02:02:04 -05:00
Scott Kostyshak
6631e736bd Revert "InsetFootlike.cpp: disable listings inside footnotes"
Although af8ba5e0 fixed #9321, it broke a valid use case that was
reported by a user at #9785. Hopefully we can come up with a better
fix for #9321.

This reverts commit af8ba5e069.
2015-12-07 01:52:11 -05:00
Richard Heck
4d94460ce3 Add new ProvideStyle tag, which adds a new style only if it does not already
exist. This will allow for a proper fix for bug #8796, though that may or may
not get fixed before 2.2.0.

Also, change the InStyle tag to ModifyStyle, per a suggestion of Jurgen's.
2015-12-05 18:11:46 -05:00
Guillaume Munch
400703aff1 Convert remaining C++ files to UTF-8 2015-12-05 19:33:24 +00:00
Guillaume Munch
d9524321d7 Simplify Unicode symbols for old systems
(http://mid.gmane.org/565E17DD.7090008@clear.net.nz)

Fix the pilcrow and the cross in the outliner for Windows and old Ubuntus.

The thin space after the cross is based on aesthetics (in Ubuntu at least) after
trying both with and without a normal space. A thin space is already used for
display in BiblioInfo.cpp, so I presume it is safe.

Ideally, I prefer  (CROSS MARK), whose description fits the purpose, over ✖
(HEAVY MULTIPLICATION X), which looks too bold in the UI. Whereas ✕
(MULTIPLICATION X, successfully tested in Windows by Andrew) looks too dim. But
 (CROSS MARK) is next to  (NEGATIVE SQUARED CROSS MARK) so it might be as
problematic as the latter.

Do not output the cross on the author name in the toc of tracked changes.
2015-12-04 17:29:39 +00:00
Jean-Marc Lasgouttes
1546b91f27 Make spellchecker dotted underlines thicker. 2015-12-02 21:49:54 +01:00
Jean-Marc Lasgouttes
39e33d5138 Fix width of row when there are active hfills
It is important to make sure in computeRowMetrics that the row width
is correct at the end, because we rely on it in several places.

Fixes bug #9870.
2015-12-01 09:14:22 +01:00
Scott Kostyshak
d887b2a5dc Update previews when turned on in prefs (#9507)
Previews are now generated when previews are turned on in
preferences. This change ensures that when users activate previews
for the first time, they are not confused by no previews showing up
(a restart of LyX or a triggering of each individual preview would
be required).

There was a previously attempted fix for #9507 at 390ae054 which was
reverted at 358745d0 for performance reasons: it updated previews
after every preference change and updating previews is costly (even
if the cache signals there are no changes needed).

This implementation is consistent with what we do for updating the
system fonts in preferences.
2015-11-30 18:51:05 -05:00
Richard Heck
a8f57334e2 Fix bug #9096: Load all the files specified on the command line, and then dispatch whatever commands we are given to those Buffers.
Original patch due to Benjamin Piwowarski. Updated for 2.2 by Richard Heck.
2015-11-29 11:25:21 -05:00
Richard Heck
c01a533acc Whitespace. 2015-11-29 11:25:08 -05:00
Georg Baum
5c35ebcd24 Simplify logic
The old code was more complicated than needed, we have unstarred_name to make
our live easier. The test proves that the new code works as before.
2015-11-27 20:35:13 +01:00