Commit Graph

46815 Commits

Author SHA1 Message Date
Juergen Spitzmueller
d3123c16f7 initialize boolean (reported by coverity) 2024-09-07 12:55:10 +02:00
Juergen Spitzmueller
e685d31f5a use std::move() instead of copying when value is no longer used
This is mainly to shut down coverity which nowadays nags on this.
I am not sure whether we really gain something in these cases.
2024-09-07 12:50:27 +02:00
Juergen Spitzmueller
458f39cc43 Fix cut and past error (reported by coverity) 2024-09-07 12:39:45 +02:00
Juergen Spitzmueller
35b832f344 fix potential null pointer (reported by coverity) 2024-09-07 12:36:23 +02:00
Pavel Sanda
70ab623c6e * postats.py 2024-09-06 23:06:52 +02:00
Jean-Marc Lasgouttes
e5c31699b4 Remove handling of dispatched() property in BufferView::dispatch
As indicated in DispatchResult.h, this is only needed in insets'
doDispatch() methods, where lfuns can be delegated to a higher lever.
2024-09-06 16:21:47 +02:00
Jean-Marc Lasgouttes
6c20e5db7d Add ScrollType BOTTOM and TOGGLE for BufferView::scrollToCursor()
BOTTOM shows the paragraph containing the cursor at the bottom of the
work area.

TOGGLE does CENTER, then TOP, BOTTOM and finally cycles to CENTER.
This is a feature copied from emacs's C-l binding.

Add new argument "caret" to lfun "scroll" that can be used like
  scroll caret center

Change the keys (either C-l, M-l or F5) bound to screen-recenter to
"scroll caret toggle".

As an experiment, change paragraph-goto to use this scrolling method.
This can be tested when going to a heading in the outline pane.
2024-09-06 12:21:42 +02:00
Jean-Marc Lasgouttes
9c443d9651 Cleanup Page Up/Down code
Since BufferView::scroll() does not correct scrolling amount at
top/bottom anymore, remove its return value and add a new one to
BufferView::updateMetrics(bool) that returns this correction.

Rely on updateMetrics(false) to set the metrics straight after moving
the anchor y position.

Use assert_in_view = false when calling TextMetrics::editXY() because
this parameter does not work as advertised: if an inset not totally
visible, the code will not try to go inside it to look for a smaller
row that is totally visible.

Two small (hopfully useful) modifications:
- take into account the cursor X target instead of its screen position
- adapt the cursor position depending on
  lyxrc.mac_like_cursor_movement when hitting start or end of
  document.
2024-09-05 16:57:35 +02:00
Jean-Marc Lasgouttes
439b7bb9c9 Get rid of BufferView::scrollUp/Down
LFUN_SCROLL was the last user, change it to use only scroll(). Take
this opportunity to improve a bit this dispatch code.

Also improve somewhat the methods documentation.
2024-09-05 16:56:13 +02:00
Jean-Marc Lasgouttes
f52842d289 Streamline BufferView::scrollToCursor
There are two parts in this patch :

1/ in the part where the cursor is already visible, replace calls to
scroll/scrollUp/scrollDown by direct manipulation of the anchor
vertical position. Reasoning in terms of new position rather than
amount of pixels to scroll makes work easier.

2/ in the part where the cursor is set to a new TOP or CENTER
position, move the code around in order to prepare for new ScrollType
enums.

No change intended, except that CENTER now relies on the contents
dimension of the row that holds the iterator, that is without spacing
and labels.
2024-09-03 17:45:48 +02:00
Jean-Marc Lasgouttes
86d2313ce3 Simplify greatly Buffer::scroll/Up/Down methods
The code there that checks whether we scroll beyond the top/bottom of
document is not needed anymore, this is handled later by
BufferView::update(bool).

Note that this methods may disappear with time.

