Commit Graph

29248 Commits

Author SHA1 Message Date
Enrico Forestieri
039de52ad9 Amend 58103cf2
The \underbar macro is a text mode macro that can also be used
in math mode. However, when inserting it in mathed, LyX helpfully
wraps it in a \text inset. One can dissolve such text inset and
the macro would appear in math mode without any problem. But the
output routine thinks that the user is shooting itself in the
foot and tries to protect him by wrapping \underbar in the
\lyxmathsym macro, whose definition is normally added to the
preamble when an unicode character is used in math mode.

Of course, this is not the case for \underbar and a compile
error arises. The easier solution is to simply add lyxmathsym as
a requirement for \underbar in lib/symbols, but this means
that the definition of \lyxmathsym would be added even when not
necessary (because in the validation routine we miss the info
about the current mode). The correct solution is acknowledging
the dual nature of \underbar as a text-mode macro that can also
be used in math mode. Luckily the correct solution is almost as
easy as the easier one and is what is done in this commit.
2023-11-09 00:21:21 +01:00
Yuriy Skalko
53784b90ae Better dialog resizing behavior 2023-11-09 00:15:16 +01:00
Pavel Sanda
6d19388ab8 Fix mangling names in temp directory (amends eef0c8e8).
Separate mangled-name tables for xhtml and latex exports.

LaTeX route should stay as it were (counter+mangled path within filenames in
temp directory)

xHTML route uses hash of path + filename only. We won't use counters because
(unlike in LaTeX export) they stay visible in final export directory and
generally change across LyX sessions.
Hash is short with collision handling because path-length limits of Windows.

cf https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg220582.html
2023-11-08 21:42:54 +01:00
Juergen Spitzmueller
f74cc0ec92 Limit nomencl backwards support to case when old package is really used
This is only needed for very old versions of the nomencl package
(before March 2005)

No need to output compatibility code with newer versions

