Commit Graph

24752 Commits

Author SHA1 Message Date
Enrico Forestieri
48cd67ebf8 Fix LyX server on Windows
On some recent Windows versions, GetLastError() may also return
NO_ERROR instead of ERROR_IO_PENDING during an overlapped write
operation to a pipe. This was confusing the state machine in
Server.cpp so that replies to commands were scheduled but were
never actually output.

(cherry picked from commit cf5f2661dc)
2018-08-08 13:15:56 +02:00
Juergen Spitzmueller
7de98f7dbc Change size policy of buffer combo in refs dialog
Fixes: #9316
(cherry picked from commit b286c6d235)
2018-08-03 19:46:27 +02:00
Juergen Spitzmueller
d762d55558 Fix problem of unwanted spaces caused by macro definitions
Patch by Gilbert J. M. Forkel

Fixes: #11216
(cherry picked from commit 372712cfd9)
2018-07-31 08:49:50 +02:00
Juergen Spitzmueller
1d8ee1c704 (a)mend edb2d14124
(cherry picked from commit 0bf7b3211d)
2018-07-22 10:19:37 +02:00
Juergen Spitzmueller
7ec4fa149c Set RTL tooltips RTL
Fixes: #10672
(cherry picked from commit edb2d14124)
2018-07-22 10:18:27 +02:00
Juergen Spitzmueller
485f070887 Fix nesting problem with numbers in RTL text
\textcolor must precede any \beginL

Fixes: #6283
(cherry picked from commit 114ebf00c4)
2018-07-22 10:16:32 +02:00
Juergen Spitzmueller
cc845ed2cf Fix bracket output in RTL languages
This is a real mess!

Fixes: #11187
(cherry picked from commit 195f62ac93)
2018-07-21 10:40:59 +02:00
Juergen Spitzmueller
a17dfeee0e Fix quotation marks in RTL script
Fixes: #11188
(cherry picked from commit aa1d9638fe)
2018-07-21 10:27:38 +02:00
Juergen Spitzmueller
82cade4877 Use QMessageBox for toggleWarning if possible
Qt 5.2 introduces the possibility to place a checkbox on a QMessageBox,
so we need no longer to use our own crude dialog.

(cherry picked from commit 0148ef7e6c)
2018-07-11 19:11:28 +02:00
Juergen Spitzmueller
12ca81f2ea Fix creationCode() of GuiPrintNomencl
This fixes "New Inset" in that dialog.

Candidate for stable

(cherry picked from commit d2afa67da9)
2018-07-10 17:52:50 +02:00
Jean-Marc Lasgouttes
25e0ca1860 Do not force lfun argument to be pure ascii
Fixes bug #11167.

(cherry picked from commit 8e015f3cb2)
2018-07-04 11:46:03 +02:00
Jean-Marc Lasgouttes
5eb4a15579 Do not allow completion when there is an active selection
We do it in texted only, mathed is more difficult and not so relevant IMO.

(cherry picked from commit 789acb4a95)
2018-07-04 11:22:00 +02:00
Juergen Spitzmueller
ab450346b5 Handle correctly zero table special arguments.
Fixes: #10247
2018-06-27 08:16:59 +02:00
Enrico Forestieri
49c0021306 Fix bug #11174
Apparently, a new paragraph is started after a float even if
no blank line is actually present. So, account for this fact.

(cherry picked from commit f6922b8c88)
2018-06-17 23:37:39 +02:00
Jean-Marc Lasgouttes
567e94347a Skip paint event when in the middle of a buffer operation
This is detected when an undo group is open and contains at east one
element. This means indeed that changes are in progress. Note that the
group is in general opened in GuiApplication::dispatch. The code there
is changed to ensure that the group is closed before updating the
screen.

This patch is experimental. It is expected to be replaced in master by
a more complete solution. It could in the meantime be backported to 2.3.x.

Fixes bug #11159.

(cherry picked from commit c7496a11b2)
(cherry picked from commit 4d0c43f9aa)
2018-06-15 14:12:32 +02:00
Richard Kimberly Heck
8abea3b7e9 Try to fix bug #10989.
The problem is that popping dialogs during reload can cause paint
events for which we are not ready. If this does not work, then we
can introduce a new flag, besides 'busy', for that case. But busy
does not seem to be used very widely, so hopefully this works.

Note that when paintEvent is triggered on macOS, the least we can do
is to copy our backing store to the screen.

(cherry picked from commit 19e6977b5b)
(cherry picked from commit d03deeca0c)
2018-06-15 13:45:28 +02:00
Jean-Marc Lasgouttes
00ec2dd106 Unbreak completion in text mode
Completion uses a complicated async scheme based on timers to update
itself. This is probably not necessary anymore and is fragile to
event order changes.

