The situation of the convert<>() template was a mess: the header
announced that template specializations passed strings by address (my
doing long ago), but the code would just define versions that upass
strings by value.
The solution is to pass all values by address. This works very well,
_except_ when the value is a string litteral.
Defining the templates thus requires a bit of work.
Spotted by Coverity scan.
jlreq layout defined the abstract environment to be boxed
in the preamble. Doing any kind of typesetting before
all the setup has finished is error prone and may lead to
wrong output (wrong fonts for example). The correct
place to put the abstract code is right before \maketitle.
The Chinese docs loaded the ctex package in case system fonts
were used. Now, with the new support for languages with babel
and polyglossia it is no longer necessary and creates collisions.
This function is used a lot to initialize static docstrings. This is
an issue in theory because lyxerr may not have been initialized in
time.
In practice of course, lyxerr will only be used when there is a
non-ascii character in the parameter, which is really not supposed to
happen.
This gets rid of 75 coverity reports.
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.
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.
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.
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.
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.
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.
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.
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.
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.