Commit Graph

28216 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
f400a2cfa9 Force redraw after completion
Inside a math inset when completing macro names, it could lead to crashes.

Note that this processUpdateFlags is present when outside of this if() branch.
2022-01-28 17:13:30 +01:00
José Matos
79a2ac575c Replace $${python} directly in the converter constructor 2022-01-27 18:32:57 +00:00
José Matos
b73ab0256d Fix compilation with gcc-12 2022-01-27 15:37:45 +00:00
Jean-Marc Lasgouttes
2da183bf4f Check layout type when inserting inset over selection
When inserting inset over a selection, the layout is transferred if
the inset covers full paragraphs.

This is not the right policy in the case of environments. Until proper
code is written and tested, limit ourselves to command layouts.

Fixes bug #12251.
2022-01-24 19:24:52 +01:00
Jean-Marc Lasgouttes
6c98ac5a7b Fix breaking of MANUAL_LABEL paragraph when label is too long
Typical example is a Labeling layout which label is an inline equation
larger than the screen. Before this commit, the row would not get
broken at all.

Two parts in the patch:

1/ when breaking the row in shortenIfNeeded, mark the last element as
   AlwaysBreakAfter instead of BreakAfter, in case the next element is
   NoBreakBefore.

2/ when nothing could be done, as last resort keep the first element
   of the row only.
2022-01-23 21:21:25 +01:00
Kornel Benko
f8f86a1a81 Next runtime messages to be ommitted if compiled with clang using flag '-fsanitize'.
Prevent the return of impossible values for 'enum flags'.
For instance the result of '~Update::Force' at src/BufferView.cpp:3025 without this patch
is '4294967293'.
2022-01-23 20:13:26 +01:00
Jean-Marc Lasgouttes
ec3a44fef5 brkstr2str_pos: avoid case where length is negative
The string that Qt sees is not the original string, since we add
zero-width nonbreaking spaces around it, plus an override character to
force rendering direction. This means that translating positions
between these two representation can be a bit tricky.

We use a max(foo, 0) here to make sure that our intermediate
computation is postive.

Fixes part of bug #12452.
2022-01-23 19:34:11 +01:00
Juergen Spitzmueller
942538c02d Fix bug 12459
When checking for branch color, take into account that some branches
are defined in the master document only, some only in the child.
2022-01-22 09:30:25 +01:00
Kornel Benko
2764ed20c2 Omit runtime messages if compiled with clang using flag '-fsanitize'.
Setting sufficiently high value allows to use
ColorCode enums for new up to 32000 branch insets.
Previous setting printed messages if using more than 25 new branch insets.
"'ColorCode' ... src/Color.cpp:435:10: runtime error:
load of value 128, which is not a valid value for type"
2022-01-21 11:02:09 +01:00
Jean-Marc Lasgouttes
a64244b844 Fixup 7485225c: better placement of deph bar
Fixes #12243.
2022-01-20 21:51:51 +01:00
Jean-Marc Lasgouttes
da3c3796ee Make LABEL_MANUAL label breakable when larger than the screen.
This is what the situation was in 2.3.X.
2022-01-17 18:27:25 +01:00
Jean-Marc Lasgouttes
6f7505300e When clearing a row, always clear the whole text area width
It is not a good idea to take into account the horizontal scrolling
that may have happened. For example, this leads to display glitches
when a Description label is larger than text width.

This explains why SingleParUpdate strategy did not work with home/end
on a long row.
2022-01-17 17:35:12 +01:00
Jean-Marc Lasgouttes
4f158ecfc8 Fix computation of LABEL_MANUAL label separation
The spacing of Labeling, Description and friends shall be computed
when breaking the row, not when tokenizing it. Indeed, this is the
right place to determine its correct value.

To this end add a new MARGINSPACE row element type.

This allows to remove TextMetrics::labelEnd, which is not used anymore.
2022-01-17 17:35:12 +01:00
Jean-Marc Lasgouttes
c638caddd8 Compilation fix for Qt4 2022-01-13 19:35:12 +01:00
Jean-Marc Lasgouttes
854fbc5262 Revert "Add UI for selecting backing store drawing strategy"
The need for this variable is too rare to deserve being exposed in UI.

This reverts commit a3fd3a09f1.
2022-01-13 17:09:42 +01:00
Jean-Marc Lasgouttes
61d062633c Better handling of trailing spaces in rows.
When a string is broken at the margin by the Qt algorithm, the space
at which breaking occurred is automatically skipped in width
computation. However, the ending space of the string is taken into
account and is visible for example at paragraph end.

When the trailing space is followed by a displayed inset, then the
space should be skipped too, which means that the width of the last
row element has to be recomputed. For the sake of performance, the
width of the element without trailing spaces is computed in advance in
FontMetrics::breakString.

This "no space" width will be used when trimming a row element of its trailing
spaces instead of the original one.

Additionally, do not trim trailing spaces when the row is flushed.

Fixes bug #12449.
2022-01-13 16:49:59 +01:00
Stephan Witt
678ab325c0 #12423 fix a focus change problem
The search widget triggers a showEvent() in updateTitle() leading to setting the focus to the default push button.
The check in updateTitle() for the need to restore the title avoids superfluous show events and avoids the unwanted focus change.
2022-01-09 22:33:43 +01:00
Stephan Witt
22045e455a #12434 add GUI debug messages for pinch-to-zoom gesture 2022-01-09 12:29:23 +01:00
Daniel Ramoeller
7134ebd793 Pinch to zoom fix
Amendment to fix for #12434.
2022-01-09 12:29:23 +01:00
Jean-Marc Lasgouttes
65394e1907 fix file name 2022-01-08 23:03:50 +01:00
Stephan Witt
d9b9307d14 #12451 Adjust color cache on change of dark/light mode 2022-01-05 08:26:45 +01:00
Jean-Marc Lasgouttes
d44c63e2c6 Set current cursor font when toggling emphasize
The change actually works for all font toggling with implicit selection.

Fixes bug #12450.
2022-01-04 18:58:55 +01:00
José Matos
109ea2be4a Add new placeholder $${python} to configure
This ensures that we use a consistent Python interpreter in LyX.

$${python} is replaced by the Python version found.

Users can apply this in preferences and use the same version defined by
LyX.
2022-01-04 00:21:34 +00:00
Scott Kostyshak
13a7269b9d Change LFUN arg from "zoom" to "zoomlevel"
This change is just to be more specific, to help when grepping and
reading.

