Commit Graph

28239 Commits

Author SHA1 Message Date
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
Juergen Spitzmueller
67762aaf08 Allow counter insets in pass thru 2021-05-06 14:44:42 +02:00
Juergen Spitzmueller
9586c51c3f GuiSearch: prevent Tab key to switch to work area (part of #12170)
QWidget::focusNextPrevChild() passes over to the parent (which is the
work area here) if the current window is not a dialog (isWindow()) or
a sub-window (window flag Qt::SubWindow).

We set the latter here to prevent this unwanted behavior.

Let's see if there are side-effects.
2021-05-06 12:27:38 +02:00
Juergen Spitzmueller
fb8b484b7f Tab order for search pane 2021-05-06 12:25:32 +02:00
Jean-Marc Lasgouttes
e4b80698be Cache icons of dynamic menu buttons
The current code would load the same icons again and again and LyX
memory footprint would grow.

Tentative fixe to bug #12271.
2021-05-05 14:53:25 +02:00
Scott Kostyshak
5d96ee69eb Revert "Revert "Only set dummy X11 selection if we do not own it""
This reverts commit 1b704b6267.

(the initial reversion was done unintentionally)
2021-05-04 12:34:35 -04:00
Scott Kostyshak
423ddb1199 Revert "Revert "Fix commented out code""
This reverts commit 313d9fa4d0.

(the initial reversion was done unintentionally)
2021-05-04 12:34:21 -04:00
jpc
313d9fa4d0 Revert "Fix commented out code"
This reverts commit 23abb5aaa3.
2021-05-04 18:01:16 +02:00
jpc
1b704b6267 Revert "Only set dummy X11 selection if we do not own it"
This reverts commit af4ee1a487.
2021-05-04 18:00:50 +02:00
Juergen Spitzmueller
eb86239e36 Replace deprecated slot 2021-04-17 15:13:02 +02:00
Juergen Spitzmueller
511ba894ff Fix toqstr(chart_type) with Qt6 (#12252) 2021-04-17 15:10:26 +02:00
Jean-Marc Lasgouttes
0acf594df2 Improve the description of Inset::inheritFont()
The existing descriptions were obsolete (see e.g. ticket #10263).
2021-04-13 10:37:25 +02:00
Jean-Marc Lasgouttes
441c6a9359 Revert "Fix bug #10263"
A series of commits, culminating at 812ff7de, pushed a few days later,
fixes the bug at its root. This one is not needed anymore to fix

This reverts commit 001f5a4786
2021-04-13 10:21:25 +02:00
Juergen Spitzmueller
ebb34a4614 Set advanced repl_buffer internal as well (#12246) 2021-04-11 18:06:11 +02:00
Juergen Spitzmueller
e5370827db Mark c&p buffers internal. Cures assertion (#12246) 2021-04-11 17:25:17 +02:00
Jean-Marc Lasgouttes
f41f88ac2d Revert "The foot inset does not inherit fonts"
Due to braindead semantics, this is not possible.

This reverts commit 59f63602f5.
2021-04-10 13:44:07 +02:00
Jean-Marc Lasgouttes
59f63602f5 The foot inset does not inherit fonts
Fixes bug #12238.
2021-04-09 19:06:28 +02:00
Jean-Marc Lasgouttes
c9146e5be0 Fixup f3a0e8ff: costly thinko
When the buffer stuff has been updated, the Buffer::needUpdate()
should be reset to false. This was forgotten in f3a0e8ff.

Fixes performance issues with MergedManuals, for example. UpdateBuffer
would be run again and again when selecting text.
2021-04-09 18:15:31 +02:00
Jean-Marc Lasgouttes
b08a653f35 We only support gcc >= 4.9. 2021-04-07 17:17:05 +02:00
Jean-Marc Lasgouttes
e33567cdcb Make fall through explixcit 2021-04-07 17:13:43 +02:00
Jean-Marc Lasgouttes
e96a656b4d Fixup 0f0ad1f7: cut and paste error 2021-04-07 16:23:29 +02:00
Jean-Marc Lasgouttes
0f0ad1f715 Make bookmarks display configurable
Introduce a GUI-less LyXRC member bookmarks_visibility. This is
experimental and will not be documented for 2.4.0. Having the code
present will allow to (1) improve it gradually and (2) fix the many
bookmarks bugs that it exposes.

The corresponding tag is \experimental:bookmarks_visibility, which is
intentionally weird.

Three possible values:

* none: no bookmark display
* margin: display the bookmark in margin
* inline: display the bookmark at cursor position.

The default margin has been made wider so that there is room for the
bookmark. This was necessary anyway. The margin bookmark is now
displayed correctly in full screen with limited text width.

Margin display still needs some improvements when several bookmarks
are on the same row.

Mostly fixes bug #2496.
2021-04-07 16:19:20 +02:00
Enrico Forestieri
8ec32dc3f9 Do not dereference null pointer
Part of #12226
2021-04-07 00:15:12 +02:00
Jean-Marc Lasgouttes
557d33b7e5 Fix compilation for clang 3.7 with libc++ 2021-04-06 12:07:42 +02:00
Jean-Marc Lasgouttes
b2912339d0 Fix drawing of indicators for tracked changes and horizontal scrolling.
1/ fix horizontal position of the insets

   This is adapted from parts of racoon's patch for bug #12131.

2/ fix height of the indicators when at the top or bottom of document,
   by using the row's contents_dim() to measure is height.

3/ fix partial blinking of horizontl scrolling marks when editing table.

Fixes bug #12171.
2021-04-05 19:24:59 +02:00
Richard Kimberly Heck
eb2e8e1579 Polish 2021-04-03 17:58:46 -04:00
Enrico Forestieri
7a6ad48495 Use font metrics for computing the size of math decorations
It was an error using an absolute size instead of one relative to the
size of the used font. It was requiring using the physical dpi of the
screen and caused #12222. Now everything is computed with respect to
the metrics of the font and should be automatically correct.

Fixes #12222.
2021-04-03 18:37:10 +02:00
Pavel Sanda
9d1031771e Fix #4658: showing diff between original and emergency files.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg215796.html
2021-04-03 13:19:53 +02:00
Enrico Forestieri
472953dbe1 Replace obsoleted signal QComboBox::activated(QString)
Since Qt 5.14 this signal is named textActivated.
2021-04-01 21:17:41 +02:00
Enrico Forestieri
570cd84ddc Replace obsoleted signal
Since Qt 5.14 this signal is named textHighlighted.
2021-04-01 20:31:11 +02:00
Enrico Forestieri
eeb36e808c Change cursor shape for clickable math insets
Currently, only InsetMathRef and InsetMathSpace are clickable.
2021-04-01 16:59:55 +02:00
Richard Kimberly Heck
fb5cb3ed03 Show the label for a cross-reference in the TOC. 2021-03-28 11:05:31 -04:00
Richard Kimberly Heck
65d0c96855 Revert "By default, use an argument's menu string as its label string."
Committed by accident.

This reverts commit affd6101bd.
2021-03-26 13:58:28 -04:00
Richard Kimberly Heck
942d3cab32 Change "Local Layout" button to "Local Class".
This is for choosing a local document class/layout file. The tooltip
uses the 'class' language already, and "Local Layout" conflicts with
the way that term is used elsewhere in the dialog.
2021-03-26 13:37:14 -04:00
Richard Kimberly Heck
affd6101bd By default, use an argument's menu string as its label string.
If one wants different label strings, then provide those first.
2021-03-26 13:37:14 -04:00
Jean-Marc Lasgouttes
9ff27f8ce0 Produce an error on bad debug level values
Add new funciton Debug::badValue, that returns the first bad value in a debug
setting string.

Use it to parse the -dbg comand line option and to control the
execution of the debug-level-set lfun.

Use range-based loops in a few places.
2021-03-26 17:55:54 +01:00
Jean-Marc Lasgouttes
0429b580e6 Fixup 4671214f: add comment 2021-03-26 14:26:15 +01:00
Kornel Benko
a9b0f5faae Cmake build with qt6 on MAC
Patch from P. De Visschere
Citing:
I also must exclude the QMacPasteboardMimeGraphics class in
GuiApplication.cpp since QMacPasteboard is not available anymore with qt6.

and add an #include <QStandardPaths> in support/Package.cpp (I suppose
this will pose no problem for qt5 but have not checked it, it's only
needed with USE_MACOSX_PACKAGING)
2021-03-26 13:11:44 +01:00
Daniel Ramoeller
4671214f3d Keep caret visible when small
Fix for ticket #12190.
2021-03-26 12:43:11 +01:00
Jean-Marc Lasgouttes
efbc37926f Set explicitly outer font when inserting text inset.
Now it is possible to set this font directly instead of relying on
metrics() side effects. Do that to avoid crashes due to bad
interactions.

This implements the new scheme that was mentionned in 5a58ca65.

Fixes bug #12204.
2021-03-25 11:26:44 +01:00
Jean-Marc Lasgouttes
06a7731274 Move code responsible to set TextMetrics outer font to InsetText
This code was previously in InsetCollapsible for no good reason.

Move it to a new function InsetText::setOuterFont, which can now be
called for other purposes.

Part of investigation of bug #12204.
2021-03-24 20:28:19 +01:00
Jean-Marc Lasgouttes
56bd50ea6c Move getFont and getLabelFont from InsetCollapsible to Inset
Also move around getLayout and isPassThru.

Part of investigation of bug #12204.
2021-03-24 20:04:27 +01:00
Scott Kostyshak
b2b68c3ee7 Update tex2lyx tests 2021-03-24 13:08:28 -04:00
Jean-Marc Lasgouttes
d03435bc77 Remove tweaks of [pm]i.base.font in InsetCaption
Captions do not reset font settings (try to insert caption in emph context).

Part of investigation of bug #12204.
2021-03-24 16:27:05 +01:00
Jean-Marc Lasgouttes
b37929fdb3 Remove unneeded InsetFootlike::metrics/draw() methods
The font is already set to the buffer font when called from
TextMetrics::redoParagraph and RowPainter::paintInset, because
inheritFont() is false.

Part of investigation of bug #12204.
2021-03-24 16:25:43 +01:00
Kornel Benko
92a50fa273 Cmake build Qt6: Remove some redundant statements. 2021-03-24 11:42:39 +01:00
Thibaut Cuvelier
6102327d3b Improve tool tip for the new DocBook MathML-prefix option. 2021-03-23 22:32:16 +01:00
Thibaut Cuvelier
7a1e048f44 Amend 0f782b0d: add the required changes to lyx2lyx. 2021-03-23 21:12:45 +01:00
Thibaut Cuvelier
6a5288e31e DocBook: add the MathML-namespace prefix in the GUI. 2021-03-23 00:32:45 +01:00
Thibaut Cuvelier
0f782b0ded DocBook: add a parameter to change the namespace prefix for MathML. 2021-03-23 00:32:45 +01:00
Kornel Benko
02a3705496 Amend 635a7d77: Allow compiling with Qt6 with cmake
Thanks Scott for checking.
TODO: Check compilation on Windows and Mac.
2021-03-22 16:19:10 +01:00
Enrico Forestieri
6fa973b377 Fix Qt6 deprecation warning about QString::fromUcs4 2021-03-21 17:15:08 +01:00
Juergen Spitzmueller
4a5ae39e8b Revert "Fix Qt6 deprecation warning (QString::fromUcs4(uint))"
This reverts commit 52dff70641.
2021-03-21 16:59:25 +01:00
Juergen Spitzmueller
2c553df178 Replace obsoleted signal
This has been obsoleted in Qt5 and dropped in Qt6
2021-03-21 12:51:38 +01:00
Juergen Spitzmueller
52dff70641 Fix Qt6 deprecation warning (QString::fromUcs4(uint)) 2021-03-21 12:38:47 +01:00
Juergen Spitzmueller
15c6d4c6b3 Fix Qt6 deprecation warning (QMouseEvent::x() ::y()) 2021-03-21 12:38:05 +01:00
Juergen Spitzmueller
cbc55548a3 Fix Qt6 deprecation warning (QEvent::globalPos()) 2021-03-21 12:37:17 +01:00
Juergen Spitzmueller
b7f983bc47 Address Qt6 deprecation warning (QLibraryInfo::location()) 2021-03-21 12:30:34 +01:00
Juergen Spitzmueller
9ccbc11bf3 Fix unused variable warning with Qt6 2021-03-21 12:30:01 +01:00
Eugene Chornyi
4421b721e4 Make all a synonym of any in cmd debug mode 2021-03-21 09:59:23 +01:00
Enrico Forestieri
34ffa80c4c Fix latex syntax highlighting with Qt6 2021-03-17 10:17:10 +01:00
Enrico Forestieri
968be3f209 Fix copy&paste error 2021-03-17 08:59:04 +01:00
Pavel Sanda
4e2f8dbbeb Qt4 compil fix 2021-03-16 09:39:05 +01:00
Enrico Forestieri
7cb2a10eb8 Amend 635a7d77
With a multiscreen setup and Qt6, make sure to get the geometry
of the screen containing the widget.
2021-03-15 18:35:58 +01:00
Enrico Forestieri
635a7d77dd Allow compiling with Qt6
This commit allows compiling LyX with Qt6 when using autotools.
For a successful compilation the following 2 conditions must be met.

1) The Qt6 qmake has to come first in PATH, so that the command
   "qmake -v | grep -o 'Qt version .'" returns "Qt version 6".
2) The --enable-qt6 switch has to be passed to the configure command.

If --enable-qt6 is used but Qt6 is not found, Qt5 is tried as a fallback.
If also Qt5 is not found, configuring for Qt4 is attempted.
If --enable-qt6 is not used, then things go as usual. This means that Qt5
is tried first and then Qt4, unless --disable-qt5 is used, in which case
Qt4 is directly attempted. This means that existing scripts should
continue working unmodified.

LyX should compile with Qt6 on windows and linux, and possibly also on
mac, but I could not test that. However, it is not guaranteed that it
works as it should. In particular I am not sure that I got right the
conversion from QRegExp to QRegularExpression. For sure, the syntax
highlighting seems to not work right. Someone in the know should take
a look at that. I am able to load documents and compile them but some
thourough testing is needed. However, when compiling for Qt5 or Qt4,
I tried to make sure that the functionality is preserved.
2021-03-15 17:09:09 +01:00
Juergen Spitzmueller
d5263f857e Amend [1bf53d47a5b8/lyxgit] 2021-03-14 16:48:04 +01:00
Juergen Spitzmueller
1bf53d47a5 Use customizable zoom context menu
Based on a proposal by Daniel (#12187)
2021-03-14 16:41:44 +01:00
Juergen Spitzmueller
d29d2f48fd Toom value: back to QLabel, this time with custom context menu 2021-03-14 12:04:12 +01:00
Juergen Spitzmueller
663f198001 Properly set minimum width with QToolButton 2021-03-14 09:42:28 +01:00
Juergen Spitzmueller
ac1b3f0ba2 Fix indentation 2021-03-13 12:17:31 +01:00
Juergen Spitzmueller
b272e4bfb0 Fix ct in table cell pasting 2021-03-12 17:44:33 +01:00
Juergen Spitzmueller
ae892bff98 Fix copy of multi-cells in table (#12196) 2021-03-12 17:44:33 +01:00
Jean-Marc Lasgouttes
ac8948b8e0 Fixup 86bfa10a: add checks before updating bookmarks
When doing cut and paste, it can happen that inset_owner_ is null, or
that the inset is not related to a buffer.
2021-03-12 17:42:02 +01:00
Yuriy Skalko
4ec5d33551 Set correct Windows console code page since all LyX output is in UTF-8 2021-03-12 18:15:33 +02:00
Juergen Spitzmueller
71268e859d Set zoom value after menu
Fixes initial size with styles that show a menu indicator
2021-03-12 16:30:50 +01:00
Juergen Spitzmueller
9f92fc92bd Yet another deprecation fix (this is the last one I am aware of) 2021-03-12 12:14:42 +01:00
Juergen Spitzmueller
934c6480c0 Add forgotten parent 2021-03-12 10:54:46 +01:00
Juergen Spitzmueller
10f4f2113a Fix deprecation warning (from|toTime_t) 2021-03-12 10:32:03 +01:00