Commit Graph

28239 Commits

Author SHA1 Message Date
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
Juergen Spitzmueller
26459a2cf5 Address another deprecation warning.
One left to go.
2021-03-12 10:10:33 +01:00
Juergen Spitzmueller
1a35afbe8f Fix deprecation warning 2021-03-11 19:06:03 +01:00
Juergen Spitzmueller
8a605ca8ad Add option to toggle zoom slider to zoom statusbar menu 2021-03-11 18:41:52 +01:00
Daniel Ramoeller
2710ec0840 Option to hide the zoom slider
Fix for bug #12187.
2021-03-11 18:41:52 +01:00
Juergen Spitzmueller
f525bded59 Add menu to statusbar zoom value 2021-03-11 18:14:46 +01:00
Juergen Spitzmueller
7a000652c0 Do not scale statusbar icons
This leads to stretched icons.
2021-03-11 17:24:19 +01:00
Juergen Spitzmueller
a49abd7383 Remove zoom slider ticks
This doesn't align well
2021-03-11 17:24:19 +01:00
Jean-Marc Lasgouttes
447a1056b4 Fix bookmarks-goto inside insets.
A stupid oversight, as far as I can see.
2021-03-11 16:16:11 +01:00
Jean-Marc Lasgouttes
86bfa10abb Adjust bookmark position when inserting/deleting from paragraph
Without this, bookmarks positions drift when editing.
2021-03-11 16:00:32 +01:00
Jean-Marc Lasgouttes
b87a81c394 Fixup fbf22bb3: really avoid screen-jumping with mouse click.
It turns out that the commit from gadmm's lyx-unstable has been
cherry-picked at the wrong place! However I believe that both changes
are necessary.

With this second patch, I do see that some screen jumping is avoided.