This is what happens with the new painting scheme. Therefore the
asyncHideXXX() methods have to be made more robust and detect whether
completion state has changed by the time they are triggered.

(cherry picked from commit f1ea7fee5c)
2018-06-11 10:35:55 +02:00
Jean-Marc Lasgouttes
97fe69426d Draw frame last when drawing text insets
This avoid cases where the blinking cursor erases the frame.

(cherry picked from commit 4e9084b3e4)
(cherry picked from commit 6bcc7d6e42)
2018-06-11 10:24:05 +02:00
Enrico Forestieri
44466f305f Avoid duplicate generation of the same preview
When an image has to be loaded a second time and the cache
is not used or the image is not in the cache, its preview is
going to be regenerated again. Hence, if the same image
appears more than once on screen, avoid requesting simultaneous
generation of the same preview.
See also this thread:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg205057.html
2018-06-07 23:13:33 +02:00
Jean-Marc Lasgouttes
874ad18178 Set caret height correctly for cells inside math rows
The code in 90cfe4ec3 only handled the cells which metrics are
computed directly, and missed those who were linearized inside a MathRow.

To fix this, we use the fact that all the positions in a math row have
the same height and make MathRow::metrics return a boolean indicating
whether it contains a caret for a given bufferview.

Fixes bug #11153.

(cherry picked from commit a3868e40a4)
2018-05-24 17:28:49 +02:00
Jean-Marc Lasgouttes
1c8a53458a Reset dim width when computing MathRow metrics
This was dropped by mistake in 7bcb78a77.

Fixes bug #11152.

(cherry picked from commit c58b914c80)
2018-05-22 20:28:12 +02:00
Enrico Forestieri
87b44bcc1f Fix bug #11151
(cherry picked from commit 17ea71b31c)
2018-05-21 22:01:56 +02:00
Jean-Marc Lasgouttes
011d925da0 Removed unused private variable
Spotted by clang++ 6.

(cherry picked from commit c4075367fa)
2018-05-15 23:13:59 +02:00
Jean-Marc Lasgouttes
45fba1ce1b Avoid crash when trying to handle FitCursor
It is better to handle SinglePar before FitCursor, since the later
requires correct metrics at cursor position.

Fixes bug #11139 and probably #11125.

(cherry picked from commit 7f83d26934)
2018-05-14 00:10:45 +02:00
Juergen Spitzmueller
d35055de83 Fix InsetBox::contentAlignment()
Some cases where alignment is possible were missing.

Candidate for 2.3.x.

(cherry picked from commit de67b68b1d)
2018-05-11 18:44:17 +02:00
Jean-Marc Lasgouttes
4e981b034e Adapt caret height to context in mathed.
Compute a height from current font and current cell vertical
dimensions in MathData::metrics(), because this is where current font
is known.

Introduce BufferView::setCaretAscentDescent to remember this value.

This mechanism is not used for text because Cursor::current_font is
restored by undo, and the caret height would not be changed then. But
in principle it is doable.

(cherry picked from commit 90cfe4ec3b)
2018-05-10 12:53:30 +02:00
Jean-Marc Lasgouttes
0cba074ecf Better mechanism for setting cell height
When computing a cell metrics, it is now possible to specify whether it
is tight (at least as tall as 'x') or not (as tall as the max height of
the font).