The idea is from Daniel
(https://www.lyx.org/trac/ticket/12420?replyto=11#comment:11).

Amends cc787967 (and thus 49a17aaa).
2022-01-03 15:57:35 -05:00
Stephan Witt
11d42ac3df Remove temporary code comment. 2022-01-03 10:44:02 +01:00
Stephan Witt
d432403430 #12434 add event handler for pinch-to-zoom gesture 2022-01-03 07:37:03 +01:00
Enrico Forestieri
d4cfa5204c Fix bug #12447
Due to a thinko at 1fe75ae7 the code was not using the correct index.
2022-01-02 18:49:44 +01:00
Stephan Witt
df990b1027 Guard new code for builds with OS X 10.11 SDK and lesser (part 2). 2022-01-01 18:47:57 +01:00
Stephan Witt
718b735dfe Guard new code for builds with OS X 10.11 SDK and lesser. 2022-01-01 18:46:32 +01:00
Stephan Witt
47c92834df Correct white space. 2022-01-01 16:37:07 +01:00
Stephan Witt
2125863874 Qt6 QFontDatabase is a pure static class. Call the member functions directly. 2022-01-01 10:06:07 +01:00
Juergen Spitzmueller
64a60c72ea GuiGraphics: disable "Read from file" button if the values do not differ 2021-12-31 14:32:59 +01:00
Juergen Spitzmueller
8f3fdafd9e GuiGraphics: check more carefully whether we have a changed BB 2021-12-31 14:32:13 +01:00
Juergen Spitzmueller
ec722f3a48 GuiGraphics: read the BB values also for new graphics
that aren't in the cache yet.
2021-12-31 14:30:09 +01:00
Jean-Marc Lasgouttes
0789f2f2ae Fix font inside footnote inset
An inset that resets its font (like Footnote) does not care at all
about enclosing font. Therefore the real starting point is the class
default font. This avoid cases where the footnote contents is forced
to \normalsize.

It turns out that the Greyedout note inset, did inherit font but was
declared as not doing it. This commmit changes the definition by
adding \normalfont\normalsize so that no inheritance happens.

Note that actually \normalfont resets everything but the font size.
This does not matter for footnote (which has its own font size) and
greyedout (which is fixed now), but may matter elsewhere. Also, I do
not know what the situation with HTML is.
2021-12-31 13:40:53 +01:00
Scott Kostyshak
4bdb1ca4c2 Add comment regarding fsanitize + Clang issue
We could not figure out the root issue, or at least not to the point
where we felt changing this code considering we could not trigger
any bug from a user perspective.

For now, we just add a comment in the code.

For more information, see our ML discussion here:

  https://www.mail-archive.com/search?l=mid&q=20211227113249.53bf5a63%40admin1-desktop
2021-12-30 11:39:04 -05:00
Juergen Spitzmueller
095e533be9 Fix language environment with environments at inset begin/end (#12352) 2021-12-29 16:07:40 +01:00
Stephan Witt
f22c5c3c3f Remove unused local variable 2021-12-29 15:33:44 +01:00
Juergen Spitzmueller
0f2d711f34 Fix TOC filtering with slashes (#12359)
Seems the * wildcard does not match these.
2021-12-29 14:43:52 +01:00
Jean-Marc Lasgouttes
dbd33f6622 When row if empty, set endpos correctly. 2021-12-28 18:48:55 +01:00
Juergen Spitzmueller
d1761d7652 Style 2021-12-28 09:42:31 +01:00
Scott Kostyshak
9ffca92930 Allow toggling of Zoom elements without buffer
The elements are shown without a buffer so it's nice to be able to
toggle without one as well.
2021-12-27 13:43:19 -05:00
Daniel Ramoeller
eae56b1194 Hide the zoom in the status bar from the status bar context menu
Fix for #12420.
2021-12-27 13:43:19 -05:00
Jean-Marc Lasgouttes
7ab3c59f00 Typo 2021-12-27 19:38:10 +01:00
Juergen Spitzmueller
a7905c5b96 Do not protect \\ as of LaTeX 2021/06/01 2021-12-27 16:32:12 +01:00
Juergen Spitzmueller
6ac60832e5 Add FIXME 2021-12-27 12:09:02 +01:00
Juergen Spitzmueller
a5b7eeacaa Remove remaining math cprotection test.
We'll see if someone comes up with a reproducible case, and if so,
whether ordinary protection works here as well.

See #6243
2021-12-27 11:52:25 +01:00
Juergen Spitzmueller
582fe0990f \protect xymatrix in fragile context
(\cprotect'ion not needed then).
2021-12-27 11:42:30 +01:00
Juergen Spitzmueller
596b2d16ee \protect substack in fragile context
(\cprotect'ion not needed then).
2021-12-27 11:37:59 +01:00
Juergen Spitzmueller
3e4c831f1e Remove obsolete \cprotect'ion (#6243) 2021-12-27 10:24:58 +01:00
Jean-Marc Lasgouttes
542445d07d When pasting text, keep line breaks when "parbreak is newline"
This is much easier for listings, ERT or Verbatim.

Fixes bug #8026.
2021-12-26 20:22:01 +01:00
Thibaut Cuvelier
51e92a5a97 DocBook: more explicit comment. 2021-12-26 02:26:50 +01:00
Thibaut Cuvelier
4c27a7307e Amend c734504d to fix a very bad nullptr dereferencing... 2021-12-26 02:24:06 +01:00
Thibaut Cuvelier
81274c8da7 Remove code that has been commented out for a long time. 2021-12-26 02:14:49 +01:00
Thibaut Cuvelier
c734504d3b DocBook: in InsetFloat, detect the presence of a caption by generating it.
This catches the case where the caption only contains a comment, as in export/export/latex/lyxbugs-resolved/cprotect/9313-comment-in-figure-float-caption. No duplicate work is performed to ensure the same level of performance as before.
2021-12-24 01:08:24 +01:00
Kornel Benko
942121f4b6 FindAdv: Added handling of some missing Hebrew characters 2021-12-21 14:16:49 +01:00
Juergen Spitzmueller
c2f2ba57f1 Do not repeatedly call main_font_encoding()
This method impacts on performance and we store the value anyway in
the output params.
2021-12-20 12:09:12 +01:00
Juergen Spitzmueller
61b8afd893 Paragraph::needsCProtection(): use inset list
rather than checking each pos whether it's an inset or not.

This was a significant performance bottleneck (particularly getInset()
itself seems slow).
2021-12-19 15:39:49 +01:00
Jean-Marc Lasgouttes
a3fd3a09f1 Add UI for selecting backing store drawing strategy
The checkbox is hidden when backing store is enforced (wayland,
macOS). In practice, only X11 and Windows users will see it ; I only
have evidence of X11 people needing it, I can hide it for Windows
users too if necessary.

Fixes bug #12119.
2021-12-17 15:16:35 +01:00
Jean-Marc Lasgouttes
c213eb7f75 Add lyxrc option to force the use of backing store
LyX relies on a a backing store to draw when running under macOS or
Wayland, because Qt arbitrarily overwrites parts of the workarea
before we paint (and we paint only the parts that need to be painted).
However it seems that this is also necessary on X11 when the WM theme
is translucid. Since there is no way that I know of to detect this
situation, this patch adds a LyXRC setting to manually select this
drawing strategy.

Note that using a backing store is not always a good solution, since
this disables subpixel aliasing.

At this point there is no UI for the variable.

Fixes bug #12119
2021-12-17 10:38:28 +01:00
Scott Kostyshak
056ab33f48 Amend bea7ef04e (find's auto-wrap by default)
The default in the .ui is not considered in
GuiSearchWidget::restoreSession(), which sets a hard-coded default
if the stored setting is not found in the session file.

I'll start an ML discussion for whether the code in restoreSession()
should use the ui's default if the setting is not found in the
session.
2021-12-15 20:51:50 -05:00
Jean-Marc Lasgouttes
62ad205dbf Avoid duplication of words on screen
When giving up splitting a word sequence because it is not enough to
make the row short enough, make sure to clean up properly.
2021-12-15 11:19:18 +01:00
Stephan Witt
4665baac46 Fix an overloaded-virtual warning for type mismatch of event parameter (Qt6) 2021-12-09 21:59:23 +01:00
Jean-Marc Lasgouttes
dcef1a9cad Fix endless loop when breaking text
For some reason, Qt can break strings before the first character
(although we try to prevent that). The code was not prepared to that,
now it is.

Remove a forgotten debug statement.
2021-12-09 16:56:09 +01:00
Thibaut Cuvelier
7513d88350 MathML: remove redundant mrow in InsetMathScript.
https://www.lyx.org/trac/attachment/ticket/12221/0006-amends-to-a579128c-a68e9793-a68e9793.patch by lynx
2021-12-08 02:11:48 +01:00
Thibaut Cuvelier
d1daa092f6 MathML: share some code for XArrow. 2021-12-08 02:02:46 +01:00
Thibaut Cuvelier
e5eef14414 MathML: refactor the XArrow mappings as maps. 2021-12-08 02:02:46 +01:00
Thibaut Cuvelier
f0bf41f574 MathML: allow XArrow to stretch.
Based on https://www.lyx.org/trac/ticket/12221#comment:10
by lynx
2021-12-08 02:02:46 +01:00
Stephan Witt
0e0b76a76e Restore correct version check for AA_UseHighDpiPixmaps - amend change ae56fb6171 2021-12-07 23:01:47 +01:00
Jean-Marc Lasgouttes
2fd8b6fc2a Fix the way the top and bottom selection are drawn
When a selection extends on more than a row, the space between the two
rows should always be painted in full. Otherwise, with layouts like
Chapter, the "Chapter" label may seem selected in part.
2021-12-07 18:15:01 +01:00
Jean-Marc Lasgouttes
572b06d640 Increase metrics cache maximal size
Increase the maximal size of the breakString cache (to compute where
to break lines) from 512kB to 10MB. This has a big impact of cache
hits on large file like the example in #12297, which is now 99%. On
this example the time taken by breakString decreases from 33.5us to
2.4us.

The string width cache has been increased fro 512kB to 1MB, but this
does not make such a big difference.

Additionally, comments and variable names have been improved.

Related to bug #12297.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
5966d4fb8d Improve row flushing
Add new row flags Flush and FlushBefore to let insets indicate whether
they cause flushing of current row (eg. newline) or of previous row
(e.g. display insets).
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
a06f0e48ec Simplify setting of RTL in rows
Set RTL status at row creation, which allows to remove a parameter from
cleanupRow.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
d723b90344 Break multi-row strings in one pass
Replace FontMetrics::breakAt, which returned the next break point,
with FontMetrics::breakString, which returns a vector of break points.
To this end, an additional parameter gives the available width for
next rows.

Rename various variables and methods accordingly. Factor the code in
breakString_helper to be more manageable.

Adapt Row::Element::splitAt to return a bool on sucess and provide
remaining row elements in a vector. The width noted above has been
added as parameters.

Rename the helper function splitFrom to moveElements and rewrite the
code to be more efficient.

Remove type of row element INVALID, which is not needed anymore.

The code in TextMetrics::breakParagraph is now much simpler.

In Row::finalize, remove the code that computed inconditionnally the
current element size, and make sure that this width will be computed
in all code paths of Row::Element::splitAt.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
71c2e2fda6 Add operator<< for Row::Elements
This is useful for debugging.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
4b69f5efa7 Fix setting of row pos/endpos (overlapping rows)
In TextMetrics::breakParagraph, get rid of the fragile `pos' local
variable, which was not correctly updated. Rely on the endpos of the
last element in row instead.

Rewrite cleanupRow to rely on the endpos of last the row element to
set row endpos, instead of a `pos' parameter.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
4120635185 Get rid of need_new_row boolean in breakParagraph
Instead of having breakParagraph decide when breaking a row is
necessary, let Row::shortenIfNeeded set the row_flag of the last
element to request a row break. This was already done in splitAt.

This is in preparation of splitAt splitting in more than two elements.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
ef6dfe18c2 Centralize the code that removes trailing spaces from end row element.
Move to Row::Element::rtrim the code in Row::shortenIfNeeded that
removes trailing spaces from last element in row, so that it can be
called when actually breaking a row.

Fixes bug found by Kornel.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
6e6976fbc5 Handle the case where breakAt cuts after trailing space
In this case, the extra element returned should empty but valid. The
row flag BreakAfter is set to indicate that we have a break there
(this principle will be used more generally in a forthcoming commit).

To detect that we cut at the trailing space, it is necessary to rely
on the difference between QTextLine::horizontalAdvance() and
QTextLine::naturalTextWidth() when the flag
QTextOption::IncludeTrailingSpaces is used: the trailing space is
taken into account in the later, but not in the former.

Somme comments have been added to make code intent clearer.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
6bc50fea3a Workaround for Qt 4
At least with Qt 4.8.7 on Ubuntu 16.04, QTextLine::lineWidth() can
return a bogus value, at least with Courier font. One hypothesis is
that the invisible characters that we use in breakAt_helper are given
a non-null width.

Work around it, although the exact bug has not been pinpointed.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
d694701315 Last step of transition: use sortenIfNeeded again.
Change semantics of Row::shortenIfNeeded: instead of breaking the row
and returning a boolean, it returns the list of row elements that have
been removed (or broken) from the row. The logic of the method remains
the same.

Use shortenIfNeeded in breakParagraph. This was the last missing block.

Remove Row::breakAt and the old breakRow. Only bugs remain now :)
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
0ea1807a52 Implement handling of row_flags for row breaking
To this end, add the helper function needsRowBreak which computes the
effect of two consecutive row flags. This function implements the
priorities described in RowFlags.h.

This function is called with the relevant flags, or NoBreak* when at
boundaries and updates need_new_row.

Some common code is factored in a new cleanupRow() helper.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
890fcc0872 Change the way the element's width is updated.
Remove the code that computed the width every 30 characters (yay!).
Make sure that finalizeLast() is called after inserting a row element in
a row in breakParagraph.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
49115315ea Introduce helper template to simplify breakParagraph code
This is a semi-generic iterator for iterating over a container and
pretend that we add elements to it along the way.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
df688126ca A set of easy fixes and missing features
* show changebar when end of paragraph is changed.

* when row is finished, set endpos and right_boundary

* handle bidi.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
0a18a4e763 Use the new tokenizing and breaking code instead of breakRow. 2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
ef88e31a1f Break the paragraph's big row according to margins
Still many features missing:
- handle insets that break rows (display math, newline, ...)
- handle rows that are too long by replacing the single call to
  breakAt with a call to a reworked Row::shortenIfNeeded.
- some easy things at the end of breakRow (bidi text, etc.).
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
963a0aa466 Implement Row::Element::row_flags
Move the enum definition RowFlags in its own include file, to avoid
loading Inset.h. Document it more thoroughly.

Rename RowAfter to AlwaysBreakAfter.

Add CanBreakInside (rows that can be themselves broken). This allow to
differentiate elements before bodyPos() and allows to remove a
parameter to shortenIfNeeded().

Make the Inset::rowFlags() method return int instead of RowFlags, as
should be done for all the bitwise flags. Remove the hand-made bitwise
operators.

Set R::E::row_flags when creating elements.
* INSET elements use the inset's rowFLags();
* virtual element forbid breaking before them, and inherit the *After
  flags from the previous element of the row;
* STRING elements usr CanBreakInside, except before bodyPos.

More stuff may be added later.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
f4d3702d4d Create new method TM::tokenizeParagraph
This contains large parts of breakRow, but creates a unique row for the paragraph.

The parts taken or not in redoParagraph are annotated.

The new method is not used yet.
2021-12-07 17:04:46 +01:00
Jean-Marc Lasgouttes
a558f78aa5 Small Row cleanups
Move declaration of RowList to Row.h

Move initialization of POD members of Row and Row::Element to declaration.

Make method isVirtual() depend on type.

Add new row element type INVALID and method isValid()

Make methods R::E::left/right_pos inline.

Add method R::E::splitAt() that returns an element containing the
remaining stuff, or an invalid element if nothing was split. breakAt
is now a simple wrapper around this function.

Add method R::push_back().
2021-12-07 17:04:46 +01:00
Jean-Marc Lasgouttes
1831f6caac Change FontMetrics::breakAt to return a position
Since we intend to break the row element in two, it is not good to
truncate the string too early.

Moreover, the row element width is now set at this point, even if no
breaking occurs.
2021-12-07 17:04:46 +01:00
Stephan Witt
ae56fb6171 Qt6 pixmaps are always HiDPI - avoid deprecate warning for setAttribute 2021-12-07 10:02:05 +01:00
Thibaut Cuvelier
489bf46a03 DocBook: recognise Tufte's float types (margin*). 2021-12-05 22:54:51 +01:00
Thibaut Cuvelier
bea2abf6eb InsetMathHull: fix column alignment for MathML.
https://www.lyx.org/trac/attachment/ticket/12221/0005-mathmlize-mathhull-checks-for-alignment.patch by lynx
2021-12-05 20:11:47 +01:00
Thibaut Cuvelier
a81dd6518a MathStream: better order for the calls to tab() and cr().
Part of https://www.lyx.org/trac/attachment/ticket/12221/0006-amends-to-a579128c-a68e9793-a68e9793.patch by lynx.
2021-12-05 19:15:06 +01:00
Thibaut Cuvelier
115ff2fa3c Similar fixes as 946ba7781c 2021-12-05 18:54:05 +01:00
Thibaut Cuvelier
946ba7781c Amend a68e9793: duplicate tag delimiter end. 2021-12-05 18:48:27 +01:00
Juergen Spitzmueller
31146ae8d3 Prevent Outliner crash due to emptied toc value
This might need a more profound fix in the long term, see
https://marc.info/?l=lyx-devel&m=163588729224679&w=2
2021-12-04 17:53:03 +01:00
Jean-Marc Lasgouttes
5eecfa3e04 When inserting text character in mathed, group in same \text when possible.
When inserting € in a math cell, it is put in a text inset and the
cursor leaves the inset. However, inserting ¤ then leads to
\text{€}\text{¤}.

Therefore, try to see if there is a previous \text inset that can be
recycled and insert the new inset there in this case, leading to
\text{€¤}.

Fixes bug #11979.
2021-11-28 14:33:45 +01:00
Daniel Ramoeller
e522c5444e InsertTableWidget support for dark mode and improved resizing
Fix for bug #12438.
2021-11-26 09:51:21 +01:00
Juergen Spitzmueller
a9eb3c9990 Whitespace 2021-11-25 18:47:23 +01:00
Juergen Spitzmueller
5a6498c3d3 Let paragraph::requestSpellcheck() consider contained insets
if "check whole paragraph" has been requested.
2021-11-25 17:04:58 +01:00
Juergen Spitzmueller
e366dba9bf Factor out Buffer::requestSpellcheck() function 2021-11-25 17:04:17 +01:00
Jean-Marc Lasgouttes
4dec64dba4 gzstream is able to read uncompressed files too
This allows to simplify the code in Lexer and to remove the dependency
on Formats class.

As a consequence, a pair of dummy definitions of isZippedFile can be removed.
2021-11-24 11:44:53 +01:00
Jean-Marc Lasgouttes
2311f42f41 Make primary-selection unknown when not supported
This lfun will not appear in menus anymore in macOS and Windows.

Part of bug #12436.
2021-11-22 10:30:43 +01:00
Jean-Marc Lasgouttes
b0983e1c5a Fixup 3aab9ad2: improve UndoGroupHelper docs again. 2021-11-14 19:14:31 +01:00
Jean-Marc Lasgouttes
741d055eba Fixup 1cbbe5c3: fix scrollbar with page down
It turns out that the fix was not correct. The right thing to do is to
recompte metrics only when screen has moved.

Fixes bug #12144.
2021-11-13 19:24:05 +01:00
Jean-Marc Lasgouttes
3aab9ad25e Fix documentation of UndoGroupHelper 2021-11-12 16:49:01 +01:00
Juergen Spitzmueller
16ce82d4f9 Fix Bullets panel (#12429) 2021-11-12 16:40:46 +01:00
Kornel Benko
20fd104cf2 FindAdv: Added handling of 0x019b 2021-11-12 13:29:22 +01:00
Juergen Spitzmueller
a90c5f202e Fix crash when closing LyX with open Search pane 2021-11-05 14:50:39 +01:00
Juergen Spitzmueller
1e711f902a Address Qt6 deprecation warnings 2021-11-03 17:41:41 +01:00
Juergen Spitzmueller
b60853ff0d Fix most stupid thinko of mine 2021-11-03 12:35:38 +01:00
Juergen Spitzmueller
de637cdbcb Amend 59b8c209c4
QFontMetrics::width() is no longer valid in Qt6
2021-11-02 16:28:40 +01:00
Daniel Ramoeller
59b8c209c4 Use labels for zoom slider buttons
Fix for bug #12301.

Also: fixes the width and alignment of the zoom value label.
2021-11-02 08:43:59 +01:00
Juergen Spitzmueller
bca1b63d89 Update toolbar and properly reset focus when find widget is closed (#12396) 2021-11-01 14:21:34 +01:00
Juergen Spitzmueller
455ff6fee7 More indentation correction 2021-11-01 14:15:05 +01:00
Juergen Spitzmueller
b9a9234cf6 Amend ce8b4e3a21 2021-11-01 13:08:16 +01:00
Juergen Spitzmueller
76ac4d8f8d Fix indentation 2021-11-01 13:02:05 +01:00
Daniel Ramoeller
a71c7f2154 Make color description "changed" rather than "added"
Fix for #12227 (regression).

Amended by Jürgen Spitzmüller
2021-11-01 12:47:11 +01:00
Juergen Spitzmueller
4888414f27 Attempt to fix #12226 for good 2021-11-01 08:30:41 +01:00
Juergen Spitzmueller
f3d5a95bb2 Redraw all work areas while zooming (#12334) 2021-10-31 13:43:27 +01:00
Juergen Spitzmueller
4c0caf9dd4 Polishing 2021-10-31 13:16:20 +01:00
Daniel Ramoeller
c50f40b522 Set Local Layout tab stop distance to 4
Fix for bug #12395.
2021-10-31 13:15:14 +01:00
Daniel Ramoeller
ce8b4e3a21 Movable minimised Quick Search Widget
Fix for bug #12207.
2021-10-31 13:06:36 +01:00
Daniel Ramoeller
528eee0a25 Adjust spacing of Quick Find Dock
Fix for bug #12209.

(amended by Jürgen Spitzmüller)
2021-10-31 12:33:08 +01:00
Juergen Spitzmueller
f0126b9fdf \\noindent in a paragraph that starts with \\vspace is possible
But the \\vspace must precede \\noindent (the latter leaves vmode)
2021-10-31 11:56:53 +01:00
Daniel Ramoeller
96a4dd235e Fix for bug #11974
Support for setUnifiedTitleAndToolBarOnMac (unify toolbar and title bar).
2021-10-31 10:42:14 +01:00
Juergen Spitzmueller
fbc64ea7ee Amend comment 2021-10-31 10:38:52 +01:00
Juergen Spitzmueller
456a72b62a Do not output \\noindent for paragraphs starting with a vspace
These are not indented anyway, and the extra \\noindent causes whitespace
2021-10-31 10:22:11 +01:00
Juergen Spitzmueller
18a91852e1 Properly terminate \\noindent 2021-10-31 09:58:10 +01:00
Juergen Spitzmueller
633013453e Factor out Paragraph::isPartOfTextSequence
Amends 045c25cf76
2021-10-31 09:26:57 +01:00
Juergen Spitzmueller
045c25cf76 Prevent unneeded (and wrong) \noindent
* When a paragraph is logically empty (only contains stuff which is not
  part of the text sequence

* In centered paragraphs
2021-10-30 14:19:46 +02:00
Juergen Spitzmueller
f3002d1cf4 Get rid of some more fragile index reliances 2021-10-29 17:52:25 +02:00
Jean-Marc Lasgouttes
110445e3e2 Rename BufferView::updateScrollbar to show what does
Only parameters are updated, not the scrollbar itself.
2021-10-29 17:45:51 +02:00
Juergen Spitzmueller
47b394f2c5 Amend [5c055034/lyxgit]
Relying on indexes is too fragile here
2021-10-29 17:06:11 +02:00
Jean-Marc Lasgouttes
5c055034c2 Fixup b0c102cfb: make it possible to select medskip as parskip
Some new parskip possibilities had been added, but the check for
custom length index had not bee updated.

This code is very fragile.

Related to bug #10968.
2021-10-29 16:41:00 +02:00
Juergen Spitzmueller
61fb295e46 Disable language selector in LyXFiles dialog if no file is selected (#12412) 2021-10-29 13:17:50 +02:00
Jean-Marc Lasgouttes
2c50f0cd77 An assert to hopefully please coverity 2021-10-29 12:39:50 +02:00
Yuriy Skalko
54028c3eea Mark inverted branch insets 2021-10-27 00:56:06 +03:00
Stephan Witt
436620a881 #12201 force open document in tabs on Mac when user preference is Always 2021-10-23 13:34:18 +02:00
Jean-Marc Lasgouttes
85f030a031 Let Tab go out of inset when no cycling is possible
Adapted patch from Enrico by adding S-Tab handling.

Fixes bug #11085
2021-10-21 22:42:40 +02:00
Jean-Marc Lasgouttes
2f236b01e0 Make sure that language is "latex" in InsetArgument when pass-thru.
The code that determine whether an InsetArgument is passThru is
complex and lives in updateBuffer.

This patch factors out the code in a new init method and calls it also
in doInsetInsert when inserting a InsetArgument.

Fixes bug #12143.
2021-10-21 19:14:06 +02:00
Pavel Sanda
6770fe5f38 * better wording 2021-10-21 16:01:57 +02:00
Pavel Sanda
985f7c9316 Improve error msg. 2021-10-21 15:20:28 +02:00
Juergen Spitzmueller
b55aea6776 Prevent unneeded cprotection in branches (#12378) 2021-10-21 10:27:05 +02:00
Thibaut Cuvelier
279e0a6839 DocBook: use the new refactorings in InsetText.
InsetText::docbookRenderAsImage directly used Qt to compute hashes, use the same code as support/FileName (now living in support/filetools).
2021-10-19 09:15:44 +02:00
Thibaut Cuvelier
0b5e940723 Refactor file-name sanitisation.
For now, this is only used in FileName, because it does not change the semantics of DocFileName::mangledFileName.
2021-10-19 09:15:44 +02:00
Thibaut Cuvelier
789a537182 Refactor computing hashes.
For now, this is only used in FileName, because it does not change the semantics of DocFileName::mangledFileName.
2021-10-19 09:15:44 +02:00
Jean-Marc Lasgouttes
40ee8d2a1a Reset inline completion after undo/redo
Fixes bug #12383.
2021-10-18 17:36:27 +02:00
Jean-Marc Lasgouttes
ada713a881 Revert "Update correctly completion after undo"
This reverts commit 06acb7f806.
2021-10-18 17:35:48 +02:00
Enrico Forestieri
e8b366d4d6 Amend 771f30e9 for cmake 2021-10-17 19:17:01 +02:00
Enrico Forestieri
3048878eab Amend 47f1fec9
Also account for cmake
2021-10-17 18:32:50 +02:00
Juergen Spitzmueller
3543626182 Do not change bibliography processor to default if it is not found
Rather than that, keep it with a warning that it is not available.
Fallback procedure (which maintains security measures) is done in
the conversion step.

This prevents document properties being silently changed on sharing.
2021-10-17 17:14:14 +02:00
Juergen Spitzmueller
f350072565 Provide proper fallback if a bibliography processor is not found
Check for appropriate fallbacks and warn user if the requested
bibliography processor is unavailable.
2021-10-17 17:14:14 +02:00
Enrico Forestieri
771f30e946 Enable QWindowsMimeMetafile with Qt6
The QWinMime class has been removed in Qt6 but the functionality
is still present. However, one has to allow inclusion of private
headers and register the mime handling to the QWindowsApplication
native interface.
2021-10-17 15:06:05 +02:00
Thibaut Cuvelier
21366155e4 DocBook: use a hash to determine the file names for generated images.
This way, the file names no more change without a reason.
2021-10-16 22:41:38 +02:00
Thibaut Cuvelier
33668e3a30 DocBook: export the preview images to the right format.
"docbook" is not the same as "docbook5", maybe it would be better to have an enumeration instead of strings.
2021-10-16 22:41:38 +02:00
Thibaut Cuvelier
e0830592f0 DocBook: wrong type of XML tag.
imagedata should have been a compound tag, because it should have no content, only its attributes are relevant (instead of a start-end pair of tags).
2021-10-16 22:41:38 +02:00
Jean-Marc Lasgouttes
a29ced5577 Get rid of std::iterator
clang's libc++ 13 tells us that it is deprecated in C++17.

Fortunately, we do not need it after all.
2021-10-15 18:13:09 +02:00
Jean-Marc Lasgouttes
d99502d915 Remove variable that is not used
Spotted by clang++ 13.
2021-10-15 15:49:40 +02:00
Jean-Marc Lasgouttes
5f4890721b Improve display of META_INSET in status bar. 2021-10-15 11:11:57 +02:00
Scott Kostyshak
1c70d98fc1 Fix sign-compare warning
Fix warning comparing long int to long unsigned int.
2021-10-14 23:50:08 -04:00
Pavel Sanda
f7de009b17 Guard against possible referencing null.
Those checks might not be needed, but it's not self obvious from
the surrounding code. Because we already experienced crash from
similar change (cf 1c1c83eced), let's be prudent here.

If you know that these pointers can't be null from broader context
feel free to remove the guards.

Introduced by 24926b2e23, fix 104fdcc9be not backported
but now fixed by 1c1c83eced in 2.3.

https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg216414.html
2021-10-14 22:28:43 +02:00
Jean-Marc Lasgouttes
06acb7f806 Update correctly completion after undo
This is take #2 after reverting e59aee458.

Request the completer to rebuild a completion after undo/redo.

Fixes #12383.
2021-10-14 16:39:33 +02:00
Jean-Marc Lasgouttes
91c5061d26 Revert "Reset inline completion after undo/redo"
Try a solution closer to other code instead.

This reverts commit e59aee4580.
2021-10-14 16:26:21 +02:00
Thibaut Cuvelier
7652747e26 DocBook: generate images for layouts that request it. 2021-10-13 19:26:49 +02:00
Thibaut Cuvelier
3502f5c999 Factor out the generation of the code to create a preview.
This will be soon reused in InsetText to generate images for DocBook.
2021-10-13 19:26:49 +02:00
Thibaut Cuvelier
b5533a24f4 Typos and comment improvements. 2021-10-13 19:26:49 +02:00
Thibaut Cuvelier
46b8101800 Factor out the list of macro definitions for InsetPreview.
This will be soon reused in InsetText to generate images for DocBook.
2021-10-13 19:26:49 +02:00
Thibaut Cuvelier
48a507694e DocBook: add assertion to help debugging. 2021-10-13 19:26:49 +02:00
Thibaut Cuvelier
82bca97379 DocBook: overall structure for rendered insets. 2021-10-13 19:26:49 +02:00
Thibaut Cuvelier
5c735ce880 DocBook: don't use a surrounding <para> for rendered insets. 2021-10-13 19:26:49 +02:00
Thibaut Cuvelier
e93e50bf56 DocBook: add the DocBookRenderAsImage tag. 2021-10-13 19:26:48 +02:00
Stephan Witt
b59eed3846 #12368 correct spelling of toolbars visibility check function name 2021-10-13 18:11:37 +02:00
Jean-Marc Lasgouttes
e59aee4580 Reset inline completion after undo/redo
Fixes bug #12383.
2021-10-12 15:45:04 +02:00
Jean-Marc Lasgouttes
c242b25364 Work around compilation warning
Clang 12 (at least) misses the fact that tag is always initialized,
because the if/else sequence does cover all cases.

Initialize the variable although it is not required. It does not hurt
at least.
2021-10-11 14:51:28 +02:00
Jean-Marc Lasgouttes
a5f1b15858 Make CoordCache assertions less annoying. 2021-10-09 12:25:29 +02:00
Jean-Marc Lasgouttes
0fff65a16a Avoid duplicate checks in CoordCache
The code is written in such a way that the elements are searched
several times. This can be expensive when there are a lots of insets
in the document.

Concerning the sanity checks, they are now conditionned on the
presence of assertion.

Related to bug #12297.
2021-10-08 18:17:19 +02:00
Jean-Marc Lasgouttes
e5bb491e2e Reduce the number of accesses to coord cache when drawing a math row
Each of these accesses is somewhat costly when using large branches
with lots of maths

Related to bug #12297.
2021-10-08 18:17:19 +02:00
Jean-Marc Lasgouttes
e09158efee Use unordered maps to store inset and math rows geometry.
Simply using unordered_map instead of map makes a big difference for
documents with lots of math insets in one text inset.

Related to bug #12297.
2021-10-08 18:17:19 +02:00
Scott Kostyshak
3ad94ec6d9 Minor refactor of previous commit
A bit easier to read and avoids unnecessary status.clear().
2021-10-07 20:40:12 -04:00
Daniel Ramoeller
b387ed52b1 Disable LFUN for last column/row deletion
Fix for #12380.
2021-10-07 20:40:12 -04:00
Juergen Spitzmueller
465b58a6df Check changed status after decimal sep has been edited 2021-10-06 18:06:09 +02:00
Yuriy Skalko
6a7c9d12f9 Amend d3c335a5d5 2021-10-05 17:10:51 +03:00
Juergen Spitzmueller
9a4a6ca079 Fix \cline calculation when last column has decimal alignment 2021-10-01 12:42:06 +02:00
Juergen Spitzmueller
9eab66ebb4 Close font switches before comments 2021-09-30 12:53:41 +02:00
Yuriy Skalko
d3c335a5d5 Remove useless casts reported by GCC with -Wuseless-cast option 2021-09-30 10:37:24 +03:00
Daniel Ramoeller
0862042b28 SVG replacement of busy.gif
Fix for bug #10384.
2021-09-29 12:49:56 +02:00
Jean-Marc Lasgouttes
42abb26054 Make paragraph-goto and friends set paragraph to the top
Add parameter 'force' to scrollToCursor(...) to avoid the case where the
cursor is not set to top because it is already visible on screen.
Change screen offset in this method so that the paragraph is really at
the top of the screen. This part may cause unforeseen issues and needs care.

gotoInset: use the new force flag and do not trigger a redraw.
Instead, return a boolean telling whether redraw is needed.
In the code that use it, set an update flag instead of the extra redraw.

In the handling of paragraph-goto, also set the update flag instead of
triggering a repaint.

Remove Bufferview::scrollToCursor(), which was equivalent to showCursor().

Fixes bug #10425.
2021-09-29 12:16:39 +02:00
Yuriy Skalko
a9119c3fa8 Remove redundant declarations reported by GCC with -Wredundant-decls option 2021-09-28 20:59:21 +03:00
Jean-Marc Lasgouttes
7067f48fa7 typo 2021-09-28 11:25:48 +02:00
Kornel Benko
84655a07d8 Fix crash
Lyx crashes on export to pdf if used with sanitizer set to 'unspecified'.
Crash found by Scott.

Given that if we export without GUI, there is some weirdness here though.
1.) Why does lyx not crash if not using '-fsanitize' compile-option
2.) Why is export to pdf dependent on the screen-resolution
2021-09-28 10:33:24 +02:00
Yuriy Skalko
325c405541 Remove redundant semicolons reported by GCC with -Wextra-semi option 2021-09-28 11:28:43 +03:00
Jean-Marc Lasgouttes
3cdfb42cce Make rectangles have pointy corners
This only makes a difference in HiDpi mode.

Adaptation of the patch proposed by Daniel.

Fix for bug #12336.
2021-09-27 17:47:41 +02:00
Jean-Marc Lasgouttes
69834f1e0d Fixup 6bbd88ac: compilation fix for Qt4 2021-09-27 13:56:04 +02:00
Jean-Marc Lasgouttes
73865ce999 Whitespace 2021-09-27 11:53:59 +02:00
Jean-Marc Lasgouttes
b3890d9eab Fix warning. 2021-09-24 18:45:08 +02:00
Jean-Marc Lasgouttes
6bbd88accf Improve (modestly) the performance of font metrics caches
This fixes two performance issues and improves the performance of
TextMetrics::redoParagraph by 15% in a workload that uses the cache a
lot. The difference will be much less when the cache is not used much.

1/ repetion of the hash code computation

The code
  if (cache.contains(key))
  	result = cache[key]:
is not efficient, since qHash(key) has to be computed twice.
To fix this a new Cache::object_str() method is added, which allows
  if (auto * obj = cache.object(key))
  	result = *obj;

2/ code of has code computation

Instead of using a verbose string that is complicated to build as
key, new key structs BreakAtKey and TextLayoutKey are introduced,
along with the relevant qHash() implementation.
2021-09-24 17:12:15 +02:00
Enrico Forestieri
9ae002b69f Fix bug #12373
Do not perform any autocorrection in the presence of a selection.
2021-09-24 10:17:32 +02:00
Kornel Benko
dd947300bc Amend dca39815: Fix a few warnings in Floating. 2021-09-24 10:08:02 +02:00
Thibaut Cuvelier
dca39815d3 Fix a few warnings in Floating. 2021-09-24 01:19:28 +02:00
Thibaut Cuvelier
ffa1b1dcc7 DocBook: add inner tags for layouts.
This makes it possible to implement LilyPond as prescribed in https://lilypond.org/doc/v2.22/Documentation/usage/docbook.
2021-09-21 01:21:25 +02:00
Thibaut Cuvelier
7ee23ca885 XML: add a check for a typical case in the xml name space.
IGNORE is a typical placeholder for tags that should not be output, along with NONE. At some point, we should check if both are required, or if NONE is enough…
2021-09-21 01:21:25 +02:00
Thibaut Cuvelier
14ed5b2050 DocBook: start implementing LilyPond.
All the changes that can be achieved without C++ code changes.
2021-09-21 01:21:25 +02:00
Kornel Benko
687ccdbb32 Complete the FontTag typeinfo 2021-09-20 11:52:16 +02:00
Thibaut Cuvelier
8b6e3d3749 DocBook: add more flexibility for floats.
Intended to fix #12371.
2021-09-20 00:06:20 +02:00
Thibaut Cuvelier
bde9b7afa0 Kill warning for uncovered code path. 2021-09-19 20:10:51 +02:00
Stephan Witt
c5262f04a2 #12247 disable Qt5 modifier hack for Qt-5.12 version or newer
Initially Qt5 modifier handling was broken. Therefore a workaround was introduced.
This workaround broke the LyX modifier handling with swap of Command-Control-key disabled.
The change disables the hack to get the correct behavior in LyX.
2021-08-23 14:44:36 +02:00
Juergen Spitzmueller
489549c9b4 Fix debug output 2021-08-21 15:19:30 +02:00
Juergen Spitzmueller
e8bf83e42b Correct tooltip
as advised by Scott
2021-08-21 15:19:07 +02:00
Juergen Spitzmueller
3f2510991d Recheck whole buffer after word has been added to/removed from document dic. 2021-08-21 15:18:30 +02:00
Pavel Sanda
20cee15937 Give the user visible feedback when reconfiguring. 2021-07-22 14:30:08 +02:00
Jean-Marc Lasgouttes
b0a74fa410 Count the width of pilcrows indicating changed end-of-par
This is related to #10357. The case of real end-of-par markers is
taken into account, but not "change" markers, which have been
introduced in 2.4.
2021-07-21 11:29:16 +02:00
Scott Kostyshak
bea7ef04e7 find: auto-wrap by default
For ML discussion on this change of default, see here:

  https://www.mail-archive.com/search?l=mid&q=20210602042644.g3s42nbeevdujzb5%40tallinn
2021-07-16 15:50:30 -04:00
Scott Kostyshak
47b0c33820 find: give status message when auto-wrapping
When auto-wrap is enabled, it is sometimes informative to know
when the search wraps.

A status message is consistent with LibreOffice and Vim.
2021-07-16 15:50:30 -04:00
Scott Kostyshak
abc65d4700 refactor: keep meaning of a variable consistent
We now use a new variable, "wrap", to track if a wrap should be
done, which is true either if "auto_wrap" is true or if the user
chooses to wrap in the dialog.

This preserves the meaning of the "auto_wrap" variable and also
removes the confusion of why the previous code of

  if (!auto_wrap) {
    ...
  }
  if (auto_wrap) {

did not use an "else" instead of the second "if".

No change in functionality.
2021-07-16 15:50:30 -04:00
Stephan Witt
4716b1f91a Use a central typedef for vectors of WordLangTuple. 2021-07-16 16:39:05 +02:00
Jean-Marc Lasgouttes
f3396ae011 Whitespace 2021-07-13 11:15:13 +02:00
Jean-Marc Lasgouttes
1c200e0d99 Revert "Add a move constructor to Inset"
It does not compile :-p

This reverts commit 874928f4a4.
2021-07-12 12:38:16 +02:00
Jean-Marc Lasgouttes
874928f4a4 Add a move constructor to Inset
Does not change much, but Coverity complains about it. Let's see if
this allows Inset's child classes to grow their own move constructor.

Also some whitespace.
2021-07-12 11:59:40 +02:00
Jean-Marc Lasgouttes
da57154f94 Rework display of numbers in margins of hull insets
This requires the introduction of the booleans selected_left and
selected_right in PainterInfo. These tell whether the selection
continues at the left/right of the inset.

This information allows to

1/ paint equation number in the right color: either current text color
   or selection text color.

2/ before that, paint a small background rectangle of the correct color.

This allows to avoid painting a large rectangle of an arbitrary color
that was the cause of the bug.

Fixes bug #12319.
2021-07-09 23:46:16 +02:00
Pavel Sanda
5dd96345ab Reformat mangled filenames for (xhtml) export to have them sorted. 2021-07-09 14:35:01 +02:00
Jean-Marc Lasgouttes
008a0825e8 Always remove selection after cursor up/down
When the cursor cannot move on cursor up/down, at least the selection
should be cleared (when not selecting).

To detect this, the method Cursor::upDownInText has been modified to
return true when cursor is at top/bottom of inset, but there is some
room above/below.

Moreover, introduce the functions LFUN_FINISHED_UP/DOWN, which is
dispatched at upper cursor level as long as no local movement is
possible. This allows to handle differently the original char moving
action and its consequences.

Fixes part of bug #12310.
2021-06-30 16:51:58 +02:00
Jean-Marc Lasgouttes
8d90bb9991 Always remove selection after cursor left/right
Example: when a selection is set, a `Left' cursor movement would not
reset selection when the cursor was at the beginning of buffer.

To fix this, it is necessary, when cursor is in top-level text, to
avoid the mechnanism (undispatched cursor) that sends the action to the
upper level (necessary when the cursor leaves an inset).

The change is mechanical and is done for : char-backward,
char-forward, char-left, char-right, word-left, word-right, word-left,
word-right. It might be possible to factor this code a bit, but there
is no evident solution.

char-up/down are *not* handled at this point.

Fixes part of bug #12310.
2021-06-30 16:41:18 +02:00
Eugene Chornyi
e9d5fc0190 prevent Qt6 from defining UNICODE (Qt6.1.1 and upwards) 2021-06-19 10:48:49 +02:00
Eugene Chornyi
b9334a046c Use specialized WINAPI functions for specialized arguments 2021-06-19 10:48:15 +02:00
Jean-Marc Lasgouttes
a9c6fb0c19 Improve test in Geometry::covers
Horizontally, the old code would count an extra pixel on the right.

The vertical test is not changed, and should be eventually audited.

Fixes bug #10468.
2021-06-14 18:01:35 +02:00
Jean-Marc Lasgouttes
22cb573cac Allow line inset to draw a vertical line.
Qpainter::drawline cannot draw a line which is thicker than it is long.
Draw a rectangle instead.

Fix bug #12307.
2021-06-14 15:45:35 +02:00
Jean-Marc Lasgouttes
ca2706e30e Cleanup: fix comments, move declarations around 2021-06-09 16:26:48 +02:00
Jean-Marc Lasgouttes
e309a5599e Fixup f3a0e8ff: forgot to test in main dispatch
I would probably have seen this missing bit if not for the bug fixed
since then at c9146e5b.

Fixes (again) bug #12074
2021-06-08 16:15:28 +02:00
Kornel Benko
8f4ed83f9a FindAdv: Added handling of Thai characters 2021-06-04 14:49:46 +02:00
Jean-Marc Lasgouttes
7e17d1a1b7 Fixup 7e7f9eba: we only need one hasLimits() method
Related to bug #12295.
2021-06-01 16:12:46 +02:00
Thibaut Cuvelier
7e7f9ebae8 MathML: use the right has_limits_ in InsetMathScripts.
Fixes #12295. Details in the ticket.
2021-05-31 23:26:25 +02:00
Jean-Marc Lasgouttes
5e396c3f0c Prevent insets in table cells from expanding artificially to max width
This replaces ad-hoc hacks and does a better job by propagating the
the tightness recursively.

Fixes bug #9363.
2021-05-31 14:38:42 +02:00
Thibaut Cuvelier
2805452229 MathML: InsetMathHull now distinguishes between hull types to present display/inline math and adjust the alignment of the cells
By lynx: https://www.lyx.org/trac/attachment/ticket/12221/0004-mathml-display-changes.patch
2021-05-25 03:56:24 +02:00
Thibaut Cuvelier
dd1a85a2ba MathML: more consistency between DocBook and XHTML.
By lynx: https://www.lyx.org/trac/attachment/ticket/12221/0004-mathml-display-changes.patch
2021-05-25 03:54:42 +02:00
Thibaut Cuvelier
a68e979350 MathML: use M/ETagInline.
By lynx: https://www.lyx.org/trac/attachment/ticket/12221/0003-tag-insertion-unification-for-bold-char-delim-dots-exfunc-.patch
2021-05-25 03:51:29 +02:00
Thibaut Cuvelier
3ab6633b86 MathML: add M/ETagInline.
By lynx: https://www.lyx.org/trac/attachment/ticket/12221/0003-tag-insertion-unification-for-bold-char-delim-dots-exfunc-.patch
2021-05-25 03:34:52 +02:00
Thibaut Cuvelier
a579128c06 DocBook: for MathML, mrow removal for more cases
By lynx: https://www.lyx.org/trac/attachment/ticket/12221/0003-tag-insertion-unification-for-bold-char-delim-dots-exfunc-.patch
2021-05-25 03:29:20 +02:00
Thibaut Cuvelier
5eddfe509b DocBook: for MathML, refactor InsetMathScript::mathmlize to improve readability and lower redundancy. 2021-05-25 03:21:21 +02:00
Thibaut Cuvelier
1cbac6fcb4 DocBook: for MathML, mrow removal from decoration, script, frac
By lynx: https://www.lyx.org/trac/attachment/ticket/12221/0002-mrow-removal-from-decoration-script-frac.patch
2021-05-25 03:15:48 +02:00
Thibaut Cuvelier
e4996026b7 DocBook: for MathML, use display="block" for non-inline formulae.
By lynx:
https://www.lyx.org/trac/attachment/ticket/12221/0001-docbook-display-equation.patch
2021-05-25 02:34:04 +02:00
Thibaut Cuvelier
7a210e4c9a DocBook: missing signal connection in GUI for MathML prefix. 2021-05-25 00:00:08 +02:00
Thibaut Cuvelier
de77854275 DocBook: fix MathML prefix in root tag.
Patch written by lynx: https://www.lyx.org/trac/ticket/12229
2021-05-24 23:55:11 +02:00
Thibaut Cuvelier
39a9e370c7 DocBook: fix handling of footnotes.
A <para> was missing inside starting at 441c6a93.
2021-05-24 23:36:37 +02:00
Daniel Ramoeller
c6c6576515 Open backup files via file open dialog
Fix for bug #12266.

Also: Option to open any files as is standard in other apps.
2021-05-20 13:24:37 -04:00
Jean-Marc Lasgouttes
67c85f54c4 Fixup 9f92fc92: improve FIXME in SystemcallPrivate::startProcess
I wanted to remove the test  Qt >= 5.15, but now I see that it is
not possible because of QProcess::splitCommand.

Neverthless, the best would be to change parsecmd.
2021-05-20 13:20:20 +02:00
Juergen Spitzmueller
70bcffca9c Add missing counter code 2021-05-07 13:38:43 +02:00
Juergen Spitzmueller
6431a9ab13 Make Dock Widgets SubWindows in general (#12170) 2021-05-06 17:56:53 +02:00