No change intended.
2024-09-03 15:58:55 +02:00
Jean-Marc Lasgouttes
16be88ca18 Fix update of cursor in tab-delete when there is a selection
The position of the cursor should not be decreased if it is already at
the start of the paragraph. This can lead to a crash when trying to
display the caret.
2024-08-30 16:56:16 +02:00
Jean-Marc Lasgouttes
2eb4e3d3ca Fixup 999fb37e: fix thinko
The current buffer is part of allRelatives(), contrary to what I
thought. Therefore updateId() increased the buffer id by two.
2024-08-30 15:07:03 +02:00
Jean-Marc Lasgouttes
53c8e0b77d update comments 2024-08-30 14:53:07 +02:00
Jean-Marc Lasgouttes
3c59a9a23c Remove legacy code to compute geometry
This code is not necessary anymore after the fix to #13069.

Remove the first QString argument to createView(). Set the autoShow
parameter to false by default and rename createView(id) to
createAndShowView(id) to avoid member function overloading issues.

Remove optional <GEOMETRY> argument of window-new lfun.
Document the removal of the argument in release notes.
2024-08-30 14:45:36 +02:00
Kornel Benko
8c14748e78 Amend 18c310a8 for cmake build: Get rid of QPA_XCB define 2024-08-30 14:08:05 +02:00
Jean-Marc Lasgouttes
18c310a8cf Get rid of QPA_XCB define
Since the platform is selected at run time (e.g. xcb vs. Wayland), it
is not a good idea to decide at compile time what code is run. Another
example is on macOS, where having xcb libraries available will lead to
lauching the Xquartz whenever LyX is running.

With this patch, things are separated:
- the code is run when run-time platform is "xcb".
- the support code is compiled in when xcb header and libraries are
  available.

Fixes ticket #13086.
2024-08-30 11:27:17 +02:00
Jean-Marc Lasgouttes
ce9de28f06 Streamline -geometry command-line option support
Instead of baking our own support for -geometry command line option on
Windows (Qt only does that for Xcb), use the fact that Qt 5 provides
the equivalent -qwindowgeometry flag.

All we need to do is to replace the -geometry option with -qwindowgeometry.

This is part of the effort in ticket #13086 to get rid of the
compile-time QPA_XCB define.
2024-08-30 11:15:02 +02:00
Kornel Benko
3bc4554e57 Amend f1fddd86
Add defines for HAVE_XCB_XCB_H and HAVE_LIBXCB to cmake build
2024-08-29 14:13:12 +02:00
Kornel Benko
f1fddd86ef Cmake build: Add defines for HAVE_XCB_XCB_H and HAVE_LIBXCB 2024-08-29 14:08:39 +02:00
Jürgen Spitzmüller
b0a2aa5aa5 Add missing Spanish modifier 2024-08-28 09:23:35 +02:00
Jean-Marc Lasgouttes
52ec69a1af Force a metrics update of buffer after reload
It makes reload more robust and is in any case good enough to avoid
crash in #139091.