Furthermore, this breaks the use of the glossary package which also
has .glo extension (#12968)
2023-11-08 16:17:58 +01:00
Enrico Forestieri
bdaad03a45 Do not accumulate underline changes
If an element is underlined in mathed by using the text properties
dialog, the changes accumulate. So, for example, to change a single
underline to a double one, one would need removing the previous
underline first. This commit allows using the text properties
dialog and simply replace an underline type with another one.

However, this works only if the underlined element is not included
in some other inset. For example, given "\uline{\text{abc}}",
selecting the 'b' and choosing a double underline produces
"\uline{\text{a\uuline{b}c}}". But, given "\text{\uline{abc}}", and
operating as before produces "\text{\uline{a}\uuline{b}\uline{c}}".
2023-11-08 09:17:38 +01:00
Enrico Forestieri
ea30f1feb1 Amend 58103cf2
Give a variable a more meaningful name and fix a typo.
2023-11-08 08:56:40 +01:00
Jean-Marc Lasgouttes
9c3d9cded0 Update math macro display when entering from above/balow
This change forces metrics computation in all cases when cursor enters
a math inset from above/below, but I do not have a better idea right now.

Fixes bug #12952.
2023-11-07 15:46:04 +01:00
Enrico Forestieri
f8f2355445 Silence compiler warning 2023-11-06 21:03:23 +01:00
Enrico Forestieri
9d95147528 Amend 58103cf2
Correct file name.
2023-11-06 18:46:22 +01:00
Enrico Forestieri
58103cf214 Allow using the text properties dialog in mathed
Until now only the color of the text could be changed by using
the text properties dialog. This commit allows changing all
other properties except for strikethrough. It is possible to
also add underlining with the limitation that the changes
accumulate. This requires other work but I think that underlining
and strikethrough are not so important in mathed and can be
refined at a later time.

Fixes #12958
2023-11-06 18:04:44 +01:00
Juergen Spitzmueller
d2db3d4578 escape spaces in labels
refstyle doesn't work with these. See
https://marc.info/?l=lyx-users&m=169926958114185&w=2
2023-11-06 14:18:03 +01:00
Jean-Marc Lasgouttes
04a24211a6 Fix word selection expansion when going to the left
The proper way to do word-wise selection is to compute the words
around both the cursor and the anchor.

Note that code is uglier than it should because CursorData::normalAnchor()
returns a CursorSlice instead of a DocIterator.

Fixes bug #12533.
2023-11-06 11:53:03 +01:00
Juergen Spitzmueller
27033f41aa Fix comment 2023-11-05 12:38:09 +01:00
Juergen Spitzmueller
098b4f3348 Amend ec2da3a509 2023-11-05 12:28:27 +01:00
Juergen Spitzmueller
ec2da3a509 Prevent data loss when closing LyX while document dialog has unapplied changes (#12955)
Entails new strings, but I think the severity allows for that.
2023-11-05 12:09:33 +01:00
Enrico Forestieri
75a08df529 Inherit outer font in text-in-math environments
Some text-in-math environments such as \text, \mbox, \fbox, and
\makebox, inherit the outer text font. This commit reflects this
in the on-screen representation.

Fixes #12950.
2023-11-02 17:54:02 +01:00
Juergen Spitzmueller
5d193c7b62 Revert "Show full inset context-menu when clicking on text part of collapsible (#10370)"
This reverts commit 6c4afc1ccb.

This needs more thinking to get the menus sane.
2023-11-02 10:17:06 +01:00
Enrico Forestieri
e0e1350b7e Revert "Inherit outer font in text-in-math environments"
This reverts commit d72b9b0238.

Unfortunately, the font taken into account is the font at the
current cursor position rather than the font of the corresponding
math inset.
2023-11-02 01:59:54 +01:00
Enrico Forestieri
d72b9b0238 Inherit outer font in text-in-math environments
The text-in-math environments such as \text, \mbox, \fbox, \makebox
and so on, inherit the outer text font. This commit reflects this
in the on-screen representation.

Fixes #12950.
2023-11-01 22:21:49 +01:00
Juergen Spitzmueller
07c99393be Consider PackageOptions with parskip 2023-10-30 12:54:29 +01:00
Juergen Spitzmueller
6c5dc39cd5 Amend 9de9ec1e88
When setting halfline parskip with parskip provided, we still need
to set this explicitly, as we don't know the current \parskip value.

Also improve code readability.
2023-10-30 12:17:14 +01:00
Juergen Spitzmueller
9de9ec1e88 Do not add empty \parskip definition (reported in #12946) 2023-10-30 09:22:14 +01:00
Pavel Sanda
28f81d1be5 Revert "MathML: don't output delimiters in InsetMathBinom and InsetMathDelim if the delimiter is a space."
This reverts commit be44cb8516, see #12891.
2023-10-27 21:18:45 +02:00
Juergen Spitzmueller
e9998fb1cc Enter table after insertion (#12101)
posForward() jumped over the inset, which is not what is wanted here,
I think (cf. other inset insertion methods)
2023-10-22 10:19:50 +02:00
Juergen Spitzmueller
8e619462e1 Disable OUTLINE functions when min or max toclevel is reached 2023-10-21 13:49:50 +02:00
Juergen Spitzmueller
2b33da5944 Let OUTLINE functions jump from section to part if there is no chapter
Fixes #12938
2023-10-21 13:48:50 +02:00
Juergen Spitzmueller
bf0152185b Make string translatable 2023-10-21 12:52:49 +02:00
Juergen Spitzmueller
4658cf95f7 Disambiguate "Language"
Some translations need a different term for programming languages.
2023-10-21 12:34:47 +02:00
Juergen Spitzmueller
906f2b8507 Fix tautology spotted by coverity
The if and else paths have been identical since the removal of dvipost
(a450797b2a)
2023-10-20 09:53:38 +02:00
Juergen Spitzmueller
33da28e5a5 Fix coverity-detected issue CID 403672
Error handling issues  (CHECKED_RETURN)
Calling "translateString" without checking return value
(as is done elsewhere 15 out of 18 times).

AFAICS we do not need the boolean return value in these two cases.
2023-10-20 09:35:55 +02:00
Jean-Marc Lasgouttes
99ecdd6ceb Fixup 65cb9fa4: avoid extra spacing when selecting math
This was happening whenever a selection started/ended after a fraction
inset.
2023-10-18 12:30:55 +02:00
Juergen Spitzmueller
72e242267b Only apply ui_style if it has changed 2023-10-15 11:20:49 +02:00
Juergen Spitzmueller
81fda3ac55 Warn user that uistyle reset to default requires restart 2023-10-15 11:02:45 +02:00
Juergen Spitzmueller
cfcc57bd89 Simplify 2023-10-15 11:02:35 +02:00
Juergen Spitzmueller
462a701e62 Make new gui element translatable 2023-10-15 09:40:58 +02:00
Juergen Spitzmueller
41e3f1ec98 complement tooltip 2023-10-15 09:17:31 +02:00
Eugene Chornyi
d2132751a7 Implement ui style selection dialog 12832 attempt 2 2023-10-15 08:46:12 +02:00
Daniel Ramoeller
5a9ea580e4 Correctly update Outliner icon size
Fix for #12453
2023-10-14 12:48:09 +02:00
Jean-Marc Lasgouttes
ff7696f184 Do not use Color_selectionmath when selection is gone
It might happen that the selection goes away without recomputing
metrics (for example with char-forward). The added test is a bit of a
band-aid for this situation. A better solution would be to understand
better when metrics computation is triggered in mathed.
2023-10-12 11:30:47 +02:00
Jean-Marc Lasgouttes
174dc2c8be Use Color_selectionmath as needed for multi-cell selection in math
This is complementary to partial selection implemented at 65cb9fa4.
2023-10-12 11:30:47 +02:00
Eugene Chornyi
a99a16ae58 Revert 072ba7bd and f1deb1c6 2023-10-11 23:22:17 +02:00
Eugene Chornyi
f1deb1c658 amend 072ba7bd 2023-10-11 22:03:29 +02:00
Pavel Sanda
c9c5a2a9d8 Add space padding around word count forgotten part of (#12625).
Again from Daniel.
2023-10-11 21:07:12 +02:00
Pavel Sanda
5ed59b3c09 Remove ugly frame around word count (#12625).
Requested and tested by Daniel.
2023-10-11 21:01:56 +02:00
Thibaut Cuvelier
be44cb8516 MathML: don't output delimiters in InsetMathBinom and InsetMathDelim if the delimiter is a space. 2023-10-11 20:37:38 +02:00
Eugene Chornyi
072ba7bd2e Implement ui style selection dialog 12832 2023-10-11 20:06:52 +02:00
Scott Kostyshak
1273f25c76 Fix three sign-compare compiler warning
Fixes three similar warnings. One of them is the following:

src/insets/InsetInfo.cpp:1583:20: error: comparison of integers of different signs: 'int' and 'std::basic_string<wchar_t>::size_type' (aka 'unsigned long') [-Werror,-Wsign-compare]
        for (int i = 0; i < sequence.length(); ++i) {
                        ~ ^ ~~~~~~~~~~~~~~~~~
2023-10-10 10:13:37 -04:00
Thibaut Cuvelier
531a37baee XHTML: implement InsetInfo. 2023-10-10 09:57:17 -04:00
Thibaut Cuvelier
d8a0f1aadd DocBook: fix a crash in docbookSimpleAllParagraphs.
When having the code preview pane open with examples/Language_Support/Mixing_Japanese_with_other_Languages_(with_CJKutf8), clicking at random on paragraphs sometimes yielded a crash: *par when par is the end of the iterator. LyX could output the whole document as DocBook without this patch and still generates the same output with it (i.e. no text is missing).
2023-10-10 09:57:17 -04:00
Thibaut Cuvelier
43921861b9 DocBook: in InsetInfo, ensure that no db:date is inserted within a db:date. 2023-10-10 09:57:17 -04:00
Thibaut Cuvelier
78b157b61e DocBook: fix closing formatting after deleted text.
Previously, when closing font tags, only the previous character's font was used. However, if that character is deleted, it had no change of having the right font tags opened/closed. Hence, look further to compare the font of the current character to output with the font of the previously output character.
2023-10-10 09:57:17 -04:00
Thibaut Cuvelier
b9fc4bae44 DocBook: fix formatting of TODOs.
The lines were very long; this commit truncates them to 120 characters.
2023-10-10 09:57:17 -04:00
Thibaut Cuvelier
0c2f3dedd6 DocBook: add support for InsetInfo.
A similar patch would be required for LyXHTML, but it will come later. The main impact is that some text isn't output in XHTML (like DocBook before this patch).

The code isn't as clean as it could be. I avoided touching anything not related to DocBook, as the release of 2.4 is nearing, while leaving comments for parts to improve for the next release cycle. Given that the code compiles, there are no risks for TeX or XHTML outputs; for DocBook, less content is skipped, which is a net improvement for users.
2023-10-10 09:57:17 -04:00
Pavel Sanda
cc257b4927 Few string fixes from Dan. 2023-10-09 20:41:57 +02:00
Juergen Spitzmueller
90307cf212 Amend 3f0bb8aa43
Account for the paragraph marker
2023-10-04 13:49:34 +02:00
Juergen Spitzmueller
3f0bb8aa43 Fix assertion on paste with empty pars 2023-10-04 13:40:38 +02:00
Juergen Spitzmueller
5cb53606b6 Introduce color_selectionmath
To have a distinctive color for selected math which works in both modes

Also, link color_selectionmath with QPalette::HighlightedText, so we
won't need to special-case on lyxrc.use_system_colors any longer
2023-10-04 13:10:07 +02:00
Jean-Marc Lasgouttes
65cb9fa4df Use Color_selectiontext as needed for partial selection in math
Currently, selected math hull insets use Color_selectiontext when
system colors are in use. This commit implements the same behavior
for partial selection.

This is done by introducing two element types (BEGIN_SEL and END_SEL)
to MathRow.
2023-10-03 12:51:11 +02:00
Juergen Spitzmueller
2b69dc54da Revert the logic of 343a9749ab
It might be better to be explicit also with black, after all.
2023-10-01 12:20:40 +02:00
Juergen Spitzmueller
242381464b Simplify 2023-10-01 11:38:10 +02:00
Juergen Spitzmueller
6df25c3585 When box background is "none", frame color != black and page color has been set
then use the page color as box background, not white
2023-10-01 11:08:11 +02:00
Juergen Spitzmueller
343a9749ab No need to use \fcolorbox with explicit black frame and no background
White background, however, is always treated explicit (think non-white
page background)
2023-10-01 10:12:52 +02:00
Juergen Spitzmueller
2854355fe3 Require xcolor whenever we use an \fcolorbox 2023-10-01 09:35:53 +02:00
Juergen Spitzmueller
3e063daeab Revert "Amend 087f6bce"
This reverts commit a6882a1db0.
2023-10-01 09:26:26 +02:00
Scott Kostyshak
a6882a1db0 Amend 087f6bce
Explanation from Udi:

  There is a missing validation for the requirement of xcolor in
  InsetBox::validate, the case we use Boxed with non-default color.

Patch from Udi.
2023-09-30 20:22:59 -04:00
Scott Kostyshak
10403b7959 Amend 04bfbc0f
Patch from Udi.
2023-09-30 20:20:03 -04:00
Udi-Fogiel
48eda746da proper unicode support for hebrew in 8bit engines 2023-09-30 17:09:41 +02:00
Juergen Spitzmueller
04bfbc0f7a Limit RTL hack to classic engines (#12919)
It breaks with LuaTeX, is definitely not needed with XeTeX, and it is
doubted whether it is needed at all (but this needs further testing).
2023-09-30 17:00:51 +02:00
Juergen Spitzmueller
8b1f1c29ff Style 2023-09-30 13:58:57 +02:00
Udi Fogiel
7ccdc6edf5 fix nested uwave 2023-09-30 13:44:03 +02:00
Juergen Spitzmueller
fc9684a130 Prevent access to null local_font 2023-09-30 13:01:20 +02:00
Juergen Spitzmueller
1d00389bf8 Update tex2lyx tests after recent format change 2023-09-30 09:59:36 +02:00
Juergen Spitzmueller
087f6bce71 Introduce default box frame color (#12921)
This better aligns with dark mode
2023-09-30 09:56:27 +02:00
Juergen Spitzmueller
7aa00f0b92 Fix quote menu item, from Dan
Current language is relevant here, not main language
2023-09-29 13:09:20 +02:00
Pavel Sanda
6141b437b1 pdfcolmk is an empty stub for many years now (bug #12920).
Patch from Udi.
2023-09-28 00:36:35 +02:00
Scott Kostyshak
ff9dfa96f2 DocBook: fix case with emphasis at end of footnote
For ML discussion, see here:

  https://www.mail-archive.com/search?l=mid&q=CAK0LPyiusCMu-X7KpgO0d1-rh4e3%3DRwR5ooXE_fdb7UVuB0VUA%40mail.gmail.com

Patch from Thibaut Cuvelier.
2023-09-25 10:41:21 -04:00
Jean-Marc Lasgouttes
549969a563 Improve comments 2023-09-25 12:51:33 +02:00
Jean-Marc Lasgouttes
71d9f6e90d Avoid row breaking at inconvenient places.
When it turns out that breaking a STRING row element was not
sufficient in Row::shortenIfNeeded, we still remember the shortest
width that one can obtain. Later, when we try to split a previous
element of the row, we have a better idea of how much of the row
remains after it.

To this end, change the signature of Element::splitAt to use an enum:
FIT (was: force=false), FORCE (was: force= true) and BEST_EFFORT
(split at max_width, but do not return an error if the string is too
large).

Fixes bug #12660.
2023-09-25 12:46:54 +02:00
Jean-Marc Lasgouttes
1ca43e1938 Revert "Avoid row breaking at inconvenient places."
The solution did create new issues.

Fixes bug #12899.
Unfixes bug #12660.

This reverts commit f7de345f85.
2023-09-25 12:28:51 +02:00
Jean-Marc Lasgouttes
9156712895 Make sure that caret width is not null in mathed
The same test exists in texted.

Fixes bug #12904.
2023-09-24 13:07:55 +02:00
Enrico Forestieri
ddf81b4e19 Amend 12e3d46b
Also account for alerts regarding documents that are explicitly
allowed to execute external commands through the settings.
2023-09-23 16:18:28 +02:00
Enrico Forestieri
12e3d46b5b Do not change font in html text without gui
As reported here:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg220399.html
if an alert is displayed when the gui is not available Qt6 crashes
when the text contains html directives and the font is changed.
2023-09-23 13:48:01 +02:00
Jean-Marc Lasgouttes
94c6d45b74 When drawing macro names, enforce LtR direction
Add a Direction parameter to the Painter::text methods that take a
FontInfo parameter.

In drawStrRed and drawStrBlack, force the direction to LtR.

Fixes bug #12905.
2023-09-22 12:41:44 +02:00
Juergen Spitzmueller
cd5a88029c Remove unneeded method
which is also not available in Qt < 5.13, as it turns out.
2023-09-18 11:36:16 +02:00
Juergen Spitzmueller
b13685d9bb Prefer following, not previous, item in selection manager after deletion (#12871) 2023-09-18 10:02:34 +02:00
Juergen Spitzmueller
d3102380bc Amend ac275a66b5
Set depth correctly in the active branch
2023-09-18 09:27:38 +02:00
Juergen Spitzmueller
63b99beedd Bit refactoring 2023-09-18 08:13:23 +02:00
Juergen Spitzmueller
ac275a66b5 Get rid of unnecessary flickering when clicking in outliner
No need to collapse and re-expand the node where the currently selected
item is in.
2023-09-17 19:17:12 +02:00
Juergen Spitzmueller
610e2f501b Fix double-click expansion of outliner 2023-09-17 16:45:19 +02:00
Juergen Spitzmueller
013d52ed2b Fix readability
here, "custom" was exactly the opposite (non-custom, i.e., default
margins)
2023-09-17 14:31:36 +02:00
Juergen Spitzmueller
d99a13da18 Amend c8d4b99559 2023-09-17 14:17:05 +02:00
Juergen Spitzmueller
d9af7a0fff Fix change tracking glitch (#12912) 2023-09-16 13:31:00 +02:00
Juergen Spitzmueller
c8d4b99559 Fix display of disabled page margins (#12887)
while preserving input values on geometry toggle
2023-09-16 11:00:10 +02:00
Juergen Spitzmueller
e08bbc89bc Fix brokenBiblio() and fixBiblio() with change tracking (#12909) 2023-09-16 08:34:43 +02:00
Juergen Spitzmueller
1812c946fc Fix nomencl launching
The problem here was that we checked depfile changes too late.
After all these subsequent LaTeX runs, the files's checksums
did not change any longer.
2023-09-15 18:08:10 +02:00
Daniel Ramoeller
ceb1a4c393 Only split view rather than split and move
Fix for #12893
2023-09-15 14:05:33 +02:00
Jean-Marc Lasgouttes
68ba1b57b4 Rename shortenIfNeeded first parameter to `max_width'
The short name `w' was not meaningful.
2023-09-15 14:05:33 +02:00
Juergen Spitzmueller
ed9e7d41f5 Do not paste deleted text with CT on (#12900) 2023-09-14 19:26:20 +02:00
Juergen Spitzmueller
91186013ba Fix result of deleteSpaces()
With change tracking on, spaces that are marked as ADDED are really
removed (and not marked deleted) if the changeAuthor is the current
author; see Paragraph::eraseChar().

The function tried to account for that but had the logic upside down.

Consequently actually deleted spaces haven't been counted and the
result was off.

This fixes an assertion when pasting in CT parts with deleted stuff
(#12901)
2023-09-13 13:50:40 +02:00
Juergen Spitzmueller
81dc79e6d6 whitespace 2023-09-13 13:21:37 +02:00
Juergen Spitzmueller
43ddd3b037 Fix indentation 2023-09-12 16:39:23 +02:00
Juergen Spitzmueller
be1bf5c05c Fix nullpointer (#12898)
Also, quit method early if file does not exist
2023-09-10 14:47:59 +02:00
Juergen Spitzmueller
ea55ca5e84 Handle bibtex location field syntax file1;file2
This is used, for instance, by zotero with the "betterbibtex" exporter

See #12896
2023-09-09 13:00:36 +02:00
Juergen Spitzmueller
ac59b04922 Only create a new view for lyxfiles-open if no view is open (#12894) 2023-09-08 17:47:47 +02:00
Juergen Spitzmueller
90e05de396 Revert "No need (any longer?) to create a new view for lyxfiles-open"
This reverts commit 9f238ca201.
2023-09-08 16:37:06 +02:00
Juergen Spitzmueller
9f238ca201 No need (any longer?) to create a new view for lyxfiles-open 2023-09-08 16:16:01 +02:00
Juergen Spitzmueller
117e259f0a Handle multiple files in file and localfile BibTeX field (#12896) 2023-09-08 14:02:23 +02:00
Daniel Ramoeller
3318febd0c Improve Open External Target dialog text
Fix for #12897
2023-09-08 10:39:45 +02:00
Daniel Ramoeller
fdcb160ed8 Fix bug #11497 2023-09-06 22:52:42 -04:00
Juergen Spitzmueller
5840806a4c Update tex2lyx tests 2023-09-06 08:42:22 +02:00
Juergen Spitzmueller
87620d7349 Add forgotten file formatted change (from 2ad57dcb6b)
This means that lyx2lyx reversion in beta5 is essentially broken
as it ends in a document containing an unknown header
2023-09-06 08:37:43 +02:00
Pavel Sanda
7980523448 Typo fix from Jose 2023-09-05 20:48:34 +02:00
Jean-Marc Lasgouttes
100e759f17 When splitting a bufferview, keep the scrollbar position
This is actually better thean making sure that the cursor is visible.

Fixes bug #12689.
2023-09-05 14:33:18 +02:00
Juergen Spitzmueller
375bb32a3d More style polishing 2023-09-05 12:07:05 +02:00
Juergen Spitzmueller
6bb72cc28c With Qt6 on linux, we need to catch StyleChange here 2023-09-05 12:01:17 +02:00
Juergen Spitzmueller
7c8c3657fd Also change pdf module highlighting on the fly on mode change 2023-09-05 11:48:53 +02:00
Juergen Spitzmueller
51fd28ed4d Update highlighting colors in runtime (dark/light) mode change
Until now, this required a restart.
2023-09-05 11:14:59 +02:00
Juergen Spitzmueller
32f89cbbf5 Style only 2023-09-05 11:13:58 +02:00
Pavel Sanda
625c61f1d5 Output python version in About dialog.
Patch from Jose.
2023-09-04 21:50:51 +02:00
Jean-Marc Lasgouttes
0c6101b0cb Put comment where it belongs 2023-09-04 11:07:34 +02:00
Juergen Spitzmueller
b11164524d GuiLyXFiles: make sure language selector is disabled when dialog is reopened 2023-09-04 07:58:59 +02:00
Juergen Spitzmueller
4393382f02 GuiLyXFiles: fix button controller handling 2023-09-03 15:09:13 +02:00
Enrico Forestieri
1cbcb30353 Fix assertion when canceling file dialog
Without this patch, when a file has to be loaded (for example,
after "Document->Settings->Local Class" or "Insert->Graphics")
and the file dialog is canceled, both Qt5 and Qt6 assert:
ASSERT failure in QList::at: "index out of range"
2023-09-02 18:15:09 +02:00
Jean-Marc Lasgouttes
7eecab5902 Check whether MathRow exists when computing caret metrics
Fixes bug #12888.
2023-09-02 17:21:03 +02:00
Jean-Marc Lasgouttes
e651e15a99 Improve caret position when splitting a view
The old code only worked for toplevel cursors and did not show current cursor.
Note that the two windows do not have exactly the same offset.

Fixes bug #12689.
2023-09-02 17:21:03 +02:00
Juergen Spitzmueller
aaae3ad5cc Remove redundant code and clarify strings 2023-09-02 14:28:33 +02:00
Jean-Marc Lasgouttes
2092663365 Add _v_() debug helper maco
This can be used with streams.
  LYXERR0(_v_(var))
leads to the message
 "var=<value of var>"
2023-09-01 16:45:15 +02:00
Juergen Spitzmueller
58e36a27b6 Doc additions by Pavel 2023-08-30 15:40:16 +02:00
Juergen Spitzmueller
4dc9e0c4e6 Improve CITATION_OPEN
* The lyxpaperview script now only provides the paths and let us do the opening
* We use our own viewers for local files rather than QDesktopServices

Plus several minor improvements and code cleanup
2023-08-30 15:30:29 +02:00
Jean-Marc Lasgouttes
0912f7c356 Update caret if needed when changing depth
Fixes bug #12856.
2023-08-30 13:45:00 +02:00
Jean-Marc Lasgouttes
d27f309905 Use correct cursor when creating undo group
This affects where cursor will be after undo. In this case, we want
obviously the 'old' cursor.

Fixes bug #12874.
2023-08-29 17:25:51 +02:00
Juergen Spitzmueller
2195543188 Add message dialog to LFUN_CITATION_OPEN chain
This addresses security concerns.
2023-08-29 14:43:59 +02:00
Enrico Forestieri
c088cc4413 Fix detection of xcb during configure
The QT_FEATURE_xcb macro is not in the private headers anymore.
They keep changing APIs...
2023-08-28 10:52:08 +02:00
Juergen Spitzmueller
53f4f8c103 Change "library directory" to "system directory" (#12709) 2023-08-26 12:03:20 +02:00
Juergen Spitzmueller
7057a45587 Add accelerator 2023-08-26 11:44:00 +02:00
Richard Kimberly Heck
344dc1f822 Polish formatted reference patch, and add documentation. 2023-08-25 15:24:13 -04:00
Pavel Sanda
2e32e2c123 Revert UI fix for two digit numbers. It actually does not work.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg220179.html
2023-08-25 18:52:27 +02:00
Richard Kimberly Heck
e8f8239f68 Polish 2023-08-24 21:24:35 -04:00
Alexander Dunlap
1a800bf3e5 Put use_formatted_reference code in addToToc instead of updateBuffer
to handle forward references.
2023-08-24 21:24:35 -04:00
Richard Kimberly Heck
2ad57dcb6b Preview formatted references in the work area.
Patch from Daniel Ramoeller <d.lyx@web.de>, fixed up by RKH.
2023-08-24 21:24:31 -04:00
Alexander Dunlap
ca3004fc67 Assign equation numbers in updateBuffer instead of
addToToc so that they can be used in updateToc to
assign label cross-refs
2023-08-24 21:14:53 -04:00
Richard Kimberly Heck
89a479f60d Fix bug #12797.
Use plaintext to give some display of equations in TOC.
2023-08-24 21:05:50 -04:00
Juergen Spitzmueller
effd65a586 Amend 101363352c
Instead of just disabling MOUSE_MOTION on inset buttons, we now register
the coordinates where the latest mouse press happens, and if that's on
the inset button we are on when releasing, we toggle the inset.

Thus, minimal unintentional mouse movements don't lead to the button not
to respond.
2023-08-24 09:56:09 +02:00
Pavel Sanda
06198fbe18 Alow two digit number of remembered files in ui.
Reported by Dan.
2023-08-22 22:02:32 +02:00
Juergen Spitzmueller
101363352c Tentative fix for the inset problems on Mac (#12418, maybe #12820, #12279)
This is committed now in order to get testing from Mac users in the next
prerelease. Subject to change or even reversion.
2023-08-21 19:20:06 +02:00
Richard Kimberly Heck
784a7210ba Use master buffer setting when exporting 2023-08-18 19:25:04 -04:00
Stephan Witt
d409555bda Amend change 5c8e3a5f0d - correct include directives 2023-08-18 12:52:25 +02:00
Juergen Spitzmueller
15f9129a26 Improve readability of code and comments 2023-08-18 10:02:48 +02:00
Juergen Spitzmueller
fe57b19294 Mirror all delimiters in RTL context with luabidi, regardless of the language or script (#12881)
Patch by Udi Fogiel
2023-08-18 09:20:26 +02:00
Juergen Spitzmueller
5c8e3a5f0d Remove Qt < 5.2 conditionals and special code
We require Qt 5.2 at least for LyX 2.4
2023-08-18 09:04:12 +02:00
Juergen Spitzmueller
5d084c86c9 Add direction switch with Babel/bidi (#12864)
Patch by Udi Fogiel
2023-08-17 14:29:23 +02:00
Juergen Spitzmueller
315c2f132a Account for babel's bidi option (#12866)
bidi=bidi-{r,l} load the bidi package
2023-08-17 14:25:33 +02:00
Richard Kimberly Heck
a6b83b7444 Make code a bit easier to read 2023-08-16 18:52:04 -04:00
Richard Kimberly Heck
b828da02f8 Slight rearrangement 2023-08-16 18:38:19 -04:00
Richard Kimberly Heck
62483d102d Whitespace and range 2023-08-16 18:22:11 -04:00
Richard Kimberly Heck
d312b32ec8 Fix bug #12852. 2023-08-16 17:51:55 -04:00
Juergen Spitzmueller
124eda3a0d Properly resolve files and dois in InsetCitation (#12878) 2023-08-16 12:47:42 +02:00
Juergen Spitzmueller
71693280c3 Improve usability of quotation mark selection (#12872) 2023-08-15 20:21:32 +02:00
Juergen Spitzmueller
5ebf9e3ac6 Leaner solution for the babel prettyref woes 2023-08-15 17:05:58 +02:00
Pavel Sanda
5936076181 Fix crash when calling dialog-show with bogus names (#12873). 2023-08-14 23:54:47 +02:00
Juergen Spitzmueller
f050fd9626 Fix cursor navigation in error dialog (#12876) 2023-08-14 18:44:10 +02:00
Juergen Spitzmueller
fc3b4cc8d1 Fixup 858b076ab7
Patch by Udi
2023-08-12 12:47:32 +02:00
Juergen Spitzmueller
858b076ab7 Work around French babel's incompatibility with prettyref
In classic (pdf)latex, where the colon is activated, detokenize
the argument of \prettyref.

Fix proposed by egreg at
https://tex.stackexchange.com/a/527912/19291
2023-08-11 17:35:18 +02:00
Udi Fogiel
6671f9bee1 Graphics inset is not forceLTR without pdftex (#12865) 2023-08-11 12:25:03 +02:00
Juergen Spitzmueller
a03c442a62 GuiCitation: consider filter on dialog creation (#12869) 2023-08-11 12:04:26 +02:00
Juergen Spitzmueller
4676a50944 Amend dcde026446
Add missing options update at dialog contruction
2023-08-11 11:44:35 +02:00
Udi Fogiel
dcde026446 disable-default-font-options LyX does not output any LaTeX code when adding optinos to the font, so we should disable adding options to fonts in that situation. 2023-08-11 11:21:22 +02:00
Udi Fogiel
9f29fb33d1 prioretize-user-font-options 2023-08-11 11:13:24 +02:00
Juergen Spitzmueller
02ba1a1327 Fix selection restoration in quick search (#12779) 2023-08-11 11:07:53 +02:00
Enrico Forestieri
4fa0fbe5bf Use utf8 strings for previewed labels when possible
Fixes bug #12842.
2023-08-10 18:34:17 +02:00
Juergen Spitzmueller
f75f73a402 Fix InsertTableWidget interference with tooltip geometry on Qt6 (#12776)
The current method played badly with Qt6 on wayland
2023-08-10 16:43:06 +02:00
Scott Kostyshak
cc951cd411 Comments 2023-08-10 06:17:29 -04:00
Daniel Ramoeller
a2310d04f4 Keep cursor position when splitting
Fix for #12689
2023-08-10 06:10:08 -04:00
Scott Kostyshak
224f21c856 Update tex2lyx tests after format change to 618
Amends 9e8901f9.
2023-08-06 15:09:14 -04:00
Pavel Sanda
05276c5bea Our default for paste operation should preserve newlines.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg220061.html
2023-08-06 17:05:55 +02:00
Pavel Sanda
9e8901f997 Adding hebrew quotation marks (bug #12849).
Patch from Udi Fogiel.
2023-08-06 16:50:07 +02:00
Stephan Witt
d656e01172 #12626 disable Ok button of shortcut editor when LFUN is empty 2023-08-06 00:28:50 +02:00
Stephan Witt
49fe82ec8d #10740 fix focus problems with color picker on Mac
- closing the color picker focuses the wrong (main) window
- to return focus to correct (parent) window it has to be activated explicitly
2023-08-05 15:24:33 +02:00
Stephan Witt
65ec100f6a #12576 improved file name chooser implementation for GUI dialogs
- code reorganization to move the file name chooser methods in GuiDialog class
- on Mac add explicit raise of the current dialog window on close of the file browser to work around the bug 12576
2023-08-05 08:56:35 +02:00
Stephan Witt
550c79215b #12001 make message boxes modal on Mac 2023-08-02 18:00:02 +02:00
Pavel Sanda
7b13cccb99 DocBook: fix encoding of citations.
Patch from Thibaut.
2023-08-01 16:11:21 +02:00
Richard Kimberly Heck
95cc596b7d Fix reference to temporary 2023-07-29 14:41:22 -04:00
Richard Kimberly Heck
7fb3773e60 Fix up 04fc48d790. 2023-07-29 13:53:59 -04:00
Richard Kimberly Heck
6cffef87d2 Fix silly mistake in 04fc48d79 2023-07-29 12:34:38 -04:00
Richard Kimberly Heck
2e945584bf Catch another potential crash of the same kind as in the previous commit.
Also refactor.
2023-07-28 23:09:00 -04:00
Richard Kimberly Heck
aacc5147b6 Fix crash when modifying an InsetRef inserted by the current author.
The problem was that, in this case, we actually delete the current inset
in changeCmdName. So when we return from that and attempt to call initView(),
we're in a non-existent inset.
2023-07-28 22:57:57 -04:00
Richard Kimberly Heck
aec6a764f7 Remove debug code 2023-07-28 17:51:55 -04:00
Richard Kimberly Heck
04fc48d790 New RefFormat tag for counters, and PrettyFormat for floats.
Layout format updated to 104.
2023-07-28 17:37:13 -04:00
Richard Kimberly Heck
57f284d9a8 Whitespace 2023-07-28 17:16:06 -04:00
Richard Kimberly Heck
1ea8b272a0 Polish 2023-07-28 17:13:12 -04:00
Richard Kimberly Heck
5164b2853e Fix bug #12337. Reorder plural and caps indicators. 2023-07-28 12:10:21 -04:00
Richard Kimberly Heck
ae5b4367d1 Fix bug #12235: Select text in search field on opening.
Patch slightly modified from one by Daniel.
2023-07-28 12:07:23 -04:00
Richard Kimberly Heck
5cb80b867f Hack to display section symbol 2023-07-28 12:07:15 -04:00
Pavel Sanda
80dac0e52a Fix wrong nesting in Outline.
Fixes #12814, patch from Yuriy.
2023-07-28 10:31:54 +02:00
Richard Kimberly Heck
96dfc081b7 Fix bug #11822.
Allow counter formatting strings in PrettyFormat. Patch from Daniel.
2023-07-27 21:20:53 -04:00
Richard Kimberly Heck
5b2b0d5c76 Fix bug #12819.
Pop a warning and mark the buffer dirty if the file is deleted from disk.
2023-07-27 18:13:42 -04:00
Richard Kimberly Heck
a13fb42a03 Add FIXME for bug #12828 2023-07-27 18:13:42 -04:00
Pavel Sanda
56d9b713c7 Save translators time, already used on different places. 2023-07-27 23:24:11 +02:00
Richard Kimberly Heck
d815f382fa Fix warning 2023-07-27 16:57:04 -04:00
Pavel Sanda
9c7030b36b Revert a9c6fb0c.
Causes regression, see #12841.
2023-07-27 22:39:49 +02:00
Richard Kimberly Heck
8424213ae4 Use non breaking space 2023-07-27 16:36:11 -04:00
Daniel Ramoeller
9361bf56a3 More consistent line spacing/leading
Uses maxHeight (= maxAscent + maxDescent) as leading.

Fix for bug #11818.
2023-07-27 10:36:41 +02:00
Thibaut Cuvelier
9a163399fb XHTML: remove deferred text in InsetListings, fixing 12007. 2023-07-27 10:29:42 +02:00
Thibaut Cuvelier
98d1b04160 Before this patch, each character within InsetMathClass was output separately, without understanding their meaning, using the default text output (with [] around each character). This commit changes the behaviour to skip the InsetMathClass during the MathML output. This effectively renders the inset useless for MathML (instead of controlling spacing), as expected, because the MathML processor is supposed to handle the spacing itself.
Another implementation would have been to use the lspace and rspace attributes in MathML, but they require to give the exact spacing before and after the operator instead of relying on rules like TeX.

For instance, `$a\mathbin{+}b$` resulted in this MathML output before the patch:

```
<math xmlns='http://www.w3.org/1998/Math/MathML'>
<mrow>
 <mi>a</mi><!--  -->
 <mi>[mathbin [char + mathalpha]]</mi>
 <mi>b</mi>
</mrow>
</math>
```

For comparison, this was the output with LyX 2.3.7

```
<math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow>
  <mrow><mi>a</mi><!--  -->
   <mi>[mathbin [char + mathalpha]]
   </mi><mi>b</mi>
  </mrow>
 </mrow></math>
 ```

 After this patch, it looks like:

 ```
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mstyle class='math'>
  <mrow>
   <mi>a</mi>
   <mo>+</mo>
   <mi>b</mi>
  </mrow>
 </mstyle>
 </math>
 ```
2023-07-27 01:22:30 -04:00
Richard Kimberly Heck
cc22d766a9 Slight rearrangement 2023-07-27 01:22:30 -04:00
Richard Kimberly Heck
f393e6d219 Fix bug #8741 2023-07-27 00:09:26 -04:00
Richard Kimberly Heck
2224e85030 Make Alt-escape work for search as well 2023-07-26 16:52:30 -04:00
Jean-Marc Lasgouttes
7f23bd4aca Restore some checks that were useful for search
It is really back of the enveloppe spacing, but people liked it this way.

Fixes ticket #12767.
2023-07-26 22:46:05 +02:00
Richard Kimberly Heck
926ae84921 Use Alt-Escape to float and unfloat dock widgets.
For some reason, redocking is not working for me at all. This
key seems free.
2023-07-26 14:26:02 -04:00
Alexander Dunlap
c609e9cbcf Display equation/theorem numbers in insert cross reference dialog.
Fixes bug #11466,
2023-07-26 13:35:42 -04:00
Juergen Spitzmueller
7f4c4cd548 Improve AllowedOccurrences
This does now apply to the whole inset or paragraph group (not to the
current paragraph only) unless the new boolean AllowedOccurrencesPerItem
is set and we are in a list-type environment.

Amends 729ab602ca
2023-07-26 09:53:25 +02:00
Juergen Spitzmueller
729ab602ca To finish up #6854, also add AllowedOccurrences
Again very basic for now (this only considers the current paragraph,
not the whole inset or a serious of grouped layouts
2023-07-25 15:49:53 +02:00
Juergen Spitzmueller
0b463bfe0f Add AllowedInInsets and AllowedInLayouts InsetLayout tags
This allows to restrict the use of flex insets to specific contexts.

Note that this is currently very basis. It only considers immediately
containing insets/layouts and can be surpassed via cut and paste.

The use case that made me finally implement this are macros in covington
that make sense only in specific environments (but also consider \inst
in some article classes)
2023-07-25 13:37:07 +02:00
Juergen Spitzmueller
bc95ff1ace Whitespace 2023-07-25 11:13:18 +02:00
Jean-Marc Lasgouttes
6a8c10f0d6 Display footnote labels as superscripts
A new counter type \superarabic is introduced, that transforms the
counter into superscript Unicode numbers.

This is used for the footnote counter.

The Foot inset layout is modified to use an empty LabelString (in size
Normal, since the numbers could be too small).

We use this occasion to set footnote text in footnotesize, as it should.

A couple of changes are done to the code to make the button label and
tooltip look better.

Fixes bug #12238.
2023-07-24 11:15:03 +02:00
Juergen Spitzmueller
6d167e94f4 Add accelerators 2023-07-24 10:33:20 +02:00
Juergen Spitzmueller
d212013bd7 Fix casing 2023-07-24 10:26:57 +02:00
Pavel Sanda
ae3aaa9ade Add a "nogui" option to the inset-edit lfun (bug 11956). 2023-07-24 01:21:52 +02:00
Jean-Marc Lasgouttes
35359a4c6f Improve branch activatiion LFUNs
* put the code that is called both from Buffer and InsetBrach in the
  two helper methods Buffer::branchActivationStatus() and
  Buffer::branchActivationDispatch().

* Cleanup the code so that _MASTER_ lfuns are disabled when there is
  no master document.

* When changing branches in the master buffer, make the buffer visible
  if it is not, and make sure that undo information is recorded.

* The code in Buffer::dispatch is used first, and it gives control to
  the branch inset code if no branch name has been specified.

Fixes bug #12588.
2023-07-23 18:57:38 +02:00
Jean-Marc Lasgouttes
0f7404392c Fix issues with inset-dissolve in mathed
* do not try to dissolve a macro template inset (avoids a crash)
* disable inset-dissolve when an argument is given
* when triggered by the AtPoint mechanism, make sur to dissolve the
  right inset.

Fixes bug #12562.
2023-07-23 17:39:39 +02:00
Jean-Marc Lasgouttes
62d61e7655 Revert "Fix crash when dissolving a top level math inset"
The code was too convoluted and actually wrong (the -1 should have been -2).

This reverts commit c75522bbb7.
2023-07-23 17:38:47 +02:00
Jean-Marc Lasgouttes
81e35bc396 Replace hardcoded inheritFont() with InheritFont InsetLayout tag
Each removed inheritFont method is replaced by a 'InheritFont false'
line in the relevant InsetLayout entry.

Add code to layout2layout that does this automatically when the entry
is missing.

The case of InsetScript is special, since the inheritFont() was not
needed here: the default is indeed true.

Fixes bug #12238.
2023-07-22 23:38:53 +02:00
Pavel Sanda
fe953000ed Fix application of PARAGRAPH_PARAMS* in selection.
- Setting in the last paragraph of selection was not applied
  at certain conditions (i.e. relative cursor position in first
  paragraph > rel.c.pos. in last paragraph).

Getting back + fixing typo from e2b42b1726.

https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg220019.html
2023-07-22 18:17:46 +02:00
Jean-Marc Lasgouttes
cfe094a380 Introduce new InsetLayout tag InheritFont
The font inside the inset is inherited from the parent for LaTeX
export if this parameter is true, as well as on screen. Otherwise
the document default font is used.

The default value is true.

Update tufte layouts to use this tag for sidenote and marginnote flex
insets.

Increase layout format to 101.

Fixes bug #12238.
2023-07-22 15:53:14 +02:00
Jean-Marc Lasgouttes
c8c589353a Detect when one tries to bind a lfun to a prefix of longer commands
Change KeyMap::getBinding to return FuncRequest::prefix in this case.

Add handling of this case in PrefShortcuts::validateNewShortcut.

What does not seem to work is that if, for example, accent-acute is
bound to M-s (which is a prefix for size-related bindings), and then
the binding is removed, the functions are not visibly restored.

Part of bug #10131.
2023-07-22 00:01:34 +02:00
Jean-Marc Lasgouttes
f31bf0df1d Send some debug info to ACTION 2023-07-20 23:39:15 +02:00
Juergen Spitzmueller
0e0c2c6120 Update tex2lyx tests 2023-07-20 15:22:47 +02:00
Juergen Spitzmueller
2841a1c063 Update covington support in linguistics module (file format change) 2023-07-20 15:09:47 +02:00
Kornel Benko
11f44c00e0 FindAdv: Handle negthinspace, negmedspace and negthickspace also in regexes 2023-07-20 12:32:58 +02:00
Pavel Sanda
5b34105514 Group most verbose dbg output into more intuitive categories.
From now on, having all dbg level except of painting and scrolling
shows debug output which can be actually followed.
2023-07-18 22:25:28 +02:00
Jean-Marc Lasgouttes
008cec3eec Honor scroll_below_document when jumping to end of document
While fixing #12491 at 0fed10e4, some band-aids were removed at the
end of `BufferView::scrollToBuffer`. One of them ensured that
scrolling to last paragraph would not leave the last row alone on
screen.

This behavior is actually correct when the scroll_below_document pref is true.

This commit restores the test that avoids the issue.

Of course, this does not fix the real issue, since for example opening
Tutorial.lyx and jumping to "5.3 Errors!" produces the same unwanted
effect.
2023-07-18 21:03:00 +02:00
Juergen Spitzmueller
649cb30963 Another tiny correction (not yet ideal) 2023-07-18 18:11:59 +02:00
Juergen Spitzmueller
7640d1fbf5 Remove bogus condition and add comments 2023-07-18 17:55:08 +02:00
Juergen Spitzmueller
eadc8ab147 LaTeXHighlighter: handle grouped values with commas in keyval options 2023-07-18 17:35:48 +02:00
Juergen Spitzmueller
9e308ddb03 Improve keyval highlighter 2023-07-18 17:05:56 +02:00
Juergen Spitzmueller
c549a2b59c At end of children, language needs to be reset
This amends 243b0ef90c
2023-07-18 15:27:17 +02:00
Juergen Spitzmueller
6603ae2242 Support option snippets in the LaTeXHighlighter 2023-07-18 15:13:48 +02:00
Kornel Benko
8eda9e25e0 Acount for all non-negative spaces used by lyx
The unicode representation in an ascii-string string is
\302\240                                Normal space
\342\200\257                            Non-breaking Thin (1/6 em)
\342\200\213\342\200\205\342\200\213    Medium(2/9 em)
\342\200\213\342\200\204\342\200\213    Thick (5/18 em)
\342\201\240\342\200\202\342\201\240    Half Quad(0.5 em)
\342\200\203                            Quad(1 em)
\342\200\203\342\200\203                Double Quad(2 em)
\342\220\243                            Visible space

'Double Quad' counts as 2 spaces, all others count as 1 space in the search regex
2023-07-18 13:09:55 +02:00
Juergen Spitzmueller
cd080da3c4 Fix thinspace search regex 2023-07-18 07:28:18 +02:00
Jean-Marc Lasgouttes
430c41cd05 Fix display of comment char in "lyxlex" debug channel 2023-07-17 23:02:46 +02:00
Juergen Spitzmueller
999b95398d THINSPACE is nonbreakable (i.e., 0x202f, not 0x2009) 2023-07-17 17:14:50 +02:00
Juergen Spitzmueller
f6f936e3d0 Support protected and thin space in simple search (#12836) 2023-07-17 16:58:58 +02:00
Juergen Spitzmueller
e87ace901a Style 2023-07-17 16:55:47 +02:00
Juergen Spitzmueller
edaf28fdd6 Do not throw away runparams settings of InsetText in InsetFoot::latex
This amends 243b0ef90c
2023-07-17 13:18:56 +02:00
Jean-Marc Lasgouttes
13d24c711e When breaking a paragraph, do not reset depth
Remove some logic that would reset depth when editing non-environment
stuff (e.g. Standard layout) at non-zero depth. The current way of
decreasing depth is to use paragraph-break in an empty paragraph.

See discussion in ticket #2445 for why this code happened.

Fixes bug #12750.
2023-07-16 17:16:02 +02:00
Stephan Witt
c4195defe6 #12818 amend last change b924db72c5 - use c++ 11 compiler compatible code 2023-07-16 17:11:38 +02:00
Stephan Witt
b924db72c5 #12818 correct evaluation of message box result info
The help page of int QMessageBox::exec() (​https://doc.qt.io/qt-6/qmessagebox.html#exec) says:
When using a QMessageBox with standard buttons, this function returns a StandardButton value indicating the standard button that was clicked.
When using QMessageBox with custom buttons, this function returns an opaque value; use clickedButton() to determine which button was clicked.
2023-07-16 16:49:02 +02:00
Juergen Spitzmueller
b397c78b70 Move comment to where it belongs 2023-07-16 16:46:02 +02:00
Juergen Spitzmueller
243b0ef90c If language needs to be reset at the end of footnotes or floats
then do reset it only after footnotes or floats. \selectlanguage at
the end of environments might produce spurious vertical space
(see https://marc.info/?l=lyx-devel&m=168872369617866)
2023-07-16 16:31:31 +02:00
Jean-Marc Lasgouttes
386a2ddca1 Cache the value of FontMetrics::xHeight()
This value is computed for the metrics of *every* Mathdata and hotspot
says that it counts for 9% of total on math-heavy "branch-test.lyx"
file. I am not sure that real world agrees with that, but profiling
shows that Qt itself does not cache the value.

Part of reinvestigation of #12297.
2023-07-15 23:32:59 +02:00