Use this to make sure that grid insets have large enough cells. It
will probably appear that other cells needn't be tight. Currently, the
only cell which is known to be tight is the nucleus of the root inset.
Others should be examined one by one. It might be that the default of
MathData::metrics tight parameter should be `false'.

Fixes bug #11050.

(cherry picked from commit 7bcb78a778)
2018-05-10 12:48:56 +02:00
Jean-Marc Lasgouttes
f33d0789f6 Set a minimal height for math rows
The value used here is the x height. It would be nice to see what the
TeXbook really says.

This makes a big difference with \tilde{.}, for example.

(cherry picked from commit 6df8c42e59)
2018-05-10 12:47:57 +02:00
Scott Kostyshak
705302f6de Center longtable explicitly (#10690)
"Center" is the default of longtable, but some situations require it
to be centered explicitly, such as when using floatrow:

https://tex.stackexchange.com/questions/320592/floatrow-package-conflicting-with-centering-longtable

(cherry picked from commit bde1834f7e)
2018-05-08 17:42:43 -04:00
Richard Kimberly Heck
69ab4d17c8 Fix problem noted by Scott in bug #11125.
Need to set the Buffers for math insets, too.

(cherry picked from commit 81abfdc13d)
2018-05-08 02:12:19 -04:00
Richard Kimberly Heck
ffeac12a86 Fix problem with synchronous export.
It surprises me a bit that the code is different in this case
from the case when EXPORT_in_THREAD is not set. I should check
to see if there's a problem in the other case, too.

(cherry picked from commit 0fc50a2637)
2018-05-06 17:46:53 -04:00
Juergen Spitzmueller
36096435e5 Fixes for nested ulem commands
1. \uuline must be on top of \sout
2. \uwave in \xout needs a hack to compile

(cherry picked from commit 9fd94a2dd0)
2018-05-05 10:09:04 +02:00
Juergen Spitzmueller
63c54434ae PassThru paragraphs have latex_language; consider this when checking
previous language

Fixes: #10793.
(cherry picked from commit 15df033bce)
2018-05-01 06:56:45 +02:00
Richard Kimberly Heck
1221d00d7d Request buffer update rather than do it.
(cherry picked from commit 2777b51c58)
2018-04-30 22:32:52 -04:00
Scott Kostyshak
6a808d285c Fix duplicate, disabled "Separated Frame Below"
This commit fixes an issue where the menu option "Insert Separated
Frame Below" would show up twice, with one instance disabled. This
occurred when there was a "Standard" environment nested in a
"Frame". With this commit, the duplicate instance is removed.

(cherry picked from commit 4f7a5f8c3e)
2018-04-29 00:05:15 -04:00
Scott Kostyshak
9b821eb047 Initialize toolbarsMovable_
Valgrind detected a conditional jump because this member was not
initialized.

(cherry picked from commit e49a10729e)
2018-04-27 23:31:09 -04:00
Jean-Marc Lasgouttes
be62d98dcf Rework caret display code
The new code is much simpler: what it does is, after redrawing has
been done, to mark the cursor row as changed, so that it will be
repainted on next paint event.

This avoids some crashes at the price of possibly repainting the row
when it was not necessary.

(cherry picked from commit 2f1eb35b86)
2018-04-27 11:46:44 +02:00
Jean-Marc Lasgouttes
5c6bc52b1b Update cursor position after committing IM string
(cherry picked from commit 01fea56eb6)
2018-04-26 22:45:57 +02:00
Richard Kimberly Heck
69a72f5dec Restore implicit word selection for inset insertion.
Modifies 0662ffb9.

(cherry picked from commit aa2f409d87)
2018-04-25 21:53:54 -04:00
Richard Kimberly Heck
1101d85a3a Improve error message a bit more.
Sorry to Kornel, who had already updated sk.po!

(cherry picked from commit 821e101547)
2018-04-25 18:45:01 -04:00
Richard Kimberly Heck
e7387fd348 Don't sort the bibfiles cache.
This causes problems with biblatex. Instead, we sort the old and
new lists and then compare them.

(cherry picked from commit 6b095e2b71)
2018-04-25 13:45:17 -04:00
Richard Kimberly Heck
13354c4a53 Improve error message.
(cherry picked from commit 04f7151684)
2018-04-25 12:06:07 -04:00
Jean-Marc Lasgouttes
d0a11cb8e2 Redo metrics after cancelling macro mode
When the cursor is inside a subscript that may become empty, metrics
issues can happen. This patch fixes the issue, although it is not
clear to see what the problem is.

Still, requesting a metrics update also in the case where the macro
mode is canceled makes sense.

Fixes bug #11125.

(cherry picked from commit 68ec34e603)
2018-04-25 17:03:50 +02:00
Richard Kimberly Heck
4f0504d778 Add slightly improved error message. 2018-04-23 20:36:28 -04:00
Richard Heck
00522ecd3f Fix #8338.
The idea here is to force commands to be run syncrhonously when
they are launched via "command-sequence" or "repeat". We do this
by using a new flag in FuncRequest.

(cherry picked from commit 2477493cf5)
2018-04-20 23:48:50 -04:00
Richard Heck
7d0b7e0840 Fix for #10624.
If we're in the first paragraph after a division (section, etc),
use the prefix for it.

(cherry picked from commit dd2efe8d0d)
2018-04-20 23:29:36 -04:00
Richard Heck
0662ffb98e Fix #6344.
For some reason, special code was added for LFUN_INDEX_INSERT
when it was not actually needed. So just delete it.

(cherry picked from commit 83356ab9fe)
2018-04-20 23:16:02 -04:00
Richard Heck
7dcd1a7f4e Reset counters before we re-run updateBuffer when the bibfiles change.
Fixes a bug reported by Pavel here:
  https://marc.info/?l=lyx-devel&m=152407889727665&w=2

(cherry picked from commit 64acc06b91)
2018-04-20 23:01:23 -04:00
Richard Heck
12c196755b Fix bug #11118.
Adds LFUN_MASTER_BUFFER_EXPORT.

(cherry picked from commit c4c7053d1d)
2018-04-19 00:11:48 -04:00
Juergen Spitzmueller
9e52c7693e Add support for rotated longtabulars (via [pdf]lscape)
Fixes: #9194

See #9194 for why we use an earlier file format change here.

(cherry picked from commit feab528fd1)
2018-04-18 18:10:06 +02:00