Fixes bug #7457.
2021-03-10 10:43:45 +01:00
Jean-Marc Lasgouttes
776807a536 Constification 2021-03-10 10:43:45 +01:00
Jean-Marc Lasgouttes
9a2b8c87cd Code reformatting. 2021-03-10 10:43:45 +01:00
Jean-Marc Lasgouttes
87e59caebe Constify some Paragraph::Private methods 2021-03-09 16:46:05 +01:00
Jean-Marc Lasgouttes
5d8f3a9307 Fix debug output of FunCode
Outputing the FuncCode enum to a stream using the << operator does not
work well. Actually I am not sure whether the << operator in LyXAction
is supposed to work (don't we need an enum class for that?).
2021-03-09 16:26:44 +01:00
Juergen Spitzmueller
dee329a21f Revert "Attempt to align slider and buttons in a widget"
This reverts commit ad44f4f448.
2021-03-09 14:50:23 +01:00
Juergen Spitzmueller
ad44f4f448 Attempt to align slider and buttons in a widget 2021-03-09 14:23:13 +01:00
Juergen Spitzmueller
f07a588b25 Fix cut and paste error 2021-03-09 13:03:33 +01:00
Pavel Sanda
f298072012 Revert 7e5c42593e.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg215733.html

Main issue is git log does not return >0 when file does not exists.
Other possible issues to check - cvs might want to connect to server
with cvs log. In large git archives reaching the proper record might take
longer time than ls-files.
2021-03-09 12:46:23 +01:00
Juergen Spitzmueller
f2e33b8c3e Use real minus char 2021-03-09 10:10:48 +01:00
Juergen Spitzmueller
ebb7ee7d5f Add +/- buttons to zoom slider 2021-03-09 08:42:27 +01:00
Daniel Ramoeller
3c43a01ba2 Smaller zoom slider on macOS
Fix for #12189.
2021-03-09 07:34:33 +01:00
Stephan Witt
6273c1f66d Amend change 07122f066b - correct string access. 2021-03-08 21:26:58 +01:00
Eugene Chornyi
167dfbc92c Fix bug 11998
If started from console, the console is the parent process, which can be attached. If started not from console, parent process does not exist and the block is skipped.
2021-03-08 19:35:18 +01:00
Juergen Spitzmueller
b9fb2a236e Keep zoom label width constant (#12186) 2021-03-08 07:33:37 +01:00
Juergen Spitzmueller
cf75003119 Disable zoom slider when there is no buffer open (#12185) 2021-03-07 19:15:57 +01:00
Juergen Spitzmueller
0a3f856bc1 Update zoom display after zoom has been set 2021-03-07 18:35:40 +01:00
Juergen Spitzmueller
c8feef2e23 Add way to remove items from document dictionary 2021-03-07 18:23:07 +01:00
Stephan Witt
07122f066b Refactoring: move check for match in spellignore() to buffer params. 2021-03-07 17:46:01 +01:00
Juergen Spitzmueller
430327152a Fix per-document dictionary with Mac 2021-03-07 17:25:31 +01:00
Juergen Spitzmueller
be6dc7dd5d Show zoom value in statusbar 2021-03-07 17:21:52 +01:00
Juergen Spitzmueller
bc300585f7 Properly set initial zoom value
This depends on settings
2021-03-07 17:09:03 +01:00
Juergen Spitzmueller
128346d03d Fix zoom slider with mouse wheel 2021-03-07 15:18:28 +01:00
Juergen Spitzmueller
9aad98836d Fix for Qt < 5.11 2021-03-07 14:33:13 +01:00
Juergen Spitzmueller
b07084df2d Add ticks to zoom slider 2021-03-07 14:29:55 +01:00
Jean-Marc Lasgouttes
610ea7f4f5 Fix display of emphasize in slanted text
Fixes bug #12175.
2021-03-07 13:32:34 +01:00
Juergen Spitzmueller
bdb006543b Zoom slider 2021-03-07 13:29:23 +01:00
Stephan Witt
2cf86771ed Amend 07396ab244 - fix compilation error for Apple spell checker. 2021-03-07 10:46:31 +01:00
Stephan Witt
3f75fb7a48 Amend 07396ab244 - fix white space. 2021-03-07 10:46:00 +01:00
Juergen Spitzmueller
a0a7ba7cce Update tex2lyx tests 2021-03-07 08:24:01 +01:00
Juergen Spitzmueller
0b42f77551 \\spellchecker_ignore: use LyX language name rather than langcode 2021-03-07 08:21:23 +01:00
Enrico Forestieri
7545698380 Fix bug #12181
The context menu for InsetMathRef is now usable.
InsetMathRef still misses support for RefStyle and thus the
corresponding entries are omitted from the menu. But this would
be a different bug.
2021-03-06 23:36:58 +01:00
Daniel Ramoeller
5d269df606 Do not toggle on (all) layouts in force plain
Fix for #12179.
2021-03-06 20:25:52 +01:00
Jean-Marc Lasgouttes
4210f4c9cc Compilation fix 2021-03-06 19:58:18 +01:00
Juergen Spitzmueller
31dc0acbb8 Layout fix 2021-03-06 17:45:06 +01:00
Juergen Spitzmueller
07396ab244 Meet per-document spelling dictionaries (fixes #86 [sic!])
Now who can beat that? ;-)
2021-03-06 16:53:33 +01:00
Juergen Spitzmueller
92c6c3b950 fix indendation 2021-03-06 16:15:10 +01:00
Enrico Forestieri
5a43b86141 Allow context menus in mathed
It is now possible to get a context menu for math insets.
InsetMathSpace was already providing a specific context menu,
but it was never triggered because the math hull inset is not
descendable. It is still so, but now when a context menu is
requested all the insets inside the math hull are examined.
If the inset under the cursor provides a context menu, it
is shown instead of the general math one.

Fixes #12100.
2021-03-05 21:21:41 +01:00
Juergen Spitzmueller
f1f475e1d3 Add LFUN_FONT_NO_SPELLCHECK 2021-03-05 18:23:38 +01:00
Jean-Marc Lasgouttes
4828dfb441 Indicate that we do not use a return value
Please Coverity.
2021-03-05 13:12:58 +01:00
Jean-Marc Lasgouttes
f5340fd6d9 Fix missing initialization
Spotted by Coverity.
2021-03-05 13:06:10 +01:00
Jean-Marc Lasgouttes
e6a7da3b22 Fix warning when not using Qt regexps 2021-03-05 11:54:11 +01:00
Juergen Spitzmueller
23fc1b270d Remove redundant call (amend 2b7fae04f3) 2021-03-05 07:54:17 +01:00
Juergen Spitzmueller
2b7fae04f3 Fix limiting of absurdly large input to thesaurus (#10528) 2021-03-05 07:51:49 +01:00
Juergen Spitzmueller
64095a0af2 Fix wrap with Spellchecker after ignore (#10383) 2021-03-04 18:02:04 +01:00
Juergen Spitzmueller
a57cdd0d30 Remove confusing and unusual "Find Next" button from spellchecker dialog (#8931) 2021-03-04 16:54:01 +01:00
Juergen Spitzmueller
8718d01770 Style 2021-03-04 14:52:39 +01:00
Juergen Spitzmueller
5920591b52 refillToolbars() does not need to be public 2021-03-04 14:51:58 +01:00
Juergen Spitzmueller
812b6f7d69 Allow for runtime (dark/light) mode switch 2021-03-04 12:35:38 +01:00
Enrico Forestieri
be2c12ba40 Fix bug #9601
Make sure emphasized text in mathed has correct shape and color.
2021-03-04 11:58:44 +01:00
Jean-Marc Lasgouttes
009efa195b Avoid pointless 'undefined flex inset' errors
When switching class, it does not make sense to flag flex insets that
are undefined if they were already undefined before.

Part of bug #12163.
2021-03-04 10:08:46 +01:00
Daniel Ramoeller
fde432493d Fix Disable Editing "Lock" icon protrudes into tab title on macOS
On macOS the Disable Editing "Lock" icon protrudes into tab title

Also, since the close button is on the left, the lock is better positioned on the right.

The detour via QIcon is to avoid a pixelated pixmap (because in LyX pixmaps don't adjust by default to the device's pixel ratio correctly).

Also

Fix for bug #12160.
2021-03-02 18:38:14 +01:00
Jean-Marc Lasgouttes
fbf22bb3f3 Fix random scrolling inside nested insets
Happened when the BufferView was resized (e.g. math toolbars were
displayed/hidden).

Backported from gadmm's lyx-unstable tree
https://gitlab.com/gadmm/lyx-unstable/-/commit/a868bc034cea4c

Possible fix to bug #7457.
2021-03-02 18:10:12 +01:00
Juergen Spitzmueller
e2f3dd5f6a Consider selection scope when DEPM after CT acceptance/rejection (#2166)
This fixes a crash and DEPM overshooting.
2021-03-02 09:15:33 +01:00
Juergen Spitzmueller
d49c4abb43 Merge branch 'master' of git.lyx.org:lyx 2021-03-02 08:36:42 +01:00
Jean-Marc Lasgouttes
f92f2f95ff Cleanup High DPI support
Disable for Qt >= 6 (this is the default now).

Disable for macOS (does it in its own way).
2021-03-02 08:22:02 +01:00
Juergen Spitzmueller
f28affd421 Merge branch 'master' of git.lyx.org:lyx 2021-03-02 07:04:03 +01:00
Jean-Marc Lasgouttes
234886f6eb Add Qt platform name in About dialog 2021-03-01 19:15:49 +01:00
Enrico Forestieri
bb2c1c3485 Amend c2facb8c
Make sure the base of a script is not empty before accessing it.
2021-03-01 10:08:08 +01:00
Enrico Forestieri
52ce0ff49a Fix bug #11007
The math color inset inherits the mode of the containing inset.
This mode is inferred by the kind of font in effect. Setting the
right mode allows to insert spaces where these should be allowed.
Another small glitch was that the selection was always parsed in
math mode, so that any space was swallowed, even if the inset would
allow them.
2021-02-28 22:32:11 +01:00
Juergen Spitzmueller
0e54e01756 grammar 2021-02-28 17:38:01 +01:00
Juergen Spitzmueller
939dc4076f Prevent infinite loop with instant search on Mac (#12161)
The search dialog was repeatedly feeded with the same string, and a
new search was triggered.
2021-02-28 17:36:06 +01:00
Enrico Forestieri
61db164302 Fix bug #11444 2021-02-28 14:56:42 +01:00
Juergen Spitzmueller
1205018286 Use a proper filter bar in the outliner 2021-02-28 13:57:24 +01:00
Daniel Ramoeller
2a8cac75f4 Adjust adv. find & replace pane spacing
Partial fix of bug #12152.
2021-02-28 13:13:30 +01:00
Daniel Ramoeller
11548c523a Adjust code preview spacing
Partial fix of bug #12152.
2021-02-28 13:10:03 +01:00
Daniel Ramoeller
55f2445278 Adjust outliner spacing
Partial fix for #12152.
2021-02-28 13:06:14 +01:00
Juergen Spitzmueller
5573825202 HiDPI support for search indicators (#12162)
Requires Qt5
2021-02-28 12:35:29 +01:00
Richard Kimberly Heck
170f06089d Add a bit of debugging code 2021-02-27 20:34:29 -05:00
Enrico Forestieri
7b526d6461 Fix bug #3751
We lack the necessary font (cmb10) for drawing bold uppercase greek
letters. It would be overkill adding it for this sole purpose, so
adopt the same poor man's bold strategy used with \boldsymbol.
2021-02-27 21:40:28 +01:00
Richard Kimberly Heck
0895b76f1e Fix bug #12169
Patch from Daniel.
2021-02-27 13:27:05 -05:00
Enrico Forestieri
195b928f92 Fix bug #3294 2021-02-27 14:49:55 +01:00
Kornel Benko
a3e10cd067 FindAdv: Added handling of some chars found in unnicodesymbols 2021-02-27 14:14:28 +01:00
Enrico Forestieri
c2facb8c56 Fix cursor navigation in \overbrace and \underbrace
Due to the way these decorations are implemented, entering
them with the cursor (either form right or left) required
pressing two times cursor left or right.

Fixes #2264
2021-02-26 20:30:41 +01:00
Daniel Ramoeller
d74367a96e Use document mode on work area and docks on macOS
- More fittingly (plain) looking tabs for documents and docks.
- Also macOS fix for bug #9391.
2021-02-26 20:01:43 +01:00
Jean-Marc Lasgouttes
42b23f3fb2 Display bookmarks in the workarea (take 2).
The bookmarks are shown with circled numbers in the right margin (or
the left margin in RTL mode). A new color "bookmarks" has been added.
Currently bookmark 0 (the return position) is not displayed because it
is very disturbing in practice.

To make this work, a new method BookmarksSection::bookmarksInPar
retuns the list of bookmarks in a paragraph along with their position.

Force redraw when using bookmark-save and bookmark-clear.

Caveats:

- this solution does not show the precise position of the bookmark
  (this is supposedly not a problem).

- if several bookmarks are on the same row, they will currently be
  garbled. It would be easy to make sure that only one is shown ; what
  would be more difficult would be to move the second bookmark lower.

- it is possible to make sure that the markers are correctly centered
  in the margin, and that the margin size is large enough to hold the
  marker (I did not try all fonts).

Fixes bug #2496.
2021-02-26 19:09:25 +01:00
Jean-Marc Lasgouttes
e4ab91d802 Revert "Display bookmarks in the workarea."
This will be replaced by a different version.

This reverts commit 99e636ae7b.
2021-02-26 18:07:39 +01:00
Richard Kimberly Heck
946d112ee6 Allow to call cap::switchBetweenClasses without an ErrorList.
It turns out that we usually don't care about the errors and so
were creating dummy ErrorList objects in several places.
2021-02-25 21:49:50 -05:00
Jean-Marc Lasgouttes
3e3ad2937c Remove assertion that is not necessary.
It may happen that there are errors when doing undo, crashing does not
help in this case.

Fixes bug #12163.
2021-02-25 20:00:41 +01:00
Jean-Marc Lasgouttes
d7a4f47e7d Improve HiDpi handling
Add code stolen from QBitTorrent that enables properly HiDpi handling.

HighDpi support is set by default starting with Qt 5.6.

Support for fractional scaling is added for Qt >= 5.14.

Hopefully fixes bug #12060.
2021-02-25 19:24:22 +01:00
Enrico Forestieri
3cf5a064db Amend 368e983a 2021-02-23 21:48:54 +01:00
Enrico Forestieri
368e983abb Fix bug #12165 2021-02-23 20:00:50 +01:00
Jean-Marc Lasgouttes
f59dafe898 Fix cursor position when undoing inset-dissolve.
When invoking inset-dissolve with the cursor in front of the inset,
add recordUndo call to make sure that the cursor is at the right
class.

Fixes bug #12164.
2021-02-23 19:24:54 +01:00
Enrico Forestieri
2629bd6dfb Improve fix for #12153
Use a WYSIWYM approach instead of a WYSIWYG one.
2021-02-23 17:34:19 +01:00
Juergen Spitzmueller
55da675efa FancyLineEdit: use QLineEdit's own clear button with Qt >= 5.2 2021-02-23 16:53:15 +01:00
Jean-Marc Lasgouttes
a5fd5d3cd2 "12 pixels ought to be enough for anyone"
Fixes bug #12153.
2021-02-22 19:35:08 +01:00
Daniel Ramoeller
e050435314 Adjust label size to directory names in About
Fix for bug #11946.
2021-02-22 07:19:28 +01:00
Jean-Marc Lasgouttes
41d29ce387 Reduce the value of (above|below)displayskip
The value of 10pt is too large, use a 'mean' value of 8.5pt.

Tentative fix to bug #12153.
2021-02-21 20:40:09 +01:00
Pavel Sanda
9e734339e9 Compile with gcc 4.9 again. 2021-02-21 20:05:06 +01:00
Thibaut Cuvelier
5b9929c9d7 Amend 61657bd610
Restore indentation to be more consistent.
2021-02-21 13:15:10 +01:00
Enrico Forestieri
4e0d7f753b Draw real dots
A new method for drawing ellipses has been added to the painter
and used for drawing real dots for math decorations and the various
\cdots, \ddots, \vdots, etc., latex commands.
2021-02-21 00:39:12 +01:00