Fixes bug #13091.
2024-08-27 00:09:04 +02:00
Enrico Forestieri
7e1d7036ee Update it.po 2024-08-26 14:29:32 +02:00
Kornel Benko
ca55986bc7 Update sk.po 2024-08-26 12:10:28 +02:00
Juergen Spitzmueller
8205458857 Reset lang_options before reading headers 2024-08-26 07:35:34 +02:00
Juergen Spitzmueller
b1b8ded15d output babel options via \babelprovide in all cases needed 2024-08-26 07:20:58 +02:00
Juergen Spitzmueller
686b55e70d Amend fc605cf138
Use proper option if main and a secondary language have BabelProvide 2
2024-08-25 18:01:26 +02:00
Juergen Spitzmueller
68b7378db8 Another language GUI string improvement 2024-08-25 16:20:42 +02:00
Juergen Spitzmueller
5a1430dd43 de.po 2024-08-25 15:50:30 +02:00
Juergen Spitzmueller
1abfc116ff Clarify usablity of language support variants in GUI string 2024-08-25 15:45:18 +02:00
Juergen Spitzmueller
5a0ec69a79 Farsi and Arabic need BabelProvide 2, too 2024-08-25 15:31:14 +02:00
Juergen Spitzmueller
17ca2ac89c Properly set the babel bidi option (#12862) 2024-08-25 15:21:56 +02:00
Juergen Spitzmueller
fc605cf138 Add proper support for BabelProvide 2
We need to instruct babel not to load an existing ldf in this case
2024-08-25 14:56:05 +02:00
Juergen Spitzmueller
8aaaa53c5b Fix typo 2024-08-25 14:08:33 +02:00
Juergen Spitzmueller
5d2bf38a90 de.po 2024-08-25 14:06:54 +02:00
Juergen Spitzmueller
b9bb585d06 Fix GUI string 2024-08-25 14:00:44 +02:00
Juergen Spitzmueller
1ba7f104bf Fix typo in UI file 2024-08-25 13:39:18 +02:00
Juergen Spitzmueller
9e5bf47a68 Update tex2lyx tests 2024-08-25 13:26:06 +02:00
Juergen Spitzmueller
66aa0d8699 Avoid empty option in babelCall 2024-08-25 13:23:57 +02:00
Juergen Spitzmueller
b625138be6 Add support for the following languages
Polyglossia:
Chinese (Simplified), Chinese (Traditional), Japanese, Kurdish (Sorani),
Latin (Classic), Latin (Ecclesiastic), Latin (Medieval), N'ko, Odia,
Punjabi, and Uyghur

Babel:
Amharic, Armenian, Asturian, Bengali, Church Slavonic, Coptic, Divehi,
Kannada, Kazakh, Khmer, Kurdish (Sorani), Lao, Latin (Classic),
Latin (Ecclesiastic), Latin (Medieval), Malayalam, Marathi, N'ko,
Occitan, Odia, Punjabi, Russian (Petrine orthography), Sanskrit, Syriac,
Tamil, Telugu, Tibetan, Urdu, and Uyghur
2024-08-25 13:22:07 +02:00
José Matos
d06a034578 Python 3.13 removed the pipes module from the standard library
That module was a wrapper over the popen module and it was scheduled to
be removed in Python 3.11.

This code is also compatible with Python 2.
2024-08-25 10:14:18 +01:00
Kornel Benko
648f6a3d45 Update sk.po 2024-08-25 11:15:01 +02:00
Juergen Spitzmueller
a2629b8eab Assure OK/Apply button is initially disabled in InsetParamsDialogs (#8927) 2024-08-25 10:18:38 +02:00
Juergen Spitzmueller
d0fe7fcb7b Some more language TODOs
Obviously, we can support all languages that have so far only been
provided via polyglossia with babel(provide)
2024-08-25 10:10:00 +02:00
Juergen Spitzmueller
b322ecb483 Load Ancient Greek and Mexican Spanish via \babelprovide
In classic babel, these varieties are only available via modifiers
or attributes, which means that they could only be used instead rather
than in addition to the default variety
2024-08-25 09:48:04 +02:00
Juergen Spitzmueller
047dee5a3b Basic support for \babelprovide
This is the new(er) babel mechanism to load languages via babel *.ini
files.

Some languages (or varieties) are only supported this way, some work
better with unicode engines this way (for the latter case, we have
BabelProvide 2)
2024-08-25 09:46:29 +02:00
Juergen Spitzmueller
ac509f3b6e spell out all polyglossia variants (required if varieties are mixed) 2024-08-24 15:53:01 +02:00
Juergen Spitzmueller
3038a8bc04 Some more language TODOs 2024-08-24 15:43:58 +02:00
Juergen Spitzmueller
b249140cf1 Update some polyglossia names
and add TODOs for not yet supported polyglossia languages
2024-08-24 15:10:20 +02:00
Juergen Spitzmueller
7e09f574ba Add BabelOpts to languages
This way, some settings that were hardcoded in BabelPreamble are
customizable in document settings
2024-08-24 14:30:37 +02:00