Commit Graph

29248 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
527984ed2e Fix up 'Reduce metrics updates from 4 to 1 when loading file'
The missing metrics computation meant that, when loading a file, the
workarea would not be scrolled correctly to show the cursor.

The resizeBufferView does not create an additional metrics
computation, it just triggers it earlier.
2024-04-29 18:02:14 +02:00
Scott Kostyshak
23c45f76ad CMake: adapt to new location of Lexer
Lexer is now in support/. See 2660df9b.
2024-04-28 09:13:55 -04:00
Jean-Marc Lasgouttes
df19a70900 Remove unused #include 2024-04-28 12:33:33 +02:00
Jean-Marc Lasgouttes
2660df9b99 Move Lexer to support/ directory (and lyx::support namespace)
This requires quite a bit of trivial code shuffling.
2024-04-28 12:23:13 +02:00
Jean-Marc Lasgouttes
ed2f3cb9cf Set buffer when creating a MathData from parts of another one
This is triggered by selecting part of an equation under Xcb platform
(x11). Indeed, the current selection has to be sent to the X11 server
and BufferView::requestSelection() is called. Eventually
cap::grabSelection() is the function that creates this partial
MathData object.

Fixes ticket #12947.
2024-04-25 17:22:22 +02:00
Jean-Marc Lasgouttes
b45a957929 Set buffer_ correctly when inseting a math macro over a selection
The code that handles this special macro insertion (in
Cursor::mathMacroClose())) is very weird: it inserts the contents of
the macro _after_ the macro and later, since the macro is 'greedy', it
will eat this contents and put it in its first macro cell.

Does it make sense to you? It does not ake sense to me either. Anyway,
this is the point where one should make sure that the buffer is set.

Fixes ticket #12682.
2024-04-25 14:32:18 +02:00
Jean-Marc Lasgouttes
af3521881c typo 2024-04-25 14:27:22 +02:00
Jean-Marc Lasgouttes
c013799887 Force a Buffer * argument to math insets constructor
Make sure that math insets have a proper buffer. To this end, make the
Buffer* parameter of InsetMath mandatory and fix the compilation
errors that ensue.
2024-04-24 16:27:04 +02:00
Jean-Marc Lasgouttes
57d7130655 Force a Buffer * argument to MathData constructor
In order to ensure that MathData objects have a valid buffer, the
default MathData() constructor is deleted. This means that a buffer
shall be specified for each MathData object created.

This is fairly mechanical, actually. In particular, in most
InsetMathXxx cases, in MathData and in MathParser, the available
buffer_ member is used.

More specific cases:
- lyxfind.cpp takes the buffer from the Cursor

- calls to vector<MathData>::resize take an additional
  MathData(buffer_) parameter. There are cases where resize actually
  remove cells, and in this case clear() or even erase() have been
  used.

- in InsetMathMacroTemplate, the optional parameters of the
  constructors cannot be allowed anymore (a default value cannot
  depend on another parameter). Therefore there a now two constructors
  instead.

- in MathAutoCorrect.cpp, the MathData objects are not bound to a
  buffer, so that std::nullptr is used instead.

- in MathExtern, use a buffer when one is specified, std::nulptr
  instead.
2024-04-24 16:26:57 +02:00
Jean-Marc Lasgouttes
f3c5ff9cb7 Try to make sure that math insets have a properly set buffer_ member
Set the buffer of contents that is added to a MathData object through
MathData::insert() (both versions)
MathData::push_back()
asArray()

Also in math macros, initialize look_ with the relevant buffer.

This reduces the number of insets hat do not have a proper buffer.

