Commit Graph

46488 Commits

Author SHA1 Message Date
Juergen Spitzmueller
6ef18c3583 Limit the nopassthurchars case in beamer to URL
and also generally extend to classes that provide hyperref
2024-05-20 08:26:03 +02:00
Thibaut Cuvelier
2d86b88124 XHTML: export paragraph IDs also for list items, but not for the opening tag of the list.
The IDs are used to link to specific elements (for instance, the User's guide nomenclature).

The beginning of the list (<ul> or <ol>) has the same magic ID as the first item of the list.
2024-05-20 03:21:00 +02:00
Thibaut Cuvelier
a4f675a040 XHTML: fix typo in comment. 2024-05-20 03:11:41 +02:00
Thibaut Cuvelier
f2660d172c InsetGraphics: use the scale CSS property instead of width with percentages.
The effect is closer to what LyX offers. Previously, the percentage was of the HTML container (often, the whole page), meaning that images were oversized. Now, the scale is respected in the same way as LyX, but its bounding box is off. Overall, the result is better, but not what users expect.
2024-05-20 01:10:05 +02:00
Richard Kimberly Heck
de5f63eeb3 Return a reference, not a copy.
Stupid mistake from 2009. Thanks to Scott and JMarc for tracking
it down.
2024-05-19 16:55:48 -04:00
Scott Kostyshak
d773a2a327 ctests: automatically invert more lyxbugs files
Only files in the directory with a trac number prefixed were
inverted.

Now files with a Git short hash (length 7 or 8) are additionally
inverted.
2024-05-19 12:23:25 -04:00
Scott Kostyshak
d61bf9f166 Test file with knitr chunk in beamer
This file fails to compile starting with ed62816e.
2024-05-19 12:17:10 -04:00
Thibaut Cuvelier
7cfe36e6aa InsetInfo: no need to output + explicitly in a shortcut, it is already contained in the sequence. 2024-05-18 19:41:44 +02:00
Thibaut Cuvelier
e3f2b10842 Make comment clearer. 2024-05-18 19:38:52 +02:00
Kornel Benko
6670870aa3 Cmake build: Set LYX_DATA_SUBDIR in cache unconditionaly
The value is wrong if CMakeCache.txt already exists and the version is
changed inside configure.ac in AC_INIT()
2024-05-18 10:27:54 +02:00
Scott Kostyshak
05bb851adf Comment typo 2024-05-17 12:18:09 -04:00
Jean-Marc Lasgouttes
145af7c2ac Fix up a4d9315b: handle metrics of not visible paragraphs
The code is not ready for situations where some paragraphs that are
not visible have metrics available. This has been made visible by
a4d9315b, which removes a couple of full metrics updates: the screen
was not correctly scrolled after a scrollToCursor() call.

In PararagraphMetrics, some methods are added to be able to handle the
fact that paragraphs have or do not have a position.

In TextMetrics, a new method returns the first visible paragraph.

Finally, in BufferView::updateMetrics, the paragraphs' positions are
reset (in the case where everything is not cleared) and some care is
taken to skip the ones that are not relevant.

The assumption outside of this method is that all the paragraphs that
are in the TextMetrics are visible (we are talking about top-level
TextMetrics here). This could be changed (in order to avoid
recomputing paragraph metrics), but the cost is high in terms of
complexity and it is not clear that the gain in terms of performance
would be important.
2024-05-17 17:39:09 +02:00
Kornel Benko
5a10c652a3 Update sk.po 2024-05-17 12:09:37 +02:00
Jean-Marc Lasgouttes
b469c142ad Fix display of math hull inset in RTL context
The inversion of margin was done in the wrong way for RTL support.
2024-05-16 14:56:28 +02:00
Juergen Spitzmueller
2d95f8fc16 Amend 207eaeee90
The upstream encoding needs to be updated after this routine
(see comment in OutputParams.h:183ff.)
2024-05-16 07:33:29 +02:00
Juergen Spitzmueller
c23f731fae mumble 2024-05-15 18:36:47 +02:00
Juergen Spitzmueller
9d43fd2ae1 # and % need to be escaped in hyperref URL as well
Also fix some lyx2lyx glitches

This hopefully fixes the test issues.
2024-05-15 13:15:08 +02:00
Scott Kostyshak
c18f02967d Update tex2lyx tests
Needed after the file format change.
2024-05-15 00:27:27 -04:00
Juergen Spitzmueller
af59551b1b Amend a716fb96b5 2024-05-14 13:54:00 +02:00
Juergen Spitzmueller
227ce773bf Document a716fb96b5 2024-05-14 13:38:16 +02:00
Juergen Spitzmueller
a716fb96b5 NeedCProtect -1 also for InsetLayouts 2024-05-14 13:37:29 +02:00
Juergen Spitzmueller
2306082787 Revert false chunk 2024-05-14 13:21:55 +02:00
Juergen Spitzmueller
9dae88a15a Whitespace 2024-05-14 13:18:05 +02:00
Juergen Spitzmueller
1512216909 Fix comment 2024-05-13 10:26:45 +02:00
Juergen Spitzmueller
52d31155c1 Properly escape backslash in URLs with hyperref (#13012) 2024-05-13 09:17:30 +02:00
Juergen Spitzmueller
ed62816eb6 Handle URL escaping in beamer frames
File format change -- this introduces the first LyX 2.5 format and
hence sets up the lyx2lyx machinery
2024-05-13 07:26:41 +02:00
Juergen Spitzmueller
eeb3f9e719 Amend 207eaeee90
FragileFrame, as opposed to normal frame, supports cprotect (and needs
it in the usual circumstances)
2024-05-12 08:52:09 +02:00
Juergen Spitzmueller
a2fb7b3566 Document 207eaeee90 2024-05-12 07:54:04 +02:00
Juergen Spitzmueller
207eaeee90 Introduce NeedCProtect -1 layout option
It turns out beamer frame does not allow \cprotect and errors if it is
used. Hence we need to prevent it in this context entirely.
2024-05-12 07:52:16 +02:00
Juergen Spitzmueller
fe4f0dbf0b Consider CT in dash mechanism (#13062) 2024-05-11 13:07:32 +02:00
Jean-Marc Lasgouttes
6b3ced7c07 one less place where metrics have to be recomputed 2024-05-09 11:50:18 +02:00
Jean-Marc Lasgouttes
d4f3e87b14 typo 2024-05-09 11:45:55 +02:00
Jean-Marc Lasgouttes
ec9d0a9420 Fixup 527984ed: fix initial screen size when using backing store
When using a back store, it is obviously important to resize it
whenever the buffer view is resized. The new code path added in
527984ed skipped this part, so that the window was wrong when creating
a new window.
2024-05-07 12:01:34 +02:00
Jean-Marc Lasgouttes
9f33db8f53 Fix up 5577e877: remove logic error
Commit 5577e877 introduces forceUpdateBuffer() to delay actual
updatBuffer() calls to a central place.

In Cursor::upDownInText, the updateNeeded flag (which triggers
Update::Force update flag) is set to true when Cursor::checkDepm
returns true. This is fine, except that checkDepm also leads to a
forceBufferUpdate() call.

The logic in the method was such that, when updateNeeded is already
true when entering, forceBufferUpdate() will be called even though
checkDepm did not request it.

Fixes a slight delay with selecting in MergedManual (the manual of
manuals).
2024-05-03 14:38:32 +02:00
Jean-Marc Lasgouttes
f58957747a Fixup 2660df9b99: missing stuff after moving Lexer to support/ 2024-05-01 16:54:10 +02:00
Jean-Marc Lasgouttes
a4d9315bc4 Avoid full metrics computation with Update:FitCursor
The handling of Update::FitCursor traditionnally recomputes all
metrics once or twice. Now that updateMetrics(false) ensures that all
paragraphs that require it have a metrics, we might as well use that.

Take this occasion to move handling of Update::SinglePar earlier,
before the check for Update::ForceDraw.
2024-04-30 15:18:13 +02:00
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
623cc13b60 Autotools: optimize with -Og when debugging
When debug (-g) is enabled (default when compiling a development
version), the existing -O optimization level is not correct, since
many variables are optimized out when debugging.

Use -Og instead, and condition not on compiling a development version,
but on --enable-debug. This is the same by default, but it more
precise in our case.
2024-04-25 12:30:48 +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
Pavel Sanda
358efd120a * metainfo.xml - homepage missing 2024-04-21 03:49:12 +02:00
Scott Kostyshak
dd4c67bfdc Whitespace 2024-04-20 14:22:07 -04:00
Kornel Benko
ba880319e8 Update sk.po 2024-04-20 20:06:27 +02:00