See #13050 for discussion of this issue.
2024-04-22 17:52:23 +02:00
Juergen Spitzmueller
b8ff824a4f Handle the case of outdated chkconfig.ltx in user directory 2024-04-20 14:57:12 +02:00
Richard Kimberly Heck
c395eda347 Set Buffer for MathData when creating macro view 2024-04-18 18:25:47 -04:00
Richard Kimberly Heck
7c140f743d Little bit more debug info for unset Buffer members. 2024-04-18 18:25:47 -04:00
Jean-Marc Lasgouttes
1a11abe439 Always repaint the gray area below main inset
Now that SingleParUpdate does not always lead to a full screen update
when the height of the paragraph changes (see new behavior of
updateMatrics(bool)), it is necessary to make sure that the grey area
below the main page is always repainted.
2024-04-17 23:12:09 +02:00
Jean-Marc Lasgouttes
c1fd622c51 Sanitize cursors after a buffer has been reloaded
When a buffer is reloaded, its content may remain the same, but the
memory allocation is new, so that the inset pointers in cursors are
now wrong. This requires to sanitize the cursors held by the buffer
views.

Before the biginset branch, some full metrics computation call that is
now removed probably did that as a side effect. Now we have to be more
precise.

To this effect, introduce WorkAreaManager::sanitizeCursors() and use
it in Buffer::reload().
2024-04-16 23:48:01 +02:00
Richard Kimberly Heck
4e8aa89eb9 Defer construction of temporary cursor.
We were doing this on every mouse movement. I.e., for every single
pixel the mouse traverses. It can be expensive if there are a lot
of math insets.
2024-04-16 12:15:50 -04:00
José Matos
cdcaf0e7b6 Convert $${python} placeholder for graphic conversions 2024-04-14 21:30:02 +01:00
Juergen Spitzmueller
09c72d7c8d Set cursor font after pasting to PassThru inset (#12592) 2024-04-13 11:36:10 +02:00
Juergen Spitzmueller
cab03f2680 Fix indentation 2024-04-13 10:11:24 +02:00
Juergen Spitzmueller
5477451e36 Disable language package choice if the class preloads a package 2024-04-13 10:07:18 +02:00
Koji Yokota
b07a263c18 Fix wrong position of conversion windows of the input method #11723, #13054 2024-04-12 21:22:31 +09:00
Jean-Marc Lasgouttes
83e7c74f6b Fixup 'Avoid metrics computation on resize when width did not change'
When the width of the window did not change, computing full metrics is
not necessary in BufferView::resize(), but it is better to redraw the
screen (especially with Wayland).

Typical use cases are when using M-x to open the minibuffer or going
in and out of an equation (which shows/hides the math toolbars).
2024-04-10 15:32:03 +02:00
Jean-Marc Lasgouttes
c3fb9fe95f Comment out too verbose debug output 2024-04-10 14:06:30 +02:00
Jean-Marc Lasgouttes
c7f53afd31 Fix compilation with msvc 2019
'uint' is not defined, 'unsigned int' is better.
2024-04-07 20:43:00 +02:00
Jean-Marc Lasgouttes
89901123c5 Fix crash when deleting inset with backspace
See description here:
https://marc.info/?l=lyx-devel&m=171243435229412&w=2

cutSelectionHelper did not request a metrics update when the selection
was inner to a paragraph. The new code is better, but it was not
necessary before the biginset branch because of a full metrics
computation that hid this missing case.
2024-04-07 19:29:53 +02:00
Juergen Spitzmueller
6a2a9086ad Comment on 9198ed5965 2024-04-07 06:24:37 +02:00
Juergen Spitzmueller
9198ed5965 Fix assertion when pasting paragraph with insets in lyxrc.ct_markup_copied
This has to be done after the inset buffers have been initialized.
2024-04-06 09:47:22 +02:00
Pavel Sanda
77273303a5 Improve stats update times for buffer switches and toolbar toggles. 2024-04-05 22:59:07 +02:00
Pavel Sanda
6f8b944d39 * quote-insert lfun description 2024-04-05 19:47:20 +02:00
Pavel Sanda
7976cc2dac Allow relative statistics values in statusbar.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg221311.html
2024-04-05 19:36:23 +02:00
Jean-Marc Lasgouttes
9fd397ac1c Indicate that, by default, mouse LFUN do not require a metrics update
This is done easily in LyXAction.cpp. Remember that, by default, each
function is supposed to request a full metrics computation.

Part of bug #12297.
2024-04-05 13:06:26 +02:00
Jean-Marc Lasgouttes
73678dcde9 Avoid full metrics computation when entering/leaving inset
Annotate function LFUN_FINISHED_xxx to indicate that they do not
require a full metrics computation.

Remove an "optimization" that meant that when the cursor changed
inset, a full metrics computation was requested.

Part of bug #12297
2024-04-05 13:06:26 +02:00
Jean-Marc Lasgouttes
5e8578837f Avoid some full metrics computations related to math previews
When entering/leaving a math hull inset, a Update::Force flag was set,
in case the metrics of the inset would change because of a switch
between normal and preview representation.

When entering the inset, this code is now used only when the inset was
in preview mode.

In both cases, Update::Force is replaced with Update::SinglePar.

This requites in Text::dispatch to honor Update::SinglePar when it has
been set by some lfun, even when singleparupdate is false.

Part of bug #12297.
2024-04-05 13:06:26 +02:00
Jean-Marc Lasgouttes
f7218cec18 Avoid metrics computation on resize when width did not change
Entering a math inset triggers a work area reize because the math
toobars appear automatically. However, by default these toolbars are
at the bottom of the screen and their presence does not change the
typesetting of paragraphs. Therefore it is useful to avoid a call to
updateMetrics() in the case where the width of the work area did not
change.

Part of bug #12297.
2024-04-05 13:06:26 +02:00
Jean-Marc Lasgouttes
1d1f95d2ed Reduce metrics updates from 4 to 1 when loading file
The number of metrics updates when loading file and showing it in a
new work area is unreasonable.

The first avoided call to updateMetrics() was an explicit resize in
BufferView::init(). Instead, an assertion is suppressed by exiting
early BufferView::processUpdateFlags() when BufferView::ready()
returns false. This is a new method introduced to factor in some
existing tests.

Two other metrics computations are avoided by setting the enclosing
View object busy() while creating the new tab. To make this work
properly, GuiWorkArea::scheduleRedraw has to return early in this
case.

When saving an unnamed document or invoking "Save as...", call
setBusy(false) earlier so that repainting occurs correctly.

Fixes bug #12976.
2024-04-05 13:06:26 +02:00
Jean-Marc Lasgouttes
2449693301 Do not compute metrics at each preview when loading file
With the branch-test.lyx file from #12297, loading takes forever when
previews are activated. This is because each preview element causes a
full screen metrics recomputation.

This commit just skips these calls and only does one when all previews
have been obtained. As a result, computing the previews takes 1 second
instead of 25 seconds on branch-test.lyx.

Part of bug #12297.
2024-04-05 13:06:26 +02:00
Jean-Marc Lasgouttes
f15d2ebf38 Improve the code that limits scrolling at top/bottom
The most visible part of this commit is the move of part of
BufferView::updateMetrics to a new TextMetrics::updateMetrics. This
new method makes sure that metrics are known for all visible paragraphs
(starting from anchor), and that the positions of the paragraphs have
been recorded.

This method is called up to 3 times in BufferView::updateMetrics:
* unconditionally, to update all visible metrics,
* then, if the bottom of the document is visible and too high, after
  updating the anchor ypos,
* and similarly if the top of the document is visible and too low.

This fixes for example the case where one jumps to Section 5.3 at the
end of Tutorial and 'scroll_below_document' is false.

Some now redundant code is removed from BufferView::scrollToCursor.

The anchor-setting code in BufferView::draw is not clearly useful, but
left here just in case. It generates a debug warning, though.

Part of bug #12297.
2024-04-05 13:03:22 +02:00
Jean-Marc Lasgouttes
08010c6a5e Implement quick scroll
Replace flag parameter for updateMetrics() by a `force' boolean. When
it is false, the method keeps the metrics of paragraphs that are still
visible in WorkArea instead of computing everything afresh. All it has
to do is update their positions.

Add code to updateMetrics() to update the value of the anchor pit/ypos
(similar to the one in draw()).

Update processUpdateFlags() to use this when update flag is ForceDraw.

Modify scrollDocView() to just change the anchor paragraph position
when the scrolling operation would re-use some of the existing
paragraphs.

The time needed to update the metrics when scrolling with mouse in the
branch-test.lyx document is now divided by 20!

Part of bug #12297.
2024-04-05 13:03:22 +02:00
Jean-Marc Lasgouttes
0b6105b924 Introduce new helpers ParagraphMetrics::top/bottom
This avoids code with position/ascent/descent that is difficult to follow.

No change in function intended.
2024-04-05 13:03:22 +02:00
Jean-Marc Lasgouttes
7f85024f80 In the no-draw phase, do not cache the positions of not visible insets
This can make a big difference for a very large branch that contains
lots of equations.

This is complementary to the previous patch, since instead of reducing
the number of calls to updatePosCache, we make it faster.

In the same test of scrolling with mouse wheel through the
branch-test.lyx document, one finds a 23% improvement for
BufferView::updateMetrics().

Part of bug #12297.
2024-04-05 13:03:22 +02:00
Jean-Marc Lasgouttes
d19ade9a61 Remove some redundant calls to updatePosCache
The setting of insets positions was done twice in updateMetrics.
When one of the paragraph is a huge branch, this can be very expensive.

This leads to a 17% improvement on updateMetrics time on a scrolling test.

Part of bug #12297
2024-04-05 13:03:22 +02:00
Jean-Marc Lasgouttes
9a96726bcd Enable Update::SinglePar in nested insets too
The idea of single par update is to try to re-break only the paragraph
containing the cursor (if this paragraph contains insets etc.,
re-breaking will recursively descend).

The existing single paragraph update mechanism was tailored to work
only at top level. Indeed changing a paragraph nested into an inset may
lead to larger changes.

This commit tries a rather naive approach that seems to work well: we
need a full redraw if either

1/ the height has changed
or
2/ the width has changed and it was equal to the text metrics width;
   the goal is to catch the case of a one-row inset that grows with
   its contents, but optimize the case of typing in a short paragraph
   part of a larger inset.

NOTE: if only the height has changed, then it should be
  possible to update all metrics at minimal cost. However,
  since this is risky, we do not try that right now.

Part of bug #12297.
2024-04-05 13:03:22 +02:00
Jean-Marc Lasgouttes
f5bbadbad9 Implement undo coalescing
if the undo element we want to add only changes stuff that was already
modified by the previous one on undo stack (in the same group), then
skip it. There is nothing to gain in adding it to the stack.

The typical use case is when doing a search and replace in a large
document that does many replacements in each paragraph. In this case,
the same paragraph would be stored repeatedly.

Fixes bug #12564.
2024-04-05 12:50:20 +02:00
Stephan Witt
4c1db7cad8 #13049 add window activation for preferences to avoid it be hidden by main window on mac after alert prompts 2024-04-05 10:47:49 +02:00
Jean-Marc Lasgouttes
51562ff377 Do not include <QDate> in InsetInfo.h
This is used by getDate/getTime, which actually should not be
InsetInfoParams methods, but functions in anonymous namespace.
2024-04-04 17:47:33 +02:00
Juergen Spitzmueller
aa7ff14933 Allow for multiple accelerator alternatives
This needs some testing before it could go to 2.4.x eventually
2024-04-04 17:12:48 +02:00
Jean-Marc Lasgouttes
6260689fd5 Compilation fix with Qt < 5.7
Qt::ImAnchorRectangle has only been introduced in Qt 5.7. Since it is
used to answer a query from the IM machinery, there is no need for
it with older Qt versions.
2024-04-03 12:41:45 +02:00
Juergen Spitzmueller
728175f9ac Dissolve some shortcut conflicts in the wake of f3a4602c4c 2024-04-03 08:28:00 +02:00
Richard Kimberly Heck
f374869687 Update doc info for quote-insert 2024-04-02 12:46:36 -04:00
Juergen Spitzmueller
f3a4602c4c Smarter menu length calculation
It is possible I have missed some shortcut conflicts, so please report
if you find any.
2024-04-02 14:41:54 +02:00
Daniel Ramoeller
638c04dd6a FindAdv: no paragraph indentation for more space in the search string
See #11555
2024-04-02 09:22:53 +02:00
Kornel Benko
07cacef398 FindAdv: Handle neg-spaces like normal space if searching without format 2024-04-02 09:22:53 +02:00
Kornel Benko
8de81e8dc1 Rename hasToString() to findUsesToString()
There are special cases where the toString() exist,
but still plaintext() is not to be used by find.
2024-04-02 09:22:53 +02:00
Juergen Spitzmueller
98080ca0d5 Fix label escaping in InsetMathRef (#12980)
This was completely broken: the IDs have been escaped in the LyX file
(which they absolutely shouldn't) but not in all LaTeX output (which
they should).
2024-04-02 08:15:53 +02:00
Juergen Spitzmueller
31ec96e01f Fix context menu of InsetMathRef 2024-04-01 17:59:56 +02:00
Juergen Spitzmueller
a020bbc4a8 Fix backslash LaTeXifying in InsetCommand
\ was transformed very early to \textbackslash{}, but then the following
routines escaped braces in the string, so we wrongly ended up in
\textbackslash\{\} and "\{} in the output
2024-04-01 10:57:27 +02:00
Juergen Spitzmueller
812e306dad Factor out shared method
Amends babb5b007b
2024-03-31 12:40:27 +02:00
Juergen Spitzmueller
babb5b007b Fix crash with quick search starting with mathed selection
setCursorSelection does not work with math. Copy the method from
spellchecker.
2024-03-30 10:14:34 +01:00
Juergen Spitzmueller
698f922d19 Do not enter page break in heading (#13040)
Rather than that, put it before or after, or disallow,
depending on the position.
2024-03-28 18:03:54 +01:00
Juergen Spitzmueller
60cffcd9b7 Fix alignment of screen font preview in prefs (remaining part of #13046) 2024-03-24 09:00:41 +01:00
Jean-Marc Lasgouttes
4dfebbe9da Fix display of a math hull inset in a tight inset
This is a kind of hack. This allows InsetMathHull to state that it
needs some elbow room beyond its width, in order to fit the numbering
and/or the left margin (with left alignment), which are outside of the
inset itself.

To this end, InsetMathHull::metrics() sets a value in
MetricsInfo::extrawidth and this value is added later to the width of
the row that contains the inset (when this row is tight or shorter
than the max allowed width).

Fixes bug #12320.
2024-03-22 15:40:40 +01:00
Jean-Marc Lasgouttes
6d62d8009f Revert "Fix display of a math hull inset in a tight inset"
This commit will be replaed by a better solution.

Part of ticket #12320.

This reverts commit 4bbd4a45e7.
2024-03-22 15:08:26 +01:00
Thibaut Cuvelier
fd37845075 Amend 16660d12.
The previous commit introduced wrong behaviours for <>. The new code carefully escapes what needs to be escaped from LaTeX, using the now-standard XML tools (XMLStream).
2024-03-21 21:32:45 +01:00
Thibaut Cuvelier
16660d12b4 MathML in HTML: don't escape <> for a raw LaTeX output.
In some cases (I only found numbered equations), the LaTeX output still has a bit of HTML. For numbered equations, using \tag{X} (as suggested in https://www.lyx.org/trac/ticket/13048) would require fiddling with the output. KaTeX doesn't support \label. This patch is probably the easiest and most reliable fix.

Fixes https://www.lyx.org/trac/ticket/13048.
2024-03-21 00:29:23 +01:00
Patrick de Visschere
3f790725d9 Using the latest commit and building lyx with cmake on macos-sonoma with
xcode fails with multiple error messages like this one:

----------
CMake Error in po/CMakeLists.txt:
       The custom command generating

     <build-directory>/po/LyX2.4.cat.pot

       is attached to multiple targets:

     translations
     update-gmo

  but none of these is a common dependency of the other(s).  This is not
  allowed by the Xcode "new build system".
2024-03-20 11:44:22 +01:00
Jürgen Spitzmüller
0d3d91c055 Add $$OrigAbsName placeholder to external
This produces the absolute path to the original file.

Documentation will follow in die time (after documentation has been
unfrozen)
2024-03-20 07:57:43 +01:00
Pavel Sanda
f7e6086e67 TableUI - allow expading of TableAlignCO (part of #13046). 2024-03-19 19:23:22 +01:00
Juergen Spitzmueller
b1e2986df8 Use docstring for preview snippet all the way down
No need to convert back and forth
2024-03-16 11:57:48 +01:00
Juergen Spitzmueller
f9c60d477d Simplify b3fe9cb704 2024-03-16 05:01:53 +01:00
Juergen Spitzmueller
b3fe9cb704 Prevent iconv exception in previews (#13042)
The preview loader assumes all content is in the main document encoding.

As soon as content was not encodable, LyX crashed. We now check for that
and if non-encodable glyphs are found, we do not produce a preview snippet
and warn.

Ideally, the preview loader should be made aware of encoding changes, or
we should generally use utf8 for previews.
2024-03-16 04:52:51 +01:00
Thibaut Cuvelier
7e6597a5b4 MathML: don't let the processor stretch operators when they are single characters for LyX.
The main goal is to match TeX' behaviour. If you want stretchy operators, use InsetMathDelim / \left & \right. This patch will change the output in many files, but making the rendering much closer to that of TeX (which users should expect, due to LyX' roots in TeX).
2024-03-11 02:00:47 +01:00
Thibaut Cuvelier
8f820d7ccb MathML: stop stretching all delimiters.
No form? Reference: https://w3c.github.io/mathml-core/#dfn-form. The MathML processor is smart enough to determine whether the delimiter is prefix or postfix.

No stretchy/symmetric/fence in all cases? Reference: https://w3c.github.io/mathml-core/#algorithm-for-determining-the-properties-of-an-embellished-operator and https://w3c.github.io/mathml-core/#operator-dictionary-human (example entry: U+0028). Delimiters have the right properties by default.
2024-03-11 01:40:16 +01:00
Thibaut Cuvelier
be03d69946 MathML: don't output delimiters in InsetMathBinom and
InsetMathDelim if the delimiter is a space.
2024-03-11 01:30:48 +01:00
Thibaut Cuvelier
9e6b810b37 Extract vert, langle, rangle in MathExtern like parentheses and brackets.
This patch is part of a series that aims at solving https://www.lyx.org/trac/ticket/12891. It is an excerpt of the patch that lynx published at https://www.lyx.org/trac/ticket/12270.
2024-03-11 01:22:12 +01:00
Thibaut Cuvelier
b1a4eb118c Improve const correctness. 2024-03-11 01:15:53 +01:00
Thibaut Cuvelier
93444892c5 Memorise whether delims are extracted from MathExtern.
This patch is part of a series that aims at solving https://www.lyx.org/trac/ticket/12891. It should not change any output.
2024-03-11 01:10:15 +01:00
Thibaut Cuvelier
1680eaf5f0 Reduce code duplication. 2024-03-10 16:58:45 +01:00
Thibaut Cuvelier
011c3d73c0 MathML: consider ordinary and alphabetical characters as identifiers instead of operators.
The goal is to consider all Greek letters as identifiers instead of operators.

Solves: https://www.lyx.org/trac/ticket/12948.
2024-03-09 20:59:12 +01:00
Thibaut Cuvelier
1b11dfeca5 Simplify a loop with a for-each.
These loops were brought by C++11. The next step could be using std::any_of.
2024-03-09 20:46:54 +01:00
Thibaut Cuvelier
5c5765061f DocBook: amend e3020a6b.
Book authorship and authorship can be quite distinct. As far as I know, there is no standard way to represent book authorship in DocBook bibliographies.
2024-03-01 13:45:28 +01:00
Thibaut Cuvelier
3973bbcf99 DocBook: authorsToDocBookAuthorGroup never needs to return anything. 2024-03-01 13:32:17 +01:00
Thibaut Cuvelier
e3020a6b2d DocBook: support bookauthor in bibliographies. 2024-03-01 13:22:34 +01:00
Juergen Spitzmueller
88a2414839 Do not \cprotect in table cells 2024-03-01 07:18:28 +01:00
Jean-Marc Lasgouttes
677a2c2cd1 Fixup 71d9f6e9: swap two tests to avoid line breaking issues
The new approach to line breaking introduced in 71d9f6e9 is correct,
but the newly introduced min_row_wid should not be updated when the
remaining line width after a break is larger than next_width.

Swapping the two tests fixes remaining issues.

Fixes (for good?) #12899.
2024-02-29 10:46:26 +01:00
Jean-Marc Lasgouttes
8f61b0859c Fix support for screen fractional scaling with Wayland
The display was wrong when a backing store is in use (which is the case
with Wayland). To fix this in GuiWorkArea::Private::resetScreen(), the
pixelRatio is now stored as a double instead of an int.

Concerning support for QT_SCALE_FACTOR, the existing code was wrong
because this value is already taken into account in devicePixelRatioF
for Qt > 5.6 (no fractional scaling support before that). The
situation is as follows:

                   Qt < 5.6    5.6 <= Qt < 6  Qt 6
devicePixelRatio   int(ratio)  int(ratio)     ratio
devicePixelRatioF  N/A         ratio          ratio

So it is only between Qt 5.6 and Qt 6 that devicePixelRatioF() has to
be used instead of devicePixelRatio().
QGuiApplication::devicePixelRatio() does not have a 'F' version, it
always returns the real thing.

Fixes ticket #13039.
2024-02-29 10:28:15 +01:00
Jean-Marc Lasgouttes
23105b2edd Fix compilation on ubuntu 18.04
One of Qt 5.9 or gcc 7.5 does not like the or-ing of several enum flags.
2024-02-28 17:00:54 +01:00
Jean-Marc Lasgouttes
789a886af8 fixup 97cf2b6a: avoid leak 2024-02-27 18:37:07 +01:00
Jean-Marc Lasgouttes
97cf2b6aef Avoid crash when inserting macro template in tabular inset
The issue here is that macro templates are forbidden in InsetTabular
(why? I do not know) and Text::getStatus does not enforce that
properly. Text::insertInset is called and does nothing (because
insertion is forbidden) and yet the cursor is changed to point into
this non existent inset.

Solution:

1/ block insertion of macro templates when not allowed

2/ (additional safety) when insertion of a math macro inset failed, do
   not try to set cursor inside the non-existing inset.

Additionally clarify comments.
2024-02-27 18:21:57 +01:00
Thibaut Cuvelier
27c01ee1d3 Amend 8e0bc01d
std::set::find only appeared in C++20. Rather use std::set::find for compatibility.
2024-02-27 00:45:21 +01:00
Thibaut Cuvelier
baccce7d2d DocBook: in a table, fix a typo in a condition.
Before this patch, all table cells had a semicolon at the beginning of their style:

<td style='; border-bottom:

This unwanted behaviour is only due to a typo in a condition when concatenating two styles: the previous code was checking the second part of the style once the first was output, instead of the first one.
2024-02-26 16:09:52 +01:00
Thibaut Cuvelier
8e0bc01d50 DocBook: when a similar tag is present multiple times in the bibliography entry, output it only once.
Other copies have an error message.
2024-02-26 16:06:26 +01:00
Thibaut Cuvelier
2be72a1534 DocBook: in bibliographies, fix support for editors.
Also, add TODOs for similar problems lurking around.
2024-02-26 15:52:35 +01:00
Thibaut Cuvelier
6b1441036f Use C++11 string literals to make code easier to read. 2024-02-26 15:24:36 +01:00
Thibaut Cuvelier
3fdf3aafe8 DocBook: restore index ranges. 2024-02-26 15:15:32 +01:00
Thibaut Cuvelier
5dd36404f2 DocBook: simplify building an error message. 2024-02-26 15:09:10 +01:00
Thibaut Cuvelier
c71f703914 DocBook: update bibliography handling for 337f953426. 2024-02-26 14:58:35 +01:00
Thibaut Cuvelier
e311606a30 Update comment: a function was renamed. 2024-02-26 02:17:48 +01:00
Juergen Spitzmueller
ce27f5beca Consider biblatex author -> bookauthor mapping in preview 2024-02-25 08:10:23 +01:00
Juergen Spitzmueller
43ee724fcf update tex2lyx tests
in all these cases, though, typographic rather than plain quotes should
be used.
2024-02-25 07:03:06 +01:00
Juergen Spitzmueller
82064f7bff Properly parse biblatex crossref'ed book titles 2024-02-24 15:51:35 +01:00