Commit Graph

29248 Commits

Author SHA1 Message Date
Juergen Spitzmueller
5d084c86c9 Add direction switch with Babel/bidi (#12864)
Patch by Udi Fogiel
2023-08-17 14:29:23 +02:00
Juergen Spitzmueller
315c2f132a Account for babel's bidi option (#12866)
bidi=bidi-{r,l} load the bidi package
2023-08-17 14:25:33 +02:00
Richard Kimberly Heck
a6b83b7444 Make code a bit easier to read 2023-08-16 18:52:04 -04:00
Richard Kimberly Heck
b828da02f8 Slight rearrangement 2023-08-16 18:38:19 -04:00
Richard Kimberly Heck
62483d102d Whitespace and range 2023-08-16 18:22:11 -04:00
Richard Kimberly Heck
d312b32ec8 Fix bug #12852. 2023-08-16 17:51:55 -04:00
Juergen Spitzmueller
124eda3a0d Properly resolve files and dois in InsetCitation (#12878) 2023-08-16 12:47:42 +02:00
Juergen Spitzmueller
71693280c3 Improve usability of quotation mark selection (#12872) 2023-08-15 20:21:32 +02:00
Juergen Spitzmueller
5ebf9e3ac6 Leaner solution for the babel prettyref woes 2023-08-15 17:05:58 +02:00
Pavel Sanda
5936076181 Fix crash when calling dialog-show with bogus names (#12873). 2023-08-14 23:54:47 +02:00
Juergen Spitzmueller
f050fd9626 Fix cursor navigation in error dialog (#12876) 2023-08-14 18:44:10 +02:00
Juergen Spitzmueller
fc3b4cc8d1 Fixup 858b076ab7
Patch by Udi
2023-08-12 12:47:32 +02:00
Juergen Spitzmueller
858b076ab7 Work around French babel's incompatibility with prettyref
In classic (pdf)latex, where the colon is activated, detokenize
the argument of \prettyref.

Fix proposed by egreg at
https://tex.stackexchange.com/a/527912/19291
2023-08-11 17:35:18 +02:00
Udi Fogiel
6671f9bee1 Graphics inset is not forceLTR without pdftex (#12865) 2023-08-11 12:25:03 +02:00
Juergen Spitzmueller
a03c442a62 GuiCitation: consider filter on dialog creation (#12869) 2023-08-11 12:04:26 +02:00
Juergen Spitzmueller
4676a50944 Amend dcde026446
Add missing options update at dialog contruction
2023-08-11 11:44:35 +02:00
Udi Fogiel
dcde026446 disable-default-font-options LyX does not output any LaTeX code when adding optinos to the font, so we should disable adding options to fonts in that situation. 2023-08-11 11:21:22 +02:00
Udi Fogiel
9f29fb33d1 prioretize-user-font-options 2023-08-11 11:13:24 +02:00
Juergen Spitzmueller
02ba1a1327 Fix selection restoration in quick search (#12779) 2023-08-11 11:07:53 +02:00
Enrico Forestieri
4fa0fbe5bf Use utf8 strings for previewed labels when possible
Fixes bug #12842.
2023-08-10 18:34:17 +02:00
Juergen Spitzmueller
f75f73a402 Fix InsertTableWidget interference with tooltip geometry on Qt6 (#12776)
The current method played badly with Qt6 on wayland
2023-08-10 16:43:06 +02:00
Scott Kostyshak
cc951cd411 Comments 2023-08-10 06:17:29 -04:00
Daniel Ramoeller
a2310d04f4 Keep cursor position when splitting
Fix for #12689
2023-08-10 06:10:08 -04:00
Scott Kostyshak
224f21c856 Update tex2lyx tests after format change to 618
Amends 9e8901f9.
2023-08-06 15:09:14 -04:00
Pavel Sanda
05276c5bea Our default for paste operation should preserve newlines.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg220061.html
2023-08-06 17:05:55 +02:00
Pavel Sanda
9e8901f997 Adding hebrew quotation marks (bug #12849).
Patch from Udi Fogiel.
2023-08-06 16:50:07 +02:00
Stephan Witt
d656e01172 #12626 disable Ok button of shortcut editor when LFUN is empty 2023-08-06 00:28:50 +02:00
Stephan Witt
49fe82ec8d #10740 fix focus problems with color picker on Mac
- closing the color picker focuses the wrong (main) window
- to return focus to correct (parent) window it has to be activated explicitly
2023-08-05 15:24:33 +02:00
Stephan Witt
65ec100f6a #12576 improved file name chooser implementation for GUI dialogs
- code reorganization to move the file name chooser methods in GuiDialog class
- on Mac add explicit raise of the current dialog window on close of the file browser to work around the bug 12576
2023-08-05 08:56:35 +02:00
Stephan Witt
550c79215b #12001 make message boxes modal on Mac 2023-08-02 18:00:02 +02:00
Pavel Sanda
7b13cccb99 DocBook: fix encoding of citations.
Patch from Thibaut.
2023-08-01 16:11:21 +02:00
Richard Kimberly Heck
95cc596b7d Fix reference to temporary 2023-07-29 14:41:22 -04:00
Richard Kimberly Heck
7fb3773e60 Fix up 04fc48d790. 2023-07-29 13:53:59 -04:00
Richard Kimberly Heck
6cffef87d2 Fix silly mistake in 04fc48d79 2023-07-29 12:34:38 -04:00
Richard Kimberly Heck
2e945584bf Catch another potential crash of the same kind as in the previous commit.
Also refactor.
2023-07-28 23:09:00 -04:00
Richard Kimberly Heck
aacc5147b6 Fix crash when modifying an InsetRef inserted by the current author.
The problem was that, in this case, we actually delete the current inset
in changeCmdName. So when we return from that and attempt to call initView(),
we're in a non-existent inset.
2023-07-28 22:57:57 -04:00
Richard Kimberly Heck
aec6a764f7 Remove debug code 2023-07-28 17:51:55 -04:00
Richard Kimberly Heck
04fc48d790 New RefFormat tag for counters, and PrettyFormat for floats.
Layout format updated to 104.
2023-07-28 17:37:13 -04:00
Richard Kimberly Heck
57f284d9a8 Whitespace 2023-07-28 17:16:06 -04:00
Richard Kimberly Heck
1ea8b272a0 Polish 2023-07-28 17:13:12 -04:00
Richard Kimberly Heck
5164b2853e Fix bug #12337. Reorder plural and caps indicators. 2023-07-28 12:10:21 -04:00
Richard Kimberly Heck
ae5b4367d1 Fix bug #12235: Select text in search field on opening.
Patch slightly modified from one by Daniel.
2023-07-28 12:07:23 -04:00
Richard Kimberly Heck
5cb80b867f Hack to display section symbol 2023-07-28 12:07:15 -04:00
Pavel Sanda
80dac0e52a Fix wrong nesting in Outline.
Fixes #12814, patch from Yuriy.
2023-07-28 10:31:54 +02:00
Richard Kimberly Heck
96dfc081b7 Fix bug #11822.
Allow counter formatting strings in PrettyFormat. Patch from Daniel.
2023-07-27 21:20:53 -04:00
Richard Kimberly Heck
5b2b0d5c76 Fix bug #12819.
Pop a warning and mark the buffer dirty if the file is deleted from disk.
2023-07-27 18:13:42 -04:00
Richard Kimberly Heck
a13fb42a03 Add FIXME for bug #12828 2023-07-27 18:13:42 -04:00
Pavel Sanda
56d9b713c7 Save translators time, already used on different places. 2023-07-27 23:24:11 +02:00
Richard Kimberly Heck
d815f382fa Fix warning 2023-07-27 16:57:04 -04:00
Pavel Sanda
9c7030b36b Revert a9c6fb0c.
Causes regression, see #12841.
2023-07-27 22:39:49 +02:00
Richard Kimberly Heck
8424213ae4 Use non breaking space 2023-07-27 16:36:11 -04:00
Daniel Ramoeller
9361bf56a3 More consistent line spacing/leading
Uses maxHeight (= maxAscent + maxDescent) as leading.

Fix for bug #11818.
2023-07-27 10:36:41 +02:00
Thibaut Cuvelier
9a163399fb XHTML: remove deferred text in InsetListings, fixing 12007. 2023-07-27 10:29:42 +02:00
Thibaut Cuvelier
98d1b04160 Before this patch, each character within InsetMathClass was output separately, without understanding their meaning, using the default text output (with [] around each character). This commit changes the behaviour to skip the InsetMathClass during the MathML output. This effectively renders the inset useless for MathML (instead of controlling spacing), as expected, because the MathML processor is supposed to handle the spacing itself.
Another implementation would have been to use the lspace and rspace attributes in MathML, but they require to give the exact spacing before and after the operator instead of relying on rules like TeX.

For instance, `$a\mathbin{+}b$` resulted in this MathML output before the patch:

```
<math xmlns='http://www.w3.org/1998/Math/MathML'>
<mrow>
 <mi>a</mi><!--  -->
 <mi>[mathbin [char + mathalpha]]</mi>
 <mi>b</mi>
</mrow>
</math>
```

For comparison, this was the output with LyX 2.3.7

```
<math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow>
  <mrow><mi>a</mi><!--  -->
   <mi>[mathbin [char + mathalpha]]
   </mi><mi>b</mi>
  </mrow>
 </mrow></math>
 ```

 After this patch, it looks like:

 ```
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mstyle class='math'>
  <mrow>
   <mi>a</mi>
   <mo>+</mo>
   <mi>b</mi>
  </mrow>
 </mstyle>
 </math>
 ```
2023-07-27 01:22:30 -04:00
Richard Kimberly Heck
cc22d766a9 Slight rearrangement 2023-07-27 01:22:30 -04:00
Richard Kimberly Heck
f393e6d219 Fix bug #8741 2023-07-27 00:09:26 -04:00
Richard Kimberly Heck
2224e85030 Make Alt-escape work for search as well 2023-07-26 16:52:30 -04:00
Jean-Marc Lasgouttes
7f23bd4aca Restore some checks that were useful for search
It is really back of the enveloppe spacing, but people liked it this way.

Fixes ticket #12767.
2023-07-26 22:46:05 +02:00
Richard Kimberly Heck
926ae84921 Use Alt-Escape to float and unfloat dock widgets.
For some reason, redocking is not working for me at all. This
key seems free.
2023-07-26 14:26:02 -04:00
Alexander Dunlap
c609e9cbcf Display equation/theorem numbers in insert cross reference dialog.
Fixes bug #11466,
2023-07-26 13:35:42 -04:00
Juergen Spitzmueller
7f4c4cd548 Improve AllowedOccurrences
This does now apply to the whole inset or paragraph group (not to the
current paragraph only) unless the new boolean AllowedOccurrencesPerItem
is set and we are in a list-type environment.

Amends 729ab602ca
2023-07-26 09:53:25 +02:00
Juergen Spitzmueller
729ab602ca To finish up #6854, also add AllowedOccurrences
Again very basic for now (this only considers the current paragraph,
not the whole inset or a serious of grouped layouts
2023-07-25 15:49:53 +02:00
Juergen Spitzmueller
0b463bfe0f Add AllowedInInsets and AllowedInLayouts InsetLayout tags
This allows to restrict the use of flex insets to specific contexts.

Note that this is currently very basis. It only considers immediately
containing insets/layouts and can be surpassed via cut and paste.

The use case that made me finally implement this are macros in covington
that make sense only in specific environments (but also consider \inst
in some article classes)
2023-07-25 13:37:07 +02:00
Juergen Spitzmueller
bc95ff1ace Whitespace 2023-07-25 11:13:18 +02:00
Jean-Marc Lasgouttes
6a8c10f0d6 Display footnote labels as superscripts
A new counter type \superarabic is introduced, that transforms the
counter into superscript Unicode numbers.

This is used for the footnote counter.

The Foot inset layout is modified to use an empty LabelString (in size
Normal, since the numbers could be too small).

We use this occasion to set footnote text in footnotesize, as it should.

A couple of changes are done to the code to make the button label and
tooltip look better.

Fixes bug #12238.
2023-07-24 11:15:03 +02:00
Juergen Spitzmueller
6d167e94f4 Add accelerators 2023-07-24 10:33:20 +02:00
Juergen Spitzmueller
d212013bd7 Fix casing 2023-07-24 10:26:57 +02:00
Pavel Sanda
ae3aaa9ade Add a "nogui" option to the inset-edit lfun (bug 11956). 2023-07-24 01:21:52 +02:00
Jean-Marc Lasgouttes
35359a4c6f Improve branch activatiion LFUNs
* put the code that is called both from Buffer and InsetBrach in the
  two helper methods Buffer::branchActivationStatus() and
  Buffer::branchActivationDispatch().

* Cleanup the code so that _MASTER_ lfuns are disabled when there is
  no master document.

* When changing branches in the master buffer, make the buffer visible
  if it is not, and make sure that undo information is recorded.

* The code in Buffer::dispatch is used first, and it gives control to
  the branch inset code if no branch name has been specified.

Fixes bug #12588.
2023-07-23 18:57:38 +02:00
Jean-Marc Lasgouttes
0f7404392c Fix issues with inset-dissolve in mathed
* do not try to dissolve a macro template inset (avoids a crash)
* disable inset-dissolve when an argument is given
* when triggered by the AtPoint mechanism, make sur to dissolve the
  right inset.

Fixes bug #12562.
2023-07-23 17:39:39 +02:00
Jean-Marc Lasgouttes
62d61e7655 Revert "Fix crash when dissolving a top level math inset"
The code was too convoluted and actually wrong (the -1 should have been -2).

This reverts commit c75522bbb7.
2023-07-23 17:38:47 +02:00
Jean-Marc Lasgouttes
81e35bc396 Replace hardcoded inheritFont() with InheritFont InsetLayout tag
Each removed inheritFont method is replaced by a 'InheritFont false'
line in the relevant InsetLayout entry.

Add code to layout2layout that does this automatically when the entry
is missing.

The case of InsetScript is special, since the inheritFont() was not
needed here: the default is indeed true.

Fixes bug #12238.
2023-07-22 23:38:53 +02:00
Pavel Sanda
fe953000ed Fix application of PARAGRAPH_PARAMS* in selection.
- Setting in the last paragraph of selection was not applied
  at certain conditions (i.e. relative cursor position in first
  paragraph > rel.c.pos. in last paragraph).

Getting back + fixing typo from e2b42b1726.

https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg220019.html
2023-07-22 18:17:46 +02:00
Jean-Marc Lasgouttes
cfe094a380 Introduce new InsetLayout tag InheritFont
The font inside the inset is inherited from the parent for LaTeX
export if this parameter is true, as well as on screen. Otherwise
the document default font is used.

The default value is true.

Update tufte layouts to use this tag for sidenote and marginnote flex
insets.

Increase layout format to 101.

Fixes bug #12238.
2023-07-22 15:53:14 +02:00
Jean-Marc Lasgouttes
c8c589353a Detect when one tries to bind a lfun to a prefix of longer commands
Change KeyMap::getBinding to return FuncRequest::prefix in this case.

Add handling of this case in PrefShortcuts::validateNewShortcut.

What does not seem to work is that if, for example, accent-acute is
bound to M-s (which is a prefix for size-related bindings), and then
the binding is removed, the functions are not visibly restored.

Part of bug #10131.
2023-07-22 00:01:34 +02:00
Jean-Marc Lasgouttes
f31bf0df1d Send some debug info to ACTION 2023-07-20 23:39:15 +02:00
Juergen Spitzmueller
0e0c2c6120 Update tex2lyx tests 2023-07-20 15:22:47 +02:00
Juergen Spitzmueller
2841a1c063 Update covington support in linguistics module (file format change) 2023-07-20 15:09:47 +02:00
Kornel Benko
11f44c00e0 FindAdv: Handle negthinspace, negmedspace and negthickspace also in regexes 2023-07-20 12:32:58 +02:00
Pavel Sanda
5b34105514 Group most verbose dbg output into more intuitive categories.
From now on, having all dbg level except of painting and scrolling
shows debug output which can be actually followed.
2023-07-18 22:25:28 +02:00
Jean-Marc Lasgouttes
008cec3eec Honor scroll_below_document when jumping to end of document
While fixing #12491 at 0fed10e4, some band-aids were removed at the
end of `BufferView::scrollToBuffer`. One of them ensured that
scrolling to last paragraph would not leave the last row alone on
screen.

This behavior is actually correct when the scroll_below_document pref is true.

This commit restores the test that avoids the issue.

Of course, this does not fix the real issue, since for example opening
Tutorial.lyx and jumping to "5.3 Errors!" produces the same unwanted
effect.
2023-07-18 21:03:00 +02:00
Juergen Spitzmueller
649cb30963 Another tiny correction (not yet ideal) 2023-07-18 18:11:59 +02:00
Juergen Spitzmueller
7640d1fbf5 Remove bogus condition and add comments 2023-07-18 17:55:08 +02:00
Juergen Spitzmueller
eadc8ab147 LaTeXHighlighter: handle grouped values with commas in keyval options 2023-07-18 17:35:48 +02:00
Juergen Spitzmueller
9e308ddb03 Improve keyval highlighter 2023-07-18 17:05:56 +02:00
Juergen Spitzmueller
c549a2b59c At end of children, language needs to be reset
This amends 243b0ef90c
2023-07-18 15:27:17 +02:00
Juergen Spitzmueller
6603ae2242 Support option snippets in the LaTeXHighlighter 2023-07-18 15:13:48 +02:00
Kornel Benko
8eda9e25e0 Acount for all non-negative spaces used by lyx
The unicode representation in an ascii-string string is
\302\240                                Normal space
\342\200\257                            Non-breaking Thin (1/6 em)
\342\200\213\342\200\205\342\200\213    Medium(2/9 em)
\342\200\213\342\200\204\342\200\213    Thick (5/18 em)
\342\201\240\342\200\202\342\201\240    Half Quad(0.5 em)
\342\200\203                            Quad(1 em)
\342\200\203\342\200\203                Double Quad(2 em)
\342\220\243                            Visible space

'Double Quad' counts as 2 spaces, all others count as 1 space in the search regex
2023-07-18 13:09:55 +02:00
Juergen Spitzmueller
cd080da3c4 Fix thinspace search regex 2023-07-18 07:28:18 +02:00
Jean-Marc Lasgouttes
430c41cd05 Fix display of comment char in "lyxlex" debug channel 2023-07-17 23:02:46 +02:00
Juergen Spitzmueller
999b95398d THINSPACE is nonbreakable (i.e., 0x202f, not 0x2009) 2023-07-17 17:14:50 +02:00
Juergen Spitzmueller
f6f936e3d0 Support protected and thin space in simple search (#12836) 2023-07-17 16:58:58 +02:00
Juergen Spitzmueller
e87ace901a Style 2023-07-17 16:55:47 +02:00
Juergen Spitzmueller
edaf28fdd6 Do not throw away runparams settings of InsetText in InsetFoot::latex
This amends 243b0ef90c
2023-07-17 13:18:56 +02:00
Jean-Marc Lasgouttes
13d24c711e When breaking a paragraph, do not reset depth
Remove some logic that would reset depth when editing non-environment
stuff (e.g. Standard layout) at non-zero depth. The current way of
decreasing depth is to use paragraph-break in an empty paragraph.

See discussion in ticket #2445 for why this code happened.

Fixes bug #12750.
2023-07-16 17:16:02 +02:00
Stephan Witt
c4195defe6 #12818 amend last change b924db72c5 - use c++ 11 compiler compatible code 2023-07-16 17:11:38 +02:00
Stephan Witt
b924db72c5 #12818 correct evaluation of message box result info
The help page of int QMessageBox::exec() (​https://doc.qt.io/qt-6/qmessagebox.html#exec) says:
When using a QMessageBox with standard buttons, this function returns a StandardButton value indicating the standard button that was clicked.
When using QMessageBox with custom buttons, this function returns an opaque value; use clickedButton() to determine which button was clicked.
2023-07-16 16:49:02 +02:00
Juergen Spitzmueller
b397c78b70 Move comment to where it belongs 2023-07-16 16:46:02 +02:00
Juergen Spitzmueller
243b0ef90c If language needs to be reset at the end of footnotes or floats
then do reset it only after footnotes or floats. \selectlanguage at
the end of environments might produce spurious vertical space
(see https://marc.info/?l=lyx-devel&m=168872369617866)
2023-07-16 16:31:31 +02:00
Jean-Marc Lasgouttes
386a2ddca1 Cache the value of FontMetrics::xHeight()
This value is computed for the metrics of *every* Mathdata and hotspot
says that it counts for 9% of total on math-heavy "branch-test.lyx"
file. I am not sure that real world agrees with that, but profiling
shows that Qt itself does not cache the value.

Part of reinvestigation of #12297.
2023-07-15 23:32:59 +02:00
Jean-Marc Lasgouttes
d8e509e5eb Cleanup and (maybe) speedup InsetMathChar::mathClass
Profiling with hotspot show that it counts for more than it should and
indeed using support::contains is a overkill here. I like the new code
better anyway.

I would be surprised to see that it makes a big difference, though.
2023-07-15 23:29:24 +02:00
Jean-Marc Lasgouttes
582eb7cc03 add comment 2023-07-15 15:20:28 +02:00
Daniel Ramoeller
975115479a Don't add LabelString for Manual LabelType
Fix for bug  #12753
2023-07-14 19:06:40 +02:00
Jean-Marc Lasgouttes
4bbd4a45e7 Fix display of a math hull inset in a tight inset
This is a kind of hack. This allows InsetMathHull to state that it
needs some elbow room beyond its width, in order to fit the numbering
and/or the left margin (with left alignment), which are outside of the
inset itself.

To this end, InsetMathHull::metrics() sets a value in
MetricsInfo::extrawidth and this value is recorded later in the
corresponding row element's `extra' field.

The code could be reorganized to be simpler, in particular by
computing metrics in tokenizeRow, or after tokenizeRow. However the
choice here is to produce a simple patch, fit for 2.4.0.

Fixes bug #12320.
2023-07-14 17:17:23 +02:00
Jean-Marc Lasgouttes
7cc431bd55 Add optional parameter 'local' to outline-in/out
When this parameter is given, only the current paragraph is affected
by the section promoting/demoting.

Note that the new argument is not used yet.

Update release notes and LFUNS documentation.

Part of ticket #12417.
2023-07-06 17:47:08 +02:00
Jean-Marc Lasgouttes
a3db9a667f Outline: swap order of up and down arrows
The order is more natural now.

See discussion in #12809.
2023-07-06 17:47:08 +02:00
Scott Kostyshak
c4cdff5de2 Fix cursor font after collapsing inset (#12830)
If the cursor is in an inset, and it is closed (e.g., with ctrl + i,
or inset-toggle), the cursor is moved outside of the inset, so the
font must be reset.
2023-07-06 08:40:41 -04:00
Pavel Sanda
fb43449c80 Hide multi-keystroke accelerators in Mac menu (bug 12693).
Patch from Juergen.
2023-07-05 20:45:26 +02:00
Daniel Ramoeller
28a9124241 Fix combined zoom widget on windows (bug #12803). 2023-07-04 19:08:51 +02:00
Pavel Sanda
9d8bef017b Add bug reference. 2023-07-03 23:54:34 +02:00
Juergen Spitzmueller
d5a9699794 Fix inset context menu offset with keyboard (#12811) 2023-07-03 16:28:38 +02:00
Juergen Spitzmueller
94dd5ed6eb Avoid unnecessary cprotect loading (#12826) 2023-06-30 16:31:13 +02:00
Scott Kostyshak
551ede855a Style and whitespace 2023-06-29 05:31:41 -04:00
Enrico Forestieri
befe2da495 Honor pending spaces in InsetMathChar::write
The InsetMathChar::write() method directly accesses the otexrowstream
underlying the TeXMathStream class for writing a character, thus
shortcircuiting the mechanism that allows to separate a macro from the
following material. It has to do so because directly writing a char_type
would cause printing its numerical value instead of the corresponding
unicode character in systems where char_type is typedef'd to uint32_t.

This problem has been uncovered by [7441172d/lyxgit] because each atom
of a mathed cell was being separately written to the output instead of
using the lyx::write() method in MathExtern.cpp that simply converts
everything to a docstring. As InsetMathChar::write() is the only method
bypassing the TeXMathStream machanism, it is simpler teaching it to
honor the pending space instead of modifying the code in InsetMathColor.

This commit amends 7441172d.
2023-06-28 21:17:26 +02:00
Jürgen Spitzmüller
889dac7def Prevent par break caused by \egroup (#12821) 2023-06-28 14:46:46 +02:00
Jean-Marc Lasgouttes
8aea6af6a0 Make outline function work in an inset
The function outline is modified to operate only in the inset that
contains the cursor. This means that the function can be enabled in
insets (this had been forbidden to fix #5004).

Of course, there may be cases where the user expects something to
happen outside of the inset. I am sorry to announce that this is not
going to happen ;)

Fixes bug #12809.
2023-06-27 14:58:27 +02:00
Scott Kostyshak
f208f18022 Update tex2lyx tests
Update the test files after the last format change (c3f98d1f).
2023-06-21 15:03:47 -04:00
Jean-Marc Lasgouttes
65b03c7c72 Improve label font computation in insets
This patch reuses the code of TextMetrics::displayFont() that handles
the label part of LABEL_MANUAL paragraphs to create a new
labelDisplayFont() method usable for things like Itemize labels.

To this end, and new magic value is used as position to force the
label case in displayFont(). The code is also factored a bit and
cleaned up.

Fixes bug #12810.
2023-06-21 17:23:34 +02:00
Juergen Spitzmueller
6c4afc1ccb Show full inset context-menu when clicking on text part of collapsible (#10370) 2023-06-20 11:00:13 +02:00
Juergen Spitzmueller
75eb3abcfb typo 2023-06-20 11:00:05 +02:00
Jean-Marc Lasgouttes
b82a7279a8 Comments cleanup 2023-06-20 00:06:57 +02:00
Scott Kostyshak
f14384ff91 Add "override" to fix warning
Otherwise we get the following warning:

src/frontends/qt/InsertTableWidget.h:44:7: error: 'hideEvent' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
        void hideEvent(QHideEvent * event);
             ^

Amends ca5a75b2.
2023-06-19 14:52:45 -04:00
Juergen Spitzmueller
2bbc420032 Disable LFUN_INDEX_TAG_ALL if there is noting to tag (#12812) 2023-06-18 12:45:25 +02:00
Daniel Ramoeller
ca5a75b23e Properly uncheck insert table toolbutton
Fix for bug #12801
2023-06-18 12:20:35 +02:00
Scott Kostyshak
eac460e438 Remove the mathed "BUGS" file (#3493)
Jürgen cleaned up the previous contents of this "BUGS" file. What
was left (before the rm in this commit) had been written in 2001 at
2dd1a460, and it is not clear if it is still relevant.
2023-06-15 05:15:32 -04:00
Daniel Ramoeller
c13c959974 Fix margins and spacing of InsetParamsUI
Fix for bug #12244.
2023-06-15 04:18:36 -04:00
Daniel Ramoeller
7371a99256 Fix for HiDPI logo in About
Fix for #12322.
2023-06-13 09:56:48 -04:00
Scott Kostyshak
67ff56c63a Whitespace 2023-06-13 09:55:53 -04:00
Pavel Sanda
152811a27d Activate work area by tab click.
Fix for #11835.
Patch by Daniel Ramoeller.
2023-06-13 12:11:11 +02:00
Yuriy Skalko
2475a6a616 Move Fullscreen preferences from Editing>Control section into Look & Feel>User Interface section 2023-06-13 11:28:31 +02:00
Pavel Sanda
afb918bf78 Fix for #12681.
Number Paste Recent menus entries as in toolbar.
Slightly improved patch from Daniel Ramoeller.
2023-06-13 10:07:56 +02:00
Richard Kimberly Heck
0c69a5eab2 Fix bug #12796 2023-06-12 19:38:40 -04:00
Daniel Ramoeller
8124e6c02e Fix bug #12795 2023-06-12 19:33:25 -04:00
Richard Kimberly Heck
c3f98d1fa4 The lyx2lyx for the previous commit. 2023-06-11 12:55:51 -04:00
Enrico Forestieri
c33f2f50a0 Do not output LaTeX for a macro if the LaTeX part is empty. 2023-06-11 12:55:51 -04:00
Juergen Spitzmueller
3be39de1f7 Address deprecation warning
QMutexRecursive has been introduced with Qt 5.14, the warning with
Qt 5.15.2
2023-06-11 13:15:55 +02:00
Juergen Spitzmueller
833f8c148e Limit QEvent::ApplicationPaletteChange casing to Mac
This is not needed on Linux and dramatically slows down runtime mode
change
2023-06-11 12:43:30 +02:00
Juergen Spitzmueller
3af906e9f3 Fix crash on OS-switch of dark/light mode (#12786)
At least for Mac and Linux. Windows needs testing and possibly its
own fix.
2023-06-10 08:30:31 +02:00
Jean-Marc Lasgouttes
24f4c51f0e inset-split should not be dispatched to inset at point
This functon does not make sense for a full inset.

Fixes second part of bug #12747.
2023-06-06 11:10:45 +02:00
Daniel Ramoeller
5a893d9862 Replace selection on insert LyX Document
Fix for bug #10390
2023-05-31 01:01:22 +02:00
Daniel Ramoeller
c0d7ac5b71 Split-inset fix
- Remember whether something has to be pasted

Fix for bug #12747
2023-05-31 00:05:23 +02:00
Daniel Ramoeller
2e966811d8 Center preview status message
Fix for bug #12724
2023-05-30 14:12:11 +02:00
Richard Kimberly Heck
9a4e44e7df Fix indentation 2023-05-27 11:38:19 -04:00
Richard Kimberly Heck
04fe6c89dc Fix typo 2023-05-27 11:37:00 -04:00
Daniel Ramoeller
4ed0312c51 Fix bug #12772 2023-05-26 23:39:28 -04:00
Jean-Marc Lasgouttes
3895c79879 Fixup 1d637b8a: do not set extra spacing for typewriter
This messed up rows with both normal and typewriter fonts.
2023-05-23 09:22:51 +02:00
Juergen Spitzmueller
ba659d0cfd Fix indentation 2023-05-22 16:32:49 +02:00
Juergen Spitzmueller
25ecd919fe Use proper (inset) font for normalizing purposes
Not all insets have a proper layout, but we have Inset::getFont()

Fixes #12729
2023-05-19 12:35:03 +02:00
Kornel Benko
f13808939b Advaced search: check for toString() before using it.
(#12783)
2023-05-18 18:07:40 +02:00
Juergen Spitzmueller
92f211d6b4 Replace deprecated function
activateWindow() is available back to Qt4 (at least)
2023-05-17 08:56:12 +02:00
Jean-Marc Lasgouttes
e0db6378c9 Revert "Do not return copies of string members"
This commit is very wrong when trivstrings are used (since what is
retirned is a temporary variable) and it turns out that cygwin
requires this for some reason.

This reverts commit 3ae5d6bdec.
2023-05-15 17:13:41 +02:00
Stephan Witt
ac286e54b7 #12769 correct line width based painting of wavy underline
With very tiny fonts the line width is 0 and the loop to construct the wavy line never ends.
2023-05-15 07:06:44 +02:00
Juergen Spitzmueller
90d40eb95e Add labels to encoding variant combo 2023-05-13 18:38:33 +02:00
Juergen Spitzmueller
75f628aec0 Replace removed signal
The used one has been removed from Qt6
2023-05-12 09:46:38 +02:00
Juergen Spitzmueller
120ba1d3ec Do not attempt to read bitmap icon with svg renderer
Pavel, this should cure your woes
2023-05-12 09:39:20 +02:00
Juergen Spitzmueller
0a040d18ad Some layout fixes
Layout was too squeezed and didn't properly expand on longer (l7n) strings
2023-05-11 17:46:16 +02:00
Pavel Sanda
918146addd Fix DocBook case 2023-05-11 15:29:14 +02:00
Jean-Marc Lasgouttes
6fbc8c6352 Fixup 7f1b1729: restore lazy caret handling
For some reason, the code that should have been put in
updateCaretGeometry() went to resetCaret(). I do not see how that made
sense.

I am not totally sure what the consequences of the patch are, though.
It just "looks right".
2023-05-11 10:13:27 +02:00
Pavel Sanda
b198a36a36 Less expensive OP first as this might be called often. 2023-05-10 12:43:14 +02:00
Pavel Sanda
52fd21f902 Handle stats for French guillemets 2023-05-10 12:23:56 +02:00
Pavel Sanda
63ff4f4431 Count quotes in document statistics as well.
Currently any quote counts as a single character.

https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg219697.html
2023-05-09 20:48:13 +02:00
Pavel Sanda
16da5ef010 * LanguageUi.ui - change layout.
This pane is responsible for horizontal excess size (at least in CZ
translation) of document settings panel. The reason is second encoding combo
which get very lengthy (there are actually 3 of them).
This patch moves them to separate line.

Beware, touching this panel is headache.
Qt Designer (5.15.2) does not know even how to load this ui
file correctly and it's impossible to move unicodeEncodingCO.
When breaking layout this CO is mysteriously deleted.

Finally I gave up and simply edited file in vim to get COs to the new row.
2023-05-09 20:33:42 +02:00
Pavel Sanda
75d731c9d8 * OutputUi.ui - Reorganize Output pane so it takes less vertical space. 2023-05-09 19:06:26 +02:00
Pavel Sanda
20b45cf028 * Document prefs: rename Format -> Output 2023-05-09 19:05:31 +02:00
Pavel Sanda
c3613f1f17 * PrefDocHandlingUi.ui - add naming for emergency file 2023-05-09 18:35:00 +02:00
Jean-Marc Lasgouttes
e620920fe2 Fix unitialized member warning by coverity
The members open_braces and close_wildcards of MatchStringAdv are not
initialized in case of early return and coverity complains about that.
2023-05-09 13:52:33 +02:00
Enrico Forestieri
ee9fca42bb Use black as default color for an inset button label text
It turns out that LyX was using red as default color for the
inset button text since ever. However, due to the use of "inherit",
the default button text color was black in practice. This was so
until [897ee2ed/lyxgit], which made the label font not inherited
by default anymore. Hence, all insets that didn't specify a specific
label button color started using red as default color.

This commit restores the previous behavior and introduces the
possibility of modifying this default color.

Fixes bug #12771
2023-05-09 11:33:13 +02:00
Richard Kimberly Heck
8fac7d7035 If the ending delimiter is at the end of the file, then the test
pimpl_->is
will return false no matter what. So we need a different way to
check if the delimiter was found.
2023-05-06 18:59:40 -04:00
Jean-Marc Lasgouttes
e454deba2c Revert "Move Fullscreen preferences from Editing>Control section into Look & Feel>User Interface section"
I pushed it by mistake.

This reverts commit 4d31e20d7d.
2023-05-05 21:23:21 +02:00
Jean-Marc Lasgouttes
3ae5d6bdec Do not return copies of string members
This fixes the g++ 12 warnings below.

../../master/src/Converter.cpp:714:55: warning: possibly dangling reference to a temporary [-Wdangling-reference]
  714 |                                         Mover const & mover = getMover(conv.to());
      |                                                       ^~~~~
../../master/src/Converter.cpp:714:71: note: the temporary was destroyed at the end of the full expression ‘lyx::getMover(lyx::Converter::to() const())’
  714 |                                         Mover const & mover = getMover(conv.to());
      |                                                               ~~~~~~~~^~~~~~~~~~~
../../master/src/Converter.cpp:786:39: warning: possibly dangling reference to a temporary [-Wdangling-reference]
  786 |                         Mover const & mover = getMover(conv.from());
      |                                       ^~~~~
../../master/src/Converter.cpp:786:55: note: the temporary was destroyed at the end of the full expression ‘lyx::getMover(lyx::Converter::from() const())’
  786 |                         Mover const & mover = getMover(conv.from());
2023-05-05 20:35:23 +02:00
Yuriy Skalko
4d31e20d7d Move Fullscreen preferences from Editing>Control section into Look & Feel>User Interface section 2023-05-05 19:21:37 +02:00
Jean-Marc Lasgouttes
43b24085fb Merge files Text{,2,3}.cpp
This is done at the end of the release cycle to avoid backporting issues.

The goal is to simplify development, since it was difficult to guess
in which file a given method could be found.

There is some effect on compilation time, but it is not too bad:

* before merge

  lapinot: time make Text.o Text3.o Text2.o
    CXX      Text.o
    CXX      Text3.o
    CXX      Text2.o

  real	0m32,504s
  user	0m31,027s
  sys	0m1,446s
  lapinot: rm Text*.o
  lapinot: time make -j8 Text.o Text3.o Text2.o
    CXX      Text.o
    CXX      Text3.o
    CXX      Text2.o

  real	0m21,282s
  user	0m32,661s
  sys	0m1,424s

* after merge

  lapinot: time make Text.o
    CXX      Text.o

  real	0m26,731s
  user	0m25,706s
  sys	0m1,020s
2023-05-04 16:28:09 +02:00
Jean-Marc Lasgouttes
21dcb4782f Never not show caret when window does not have focus
A non blinking cursor could appear when hovering on inset button.

Fixes bug #12762.
2023-05-03 12:22:52 +02:00
Jean-Marc Lasgouttes
e533118b38 spacing 2023-05-03 12:15:26 +02:00
Jean-Marc Lasgouttes
89db357cd6 Code factoring: introduce BufferView::busy()
The WorkArea should not have to look at details of the undo stack.
No change intended.
2023-05-03 11:57:31 +02:00
Daniel Ramoeller
dfc3db773a Fixup 89394bcd: handle cursor keys from keypad
Due to a macOS peculiarity, it is necessary to handle KeypadModifier.
We do it unconditionnally, although only macOS seems to be affected.

"Note: On macOS, [...] The KeypadModifier value will also be set when
an arrow key is pressed as the arrow keys are considered part of the
keypad." (​https://doc.qt.io/qt-6/qt.html#KeyboardModifier-enum)

Related to bug #12572.
2023-05-03 11:25:06 +02:00
Jean-Marc Lasgouttes
ee5dcc9d47 Fixup e1261817: place cursor correctly in RtL
In an RtL paragraph, the cursor should be placed to the right of the
end-of-paragraph indicator.
2023-05-02 16:44:40 +02:00
Jean-Marc Lasgouttes
97ccb8c8c9 Make inset info icons tight again!
This is a follow-up to 5be391b2, which increased the space on
left/right of graphics inset. This extra space makes sense in normal
graphics editing, but is weird in the case of InsetInfo, which has its
own spacing.

Create a special tight graphics inset class, and use that for icons.
2023-05-02 14:49:47 +02:00
Enrico Forestieri
17b24cf480 Re-enable QWindowsMimeMetafile with Qt6
Qt 6.5.0 has dropped support for the QWindowsMime class
in favor of a new QWindowsMimeConverter class. They say:
  "If you have implementations of QWindowsMime or QMacMime in Qt 5,
   then those will almost directly translate to the new APIs but
   require less boiler-plate code to register the converters with Qt."
This may be true, but in practice they break binary compatibility with
previous versions. If you used the QWindowsMime class until Qt 6.4 by
using boiler-plate code to register the converters with Qt, you now
need to modify the sources and recompile. Fantastic!
2023-04-28 23:34:01 +02:00
Pavel Sanda
c6a190d480 Centralize use of "all files" wildcard in dialogs so it's consistent. 2023-04-28 21:59:37 +02:00
Pavel Sanda
a42a57a0b6 Increase hint verbosity, otherwise difficult to understand. 2023-04-27 21:24:49 +02:00
Pavel Sanda
5be391b274 Do not let cursor overlap with inserted graphics.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg219612.html
2023-04-27 20:37:32 +02:00
Scott Kostyshak
1dc55bd88b Fix compiler warning about unused string consts
These trigger a warning with Clang:

src/Session.cpp:34:14: error: unused variable 'sec_session' [-Werror,-Wunused-const-variable]
string const sec_session = "[session info]";
             ^
src/Session.cpp:35:14: error: unused variable 'sec_toolbars' [-Werror,-Wunused-const-variable]
string const sec_toolbars = "[toolbars]";
             ^
2023-04-26 14:06:25 -04:00
Pavel Sanda
72eb386af0 Improve error msg. 2023-04-21 23:15:16 +02:00
Jean-Marc Lasgouttes
f7afcc31fe Fix undo with cell-plit
This function modifies several cells.

Fixes bug #12746.
2023-04-21 14:42:51 +02:00
Pavel Sanda
18be0ec7f8 Few changes in GUI color strings to improve grouping. 2023-04-19 22:25:18 +02:00
Juergen Spitzmueller
a15bc829d1 Do not load mathrsfs if unicode-math is required (#12734)
The latter provides \mathscr and the packages clash
2023-04-15 12:35:22 +02:00
Pavel Sanda
3dd79b1c4e comment only 2023-04-14 23:58:59 +02:00
Pavel Sanda
4b736a19f2 Add few color comments 2023-04-14 23:16:54 +02:00
Juergen Spitzmueller
9ec80456fe tex2lyx: fix import of umlauts and ß in math (#12739) 2023-04-14 19:13:23 +02:00
Pavel Sanda
7f614397ed typo 2023-04-14 10:53:37 +02:00
Pavel Sanda
32209c9845 Typo in metadata glyphs check.
So I belive, but someone please double check.
2023-04-13 21:55:57 +02:00
Pavel Sanda
6b7da5ec8c typo 2023-04-13 21:50:43 +02:00
Pavel Sanda
f664498ba7 typo 2023-04-13 21:36:17 +02:00
Jean-Marc Lasgouttes
d828728cc9 Revert "Automatically adjust tab stop width"
The fix is more complicated than that

This reverts commit bb16efc07e.
2023-04-11 14:19:20 +02:00
Daniel Ramoeller
bb16efc07e Automatically adjust tab stop width
Extend tab stops to the same indentation point instead of a fixed number of spaces.

Fix for bug #12736
2023-04-11 13:36:52 +02:00
Scott Kostyshak
7368e5be2b Amend 1dc66608
Declare override, otherwise we get the following warning:

src/insets/InsetListings.h:42:7: error: 'isEnvironment' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
        bool isEnvironment() const { return !params().isInline(); }
             ^
src/insets/Inset.h:606:15: note: overridden virtual function is here
        virtual bool isEnvironment() const { return getLayout().latextype() == InsetLaTeXType::ENVIRONMENT; }
                     ^
1 error generated.
2023-04-10 13:14:15 -04:00
Juergen Spitzmueller
b42e978080 Do not switch dir with numbers and babel in full unicode
Patch by Udi Fogiel
2023-04-10 15:31:26 +02:00
Juergen Spitzmueller
8917cb3cc8 luabidi's \\LR[E] needs to be embraced (possibly a LuaTeX bug)
without the grouping, trailing text disappears
2023-04-10 15:16:20 +02:00
Juergen Spitzmueller
2abde5d162 Inset::forceLTR() only determines whether explicit switches are needed
(as opposed to InsetLayout::forceLTR()). So properly set this for ERT
and remove downstream special casing
2023-04-10 10:20:11 +02:00
Juergen Spitzmueller
767f3e5b81 Fix spacing in forceLTR for classic latex 2023-04-10 08:37:04 +02:00
Juergen Spitzmueller
e9c8b10c1d Do not forceLTR math with Xe/Lua (part of #12731) 2023-04-10 08:24:46 +02:00
Juergen Spitzmueller
f058442be9 Put forceLTR (display) environments in LRE environment rather than command
This fixes whitespace issues.
2023-04-10 08:10:51 +02:00
Juergen Spitzmueller
1dc666082e Add Inset::isEnvironment()
This usually returns InsetLayout::isEnvironment(), but listings has
specific conditions (depending on whether it is inline or not)
2023-04-10 08:09:32 +02:00
Juergen Spitzmueller
61f2cd27a8 Fix indentation 2023-04-09 15:01:17 +02:00
Juergen Spitzmueller
7b6707fc52 Properly resolve undefined citations with Xe/Lua and bibliography environment
These need an extra LaTeX run
2023-04-08 19:25:30 +02:00
Juergen Spitzmueller
6ec6db8cd9 Fix crash when copying multiple cells in table
while having done "backwards" selection (selBegin() in a later
column/row than selEnd())
2023-04-08 16:55:41 +02:00
Juergen Spitzmueller
849d0c81ca Record babel use for single par preview 2023-04-02 14:51:47 +02:00
Juergen Spitzmueller
84dde6aeb9 Fix indentation 2023-04-02 12:31:41 +02:00
Daniel Ramoeller
211554d0df Fix bug #12721. 2023-03-30 16:12:08 -04:00
Juergen Spitzmueller
3a02e477a0 Sync doc CT settings with dialog-external change of status (#12703) 2023-03-21 10:24:34 +01:00
Jean-Marc Lasgouttes
1d637b8af0 Spaces in typewriter font never expand in justified text
This fixes on-screen appearance of things like code with lines longer
than the window width.

The TeXbook makes it clear by indicating that \fontdimen3 == 0 for
these fonts.
2023-03-18 21:03:42 +01:00
Jean-Marc Lasgouttes
f24bb4a919 Remove indentation on screen after a plain separator inset
Fixes bug #12700.
2023-03-18 19:47:42 +01:00
Juergen Spitzmueller
5ad6cbb1d8 Fix signal order (#12712) 2023-03-18 15:58:04 +01:00
Juergen Spitzmueller
81d6965c81 Do not swap parens and stuff with babel and Xe/LuaTeX 2023-03-17 18:11:38 +01:00
Jean-Marc Lasgouttes
e2011856bc Fixup a2378c1182: handle the monospace case
When the font is tt, the stretch space is null. Change the display
rendering to accomodate that.
2023-03-17 14:27:15 +01:00
Jean-Marc Lasgouttes
98b5a16793 Fix completion in math when inline completion was not yet shown (take 2)
Better version of b4211ef2: we handle the case of a unique completion early.

Fixes bug #12674.
2023-03-16 11:58:49 +01:00
Jean-Marc Lasgouttes
fb1c4494ea Revert "Fix completion in math when inline completion was not yet shown"
A better fix is in the works.

This reverts commit b4211ef206.
2023-03-16 11:58:49 +01:00
Richard Kimberly Heck
7bcf201f40 Fix bug #12707 2023-03-15 23:24:47 -04:00
Jean-Marc Lasgouttes
175bcc6efc Fixup 00c39208: initialise ParagraphMetrics::id_ in default constructor
This was missing. Spotted by coverity.
2023-03-15 23:38:16 +01:00
Jean-Marc Lasgouttes
a2378c1182 Improve display of ellipsis special char
Follow the TeXbook and use a half space as separation.
2023-03-15 12:25:19 +01:00
Jean-Marc Lasgouttes
05469a053f revert/fixup 309f8f4b: setFilterRegularExpression was introduced in Qt 5.12. 2023-03-12 13:05:58 +01:00
Juergen Spitzmueller
7cde89ece7 Remobe static icon sizing which seems to play bad with HiDpi 2023-03-11 18:30:44 +01:00
Juergen Spitzmueller
466e6eb613 Remove workaround for Qt version which is no longer supported 2023-03-11 16:43:08 +01:00
Juergen Spitzmueller
31a197d88c Fix signals 2023-03-11 16:25:25 +01:00
Juergen Spitzmueller
548c5ba92d Two more icon scale fixes 2023-03-11 16:10:52 +01:00
Juergen Spitzmueller
8863d6d785 Properly scale some icons for HiDPI (#12695) 2023-03-11 14:49:07 +01:00
Yuriy Skalko
2b6b20ff69 Include QScreen header to fix compilation with Qt 5.14
Needed after e2e1fd6ea9.
2023-03-10 09:18:59 +01:00
Daniel Ramoeller
2ed5b4a705 Fix text color of "file changed on disk" notification
Adjusts the label color of the notification to the background.

Fix for #12690.
2023-03-09 16:13:00 +01:00
Pavel Sanda
4cccec60ca Improve tooltip. 2023-03-09 10:23:46 +01:00
Juergen Spitzmueller
c227a4af41 Check for invalid indexes in Module selection
This should fix crashes when moving with pressed mouse buttons on
category nods
2023-03-08 08:24:38 +01:00
Jean-Marc Lasgouttes
e2e1fd6ea9 QDesktopWidget is not required in Qt5, the Qt6 code works 2023-03-05 21:54:08 +01:00
Jean-Marc Lasgouttes
9156843ec2 QWidget::setContentsMargins is supported in Qt5 2023-03-05 21:37:01 +01:00
Jean-Marc Lasgouttes
7d78078838 When a displayed inset is aligned left, align it left
The use of LYX_ALIGN_BLOCK was a mistake.

Fixes bug #12683.
2023-03-05 20:59:35 +01:00
Jean-Marc Lasgouttes
f7de345f85 Avoid row breaking at inconvenient places.
The test that was used to avoid breaking a string that was followed
by a too long element was not correct (especially the part that
compared with total row width).

Typical example here is:
- a word with a part that has a font change like /un/breakable;
- a longish sentence after it.

Use a new test that is good enough for this particular case, although
with sortcomings. I do not want to overcomplicate and prefer to wait
for other complaints (this code is already more complicated that I
would like).

Document known shortcoming.

Fix ticket #12660.
2023-03-03 17:24:06 +01:00
Juergen Spitzmueller
e6966647fd Fix intitle context checking for info insets 2023-03-03 14:54:52 +01:00
Juergen Spitzmueller
739905862f Address deprecation
See https://doc.qt.io/qt-6/qbytearray-obsolete.html
2023-03-03 11:37:39 +01:00
Jean-Marc Lasgouttes
309f8f4b40 Remove two remaining snippets from the QRegExp era. 2023-03-03 11:17:58 +01:00
Jean-Marc Lasgouttes
263da2fa20 Remove use of QRegExp
QRegexp has been replaced with QRegularExpression in Qt5. Now that we
have dropped support for Qt4, there is no need for keeping it around.
2023-03-03 10:49:32 +01:00
Jean-Marc Lasgouttes
88c1ed9e32 Remove dead code which is deprecated in Qt6 2023-03-03 10:48:51 +01:00
Pavel Sanda
06928c914f * SpellcheckerUi fix casing in tooltip 2023-03-03 10:45:46 +01:00
Jean-Marc Lasgouttes
00c39208ac At metrics time, store paragraph id too
Instead of actually fixing the messiness of InsetInfo, let's just fix
the symptom and avoid the access to Paragraph::id() that was crashing
LyX every time updateBuffer/validate/metrics/draw did not happen in
the right order.

Fixes bug #12639.
2023-03-03 10:34:18 +01:00
Pavel Sanda
190d2ba2c3 * doxy - correct whitespacing. 2023-03-02 22:03:09 +01:00
Pavel Sanda
96eb65dc32 Spellcheck - more verbose tooltip. 2023-03-02 22:01:17 +01:00
Juergen Spitzmueller
5cb8733660 trim trailing linebreak 2023-02-27 12:16:04 +01:00
Pavel Sanda
9bbec4a75a Fix #12678. 2023-02-26 22:30:17 +01:00
Pavel Sanda
2b6ef1257a Infoinset - better specification of few strings 2023-02-25 18:52:31 +01:00
Pavel Sanda
b4ed627ecc Fogotten case for replacing $$python.
Patch from Jose.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg219385.html
2023-02-24 19:44:37 +01:00
Juergen Spitzmueller
c5e4043fa3 Warn user when OUTLINE_IN/OUT is about to flatten the structure (#11178) 2023-02-22 17:31:32 +01:00
Scott Kostyshak
83af3dfd29 Fix equation numbers after row operation (#12665)
After removing/adding rows, the corresponding equation numbers in
the LyX display were not updated (although if you clicked outside
the math inset they were).

Now they are updated immediately after the operation.
2023-02-22 11:12:56 -05:00
Juergen Spitzmueller
8fd1aaa46e Fix another old outliner bug (#9375)
Parts, chapters and sections have different LabelTypes, but this does
not mean they cannot be transformed into each other while doing
OUTLINE_IN/OUT

Not sure why the labeltype check is here anyway, but let's keep it.
2023-02-22 16:33:37 +01:00
Juergen Spitzmueller
41d95a45d9 Properly reset tree depth in outliner with keep when outliner is re-filled
Fixes a 13 year old bug (#6675)
2023-02-22 15:24:15 +01:00
Juergen Spitzmueller
08fc56486e Whitespace 2023-02-22 14:53:25 +01:00
Juergen Spitzmueller
ceb03b1815 Amend 4cd568d312 2023-02-22 14:35:53 +01:00
Juergen Spitzmueller
4cd568d312 Do not change outliner tree depth when not appropriate
This fixes expansion/collapsing on double-click (#12672)
2023-02-22 14:23:04 +01:00
Jean-Marc Lasgouttes
b4211ef206 Fix completion in math when inline completion was not yet shown
It is necessary to set finish=true when the completion is unique.
Otherwise, one gets \upsilon instead of the proper glyph.

Fixes bug #12674.
2023-02-22 12:02:10 +01:00
Jean-Marc Lasgouttes
ab8ea2543d Revert "Fixup 0cbe0d7a: avoid double redraw when completion is finished"
This is my 635th lesson that trying to be too clever is not that good.
This change interferes with the yet-to-come fix to #12674.

This reverts commit cc6dae1363.
2023-02-22 12:00:14 +01:00
Jean-Marc Lasgouttes
cc6dae1363 Fixup 0cbe0d7a: avoid double redraw when completion is finished 2023-02-22 11:32:11 +01:00
Jean-Marc Lasgouttes
0cbe0d7a3e Make sure that screen is updated when completing math
There was a missing update there.

Fixes part of bug #12674.
2023-02-22 11:23:10 +01:00
Juergen Spitzmueller
1e99920b35 Disable zoom in/out buttons when threshold is reached (#12676) 2023-02-22 11:16:46 +01:00
Jean-Marc Lasgouttes
e181474e6c Fixup 04ece4f0: handle case where openinlined_ is not set
When computing the width of the button, some code has been added in
04ece4f0 to shorten the space in LeftButton geometry. It turns out
that the Left/Top-button-ness is not always known at this point (since
it depends on the width itself!).

Therefore, it is better to make the button narrower also in the
TopButton case.
2023-02-22 10:58:22 +01:00
Jean-Marc Lasgouttes
a3d58d2884 Fixup 04ece4f0d6: fix cursor position 2023-02-22 10:32:24 +01:00
Pavel Sanda
39fddce26e comment typo & one line 2023-02-21 11:29:40 +01:00
Juergen Spitzmueller
eb294eadb5 Strip et al. for citation search 2023-02-21 08:12:59 +01:00
Jean-Marc Lasgouttes
92178fe457 Add commented-out code that might prove useful one day
The code in the dead branch looks reasonable to me, but I was not able
to prove that it solves a problem (yet).
2023-02-20 14:53:07 +01:00
Pavel Sanda
3a72e2c76b lyxpaperview - fix viewer calls with additional arguments 2023-02-19 22:35:21 +01:00
Pavel Sanda
be0341edd3 typo 2023-02-19 21:41:40 +01:00
Pavel Sanda
5b69f6899f Another case of statusTip 2023-02-19 19:22:48 +01:00
Pavel Sanda
c629d11c43 citationSearchCB statusTip -> toolTip 2023-02-19 19:15:25 +01:00
Juergen Spitzmueller
8deb05f7a7 Mark empty bib(la)tex insets (i.e., with no databases defined) (#12668) 2023-02-19 12:15:45 +01:00
Juergen Spitzmueller
da1d6d03eb Amend 2987530434
This is more readable (and fixes a thinko)
2023-02-18 17:04:43 +01:00
Juergen Spitzmueller
2987530434 Address an edge case where we need to loaf fontspec also with babel 2023-02-18 16:12:49 +01:00
Juergen Spitzmueller
29a8097c3c Make string-widget combination more l7n friendly
This allows to adjust the minutes widget within the syntax of the language
2023-02-16 15:25:33 +01:00
Juergen Spitzmueller
536bcb0d7b Amend ef2ca233d6 2023-02-16 14:55:55 +01:00
Juergen Spitzmueller
ef2ca233d6 Differentiate backups from autosave files (#12659) 2023-02-16 14:42:44 +01:00
Pavel Sanda
76daf33dd5 * Adv FindAndReplace - add spacer to visually distinguish groupbox. 2023-02-15 21:25:22 +01:00
Pavel Sanda
065f125b61 Disentangle tooltip in Character dialog and FindAndReplace pane. 2023-02-15 21:18:11 +01:00
Pavel Sanda
dce4ff82b4 * ui: Latex -> LaTeX 2023-02-15 21:16:39 +01:00
Juergen Spitzmueller
c1168f35d7 tiny correction 2023-02-15 11:46:37 +01:00
Juergen Spitzmueller
bfab8f9435 Escape single quotes in bformat string 2023-02-15 11:45:16 +01:00
Juergen Spitzmueller
879aa03a3e Add some tooltips wrt document backup 2023-02-15 11:22:19 +01:00
Juergen Spitzmueller
03ced49d9f whitespace 2023-02-12 14:37:35 +01:00
Juergen Spitzmueller
ced6c591fb Silence warning when unappropriate 2023-02-12 14:33:27 +01:00
Juergen Spitzmueller
a218450aa4 tex2lyx: support documentclass in path (#12284) 2023-02-11 09:57:32 +01:00
Juergen Spitzmueller
8c6db95135 Add missing empty line (par break) between pars with differing line spacing (#12638) 2023-02-09 17:23:18 +01:00
Jean-Marc Lasgouttes
2a626f76fd Revert "Fix crash with info inset and dialogs"
This reverts commit 17e60e2e85.
2023-02-08 12:53:39 +01:00
Jean-Marc Lasgouttes
f0b60d0b4e fix comment. 2023-02-08 12:28:01 +01:00
Juergen Spitzmueller
713264ae2b Disable "search in selection only" with instant search
These two do not go well together. Making it work requires some major
overhaul of selection while searching (see #12655)
2023-02-07 14:48:09 +01:00
Jean-Marc Lasgouttes
17e60e2e85 Fix crash with info inset and dialogs
See the thread
  2.4 Crash (was: Updated LaTeXConfig.lyx (bxjsclasses added))
on lyx-devel (26/01/2023).

The backtrace imply a problem like:
1/ metrics are computed for some info inset
2/ the info inset is regenerated (and thus the paragraph it held is now invalid)
3/ We draw the inset and because of the new (disabled by default)
   bookmark display code, we access the id() of the invalid paragraph.
4/ boom!

To fix the issue, introduce a new boolean member that indicates when
the Row object of the metrics should not be used. In this case, the
draw() method returns early.
2023-02-06 21:34:08 +01:00
Jean-Marc Lasgouttes
04ece4f0d6 Remove space between button and text with inlines collapsible insets
Typically there are two sources of spacing:
* the button has two pixels added to the left and to the right
* the frame around the text also has 2 pixels to the left and to the right

Note that this value of two pixels is given here for simplicity, but
these are parameterized by methods like textOffset or leftOffset.

What we want to remove is the space after the button and the space
before the frame. This is done in 3 places

In dimensionCollapsed(), the extra space is removed from the dimension
after its computation

In metrics(), the space avoided before the frame is removed from width.

In draw, the whome text inset is drawn with a negative offset.

Fixes #12335.
2023-02-06 20:28:37 +01:00
Juergen Spitzmueller
fb37682d74 Check whether we have a selection before issuing warning (#12655) 2023-02-06 11:47:14 +01:00
Juergen Spitzmueller
97a5433bed Update tex2lyx tests 2023-02-04 17:48:57 +01:00
Juergen Spitzmueller
ac6314b834 Properly fix acknowledgment issue part 1/2
Bump file format and convert/revert styles to unique spelling
2023-02-04 17:47:52 +01:00
Jean-Marc Lasgouttes
418fd911f8 Revert "Extended comment and indentation for source code"
This was pushed by mistake. A different version of this patch will
eventually be committed.

This reverts commit 439c099124.
2023-02-01 00:12:14 +01:00
Jean-Marc Lasgouttes
1081893e97 Fixup 0fed10e4: make sure redraw happens as needed
This commit had had an additional not documented change: redraws
happen only when they are needed. This did not help fix the bug, but
looked smart on first sight. Alas, I find that these smart changes
added because "why not?" tend to come back to haunt me eventually.

In particular this case, the problem was that the code tested whether
the offset of anchor paragraph had changed, but not whether the
paragraph itself had changed. This means that, when switching from one
section to another with the outliner, the view was not updated.
2023-02-01 00:09:49 +01:00
Daniel Ramoeller
439c099124 Extended comment and indentation for source code
- automatically inherit indentation from previous block
- (un)indent blocks
- (un)comment blocks
- add feature to show tabs and spaces
2023-02-01 00:09:49 +01:00
Juergen Spitzmueller
2371bfdf15 Fix font combos with Qt6 (#12630)
Use CategorizedCombos methods to properly access the model
2023-01-30 08:46:36 +01:00
Juergen Spitzmueller
b260ff8b27 Allow to hide categories in CategorizedCombo
font combos do not need that
2023-01-30 08:45:58 +01:00
Enrico Forestieri
d213df2f2e Amend 891ba726
Avoid an assertion when the cursor is at the start of a math hull.
2023-01-29 18:32:23 +01:00
Enrico Forestieri
07150cd928 Amend 16e67d4e
A docstring is not 0-terminated...
2023-01-27 21:10:02 +01:00
Enrico Forestieri
16e67d4ebb Fix bug #12633
Avoid recursion when validating a macro that is defined recursively.
This avoids a crash but the latex engine will choke on it, of course.
2023-01-27 20:34:24 +01:00
Scott Kostyshak
2ccaefa8a1 Fix -Winconsistent-missing-override
Fix the following warning:

src/frontends/qt/GuiDocument.h:377:7: error: 'eventFilter' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
        bool eventFilter(QObject * sender, QEvent * event);
             ^
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:139:18: note: overridden virtual function is here
    virtual bool eventFilter(QObject *watched, QEvent *event);
                 ^

Amends 62413580de.
2023-01-25 10:56:40 -05:00
Daniel Ramöller
62413580de Fix bug #12061. 2023-01-23 18:05:26 -05:00
Thibaut Cuvelier
fca8e54289 InsetMathHull: add a missing const (plus strange indentation fixed). 2023-01-22 02:45:25 +01:00
Thibaut Cuvelier
d066a66a51 MathML: make InsetMathHull::mathmlize easier to read while doing less work
If `havetable == true`, a lot of the code didn't make any sense: in particular, it was outputting a level of <m:mrow> too many.

Also, add some comments and rewrite the comment about mlabeledtr.

Contributed by lynx: https://www.lyx.org/trac/ticket/12629
2023-01-22 01:49:03 +01:00
Thibaut Cuvelier
e7d57338b9 InsetMathHull: replace 0 by nullptr. 2023-01-22 01:25:03 +01:00
Thibaut Cuvelier
bf0da33c9a MathML: use standard {M/E}Tag{,Inline} instead of bespoke constructs
Also, replace lspace='thinmathspace' by constructs that are not deprecated.

Contributed by lynx: https://www.lyx.org/trac/ticket/12629
2023-01-20 02:56:55 +01:00
Thibaut Cuvelier
598c6a0a87 MathML in HTML: in case of conversion failure, add a comment 2023-01-20 02:45:35 +01:00
Thibaut Cuvelier
f9fd652aae MathML: improve formatting of formula in XHTML hull
Contributed by lynx: https://www.lyx.org/trac/ticket/12629
2023-01-20 02:45:35 +01:00
Thibaut Cuvelier
0c227d3dfa MathML: remove extraneous <mrow> in fractions
Contributed by lynx: https://www.lyx.org/trac/ticket/12629
2023-01-20 02:30:43 +01:00
Thibaut Cuvelier
66fab70388 MathML: replace HTML entities with XML ones in more places
This part should have been committed with bc73a857 in the first place.
2023-01-20 02:25:37 +01:00
Thibaut Cuvelier
5f7c26fbe5 MathML: remove useless code
Contributed by lynx: https://www.lyx.org/trac/ticket/12629
2023-01-20 02:19:33 +01:00
Juergen Spitzmueller
d213b72978 Introduce pkglist format
This allows us to check and reconfigure if the pkglist format is not
current
2023-01-14 10:45:57 +01:00
Thibaut Cuvelier
861af2b84f LyXHTML: remove meta content-type, it is only for HTML5, not XHTML5 (LyX is generating XML-compatible HTML, i.e. XHTML5). 2023-01-11 01:12:22 +01:00
Thibaut Cuvelier
fb70f89983 InsetTabular LyXHTML: fix wrong escape. 2023-01-11 00:26:28 +01:00
Jean-Marc Lasgouttes
8ec3397da3 Correct the description of Lexer::getLongString
The fact that it does not work with tabs has been fixed long ago.
2023-01-10 16:25:48 +01:00
Jean-Marc Lasgouttes
6093e7d661 Fix warning
This was:
../../master/src/mathed/InsetMathBox.cpp:116:20: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::__cxx11::basic_string<wchar_t> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
  116 |  for (int i = 0; i < parts.size(); i += 2) {
      |                  ~~^~~~~~~~~~~~~~
../../master/src/mathed/InsetMathBox.cpp:120:20: warning: comparison of integer expressions of different signedness: ‘std::vector<std::__cxx11::basic_string<wchar_t> >::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
2023-01-09 16:06:38 +01:00
Daniel Ramoeller
f608328059 Allow multiple selections in the file open dialog
Fix for bug #4315.
2023-01-09 15:52:33 +01:00
Juergen Spitzmueller
689962b8d5 Fix grammar in, and try to clarify, warning
I suppose many users won't know what a "python interpreter" is and how
they could install one.
2023-01-09 07:28:49 +01:00
Thibaut Cuvelier
9ae793c607 LyXHTML: avoid using v/align HTML attributes in tables, they are deprecated (like most attributes for td).
Also implement alignment at character in CSS.
2023-01-09 04:04:57 +01:00
Thibaut Cuvelier
1f370a3353 LyXHTML: avoid using v/align HTML attributes in tables, they are deprecated (like most attributes for td).
Also implement alignment at character in CSS.
2023-01-09 01:50:05 +01:00
Thibaut Cuvelier
1b09bc965d InsetMathBox: remove debugging code. 2023-01-09 01:11:52 +01:00
Thibaut Cuvelier
24cda9e94a Amend 2d56c01dcf 2023-01-08 22:51:01 +01:00
Thibaut Cuvelier
2d56c01dcf InsetIndex: make a condition more bullet-proof, a nullptr could be dereferenced.
Error noticed by Coverity:

*** CID 382777:  Memory - illegal accesses  (RETURN_LOCAL)
/home/lasgoutt/src/lyx/coverity/lyx/src/insets/InsetIndex.cpp: 1866 in _ZNK3lyx15InsetPrintIndex5xhtmlB5cxx11ERNS_9XMLStreamERKNS_12OutputParamsE()
1860
1861            // Collect the index entries in a form we can use them.
1862            vector<IndexEntry> entries;
1863            const docstring & indexType = params().getParamOr("type", from_ascii("idx"));
1864            for (const TocItem& item : *toc) {
1865                    const auto* inset = static_cast<const InsetIndex*>(&(item.dit().inset()));
>>>     CID 382777:  Memory - illegal accesses  (RETURN_LOCAL)
>>>     Using "indexType", which points to an out-of-scope temporary variable of type "lyx::docstring const".
1866                    if (item.isOutput() && inset->params().index == indexType)
1867                            entries.emplace_back(IndexEntry{inset, &op});
1868            }
1869
1870            // If all the index entries are in notes or not displayed, get out sooner.
1871            if (entries.empty())
2023-01-08 22:19:39 +01:00
Thibaut Cuvelier
b42269f065 InsetIndex: remove unused code that created Coverity errors. 2023-01-08 22:17:02 +01:00
Thibaut Cuvelier
6e4cf808da InsetIndex: add a missing destructor for IndexNode and call it from xhtml() to avoid leaking resources.
Corresponding Coverity finding:

** CID 382778:  Resource leaks  (RESOURCE_LEAK)
/home/lasgoutt/src/lyx/coverity/lyx/src/insets/InsetIndex.cpp: 1909 in _ZNK3lyx15InsetPrintIndex5xhtmlB5cxx11ERNS_9XMLStreamERKNS_12OutputParamsE()

________________________________________________________________________________________________________
*** CID 382778:  Resource leaks  (RESOURCE_LEAK)
/home/lasgoutt/src/lyx/coverity/lyx/src/insets/InsetIndex.cpp: 1909 in _ZNK3lyx15InsetPrintIndex5xhtmlB5cxx11ERNS_9XMLStreamERKNS_12OutputParamsE()
1903            }
1904
1905            xs << xml::EndTag("ul");
1906            xs << xml::CR();
1907            xs << xml::EndTag("div");
1908
>>>     CID 382778:  Resource leaks  (RESOURCE_LEAK)
>>>     Variable "index_root" going out of scope leaks the storage it points to.
1909            return ods.str();
1910     }
1911
2023-01-08 22:03:36 +01:00
Thibaut Cuvelier
e70cdfd3a2 InsetMathBox: split the boxed text into <mtext> and other tags, while boxing the whole inset within an <mrow>.
Rationales:
- previously, <mstyle> was used, but it's being deprecated for MathML 4 Core in favour of CSS and <mrow> (not a big deal in itself)
- the whole box cannot be hosted within the same tag, because neither <mstyle> nor <mrow> can have text, they need an intermediate container, <mtext> (which cannot hold anything else that pure text)
- new behaviour: always output a container for the whole box that has the right attributes, i.e. an <mrow>; split the content of the cell to have text and other tags set apart (text in <mtext>, other tags left as they were)

Old behaviour, invalid MathML (2 to 4):
<mstyle XXX>text<mn>.</mn></mstyle>

New behaviour, valid MathML:
<mrow XXX><mtext>text</mtext><mn>.</mn></mrow>
2023-01-08 02:36:48 +01:00
Thibaut Cuvelier
d3c81eb2cb InsetMathBox: fix strange indentation (mix of spaces and tabs). 2023-01-08 00:51:43 +01:00
Thibaut Cuvelier
edcaad2419 MathML: convert InsetMathBox as <m:mtext>.
The inset represents text (as opposed to maths in formulae). <m:mstyle> is used to give style to its children, it is not supposed to have any contents on its own.
2023-01-08 00:50:29 +01:00
Thibaut Cuvelier
6a3bd64032 LyXHTML: use a lower-case meta for generator, this is the most common convention. 2023-01-07 16:24:57 +01:00
Thibaut Cuvelier
a5c6215ebd LyXHTML: add a missing space in the content-type annotation. 2023-01-07 16:23:56 +01:00
Thibaut Cuvelier
fb4a26577e LyXHTML: don't explicitly mention that the style is CSS, HTML5 doesn't like it. 2023-01-07 03:42:11 +01:00
Thibaut Cuvelier
fd2078f3aa LyXHTML: remove the double specification of charset.
The choice of content-type is arbitrary.
2023-01-07 03:36:57 +01:00
Thibaut Cuvelier
cabb12ba51 LyXHTML: fix the content-type attribute, it must be lower case (enforced for HTML5). 2023-01-07 03:33:48 +01:00
Thibaut Cuvelier
26e6b1c209 LyXHTML and DocBook: encode language codes as BCP47. 2023-01-07 03:31:40 +01:00
Thibaut Cuvelier
3cf8ced72e Make formatting of DocBook changes more similar to surrounding code.
Spaces between if and condition.
2023-01-07 02:56:40 +01:00
Jean-Marc Lasgouttes
9dd716da3a Row breaking: keep unused tail for later (instead of assertion)
Instead of asserting when there are unprocessed row elements (which,
as I understand it, should almost never happen), play safe and keep
them for later processing.

Related to bug #12617.
2023-01-06 16:02:29 +01:00
Jean-Marc Lasgouttes
cb3de88cc4 Fixup dcef1a9c: better handling of front-of-string splitting
When splitting a string leads to a break before the first character, the
best is to declare that splitting failed.

Fixes bug #12617.
2023-01-06 15:56:54 +01:00
Scott Kostyshak
bee08b19ee Typo in a comment 2023-01-05 23:33:16 -05:00
Stephan Witt
bbc2270972 #12523 check for existence of usable Python interpreter
- present appropriate alert message in case of missing Python
- add the option to quit LyX immediately
- recheck for Python interpreter on reconfigure if it was missing
2023-01-06 00:32:09 +01:00
Jean-Marc Lasgouttes
7c5bad56c4 Add information to Row::operator<< 2023-01-05 11:56:56 +01:00
Richard Kimberly Heck
30189332c8 Fix minor bug mentioned in #10827 2023-01-04 23:23:30 -05:00
Richard Kimberly Heck
04025d0259 Fix compilation problem 2023-01-04 23:04:02 -05:00
Scott Kostyshak
09e25ca5b7 Fix compiler warning -Wstring-plus-int
Similar to d44eaa97.
2022-12-29 16:25:42 -05:00
Juergen Spitzmueller
38c118b02d Fix output of tex2lyx messages in runtests.py 2022-12-29 15:10:05 +01:00
Juergen Spitzmueller
a5115d4e4a tex2lyx: Also factor out error and debug messages 2022-12-29 09:37:00 +01:00
Scott Kostyshak
d44eaa9713 Fix compiler warning -Wstring-plus-int
Warning was as follows:

  src/tex2lyx/Parser.cpp:898:39: error: adding 'uint32_t' (aka 'unsigned int') to a string does not append to the string [-Werror,-Wstring-plus-int]
                  warning_message("ignoring a char: " + static_cast<uint32_t>(c));
                                  ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
  src/tex2lyx/Parser.cpp:898:39: note: use array indexing to silence this warning
                  warning_message("ignoring a char: " + static_cast<uint32_t>(c));
                                                      ^
                                  &                   [                         ]
  1 error generated.
2022-12-28 21:58:30 -05:00
Juergen Spitzmueller
9ecc30174a Factor out tex2lyx warnings and add -q option (#11328) 2022-12-28 16:29:38 +01:00
Juergen Spitzmueller
9047d60c5a tex2lyx: exit earlier if input file could not be found
In particular, do not write an empty .lyx file (#12339)
2022-12-28 14:05:23 +01:00
Juergen Spitzmueller
992e3aec88 Support suffix-less tex file input in tex2lyx (#12340) 2022-12-28 13:35:12 +01:00
Thibaut Cuvelier
7a67302c01 Amend febd1855eb: fix compilability 2022-12-28 12:57:45 +01:00
Juergen Spitzmueller
abe7adc8af Update tex2lyx tests again 2022-12-28 12:32:39 +01:00
Juergen Spitzmueller
b3a1caa9b9 Update tex2lyx tests after 7868929aac 2022-12-28 12:32:39 +01:00
Juergen Spitzmueller
32b5d253d1 tex2lyx: consider utf8 default encoding in newer LaTeX 2022-12-28 12:32:39 +01:00
Juergen Spitzmueller
2dafc6af0d Fix indentation 2022-12-28 10:58:36 +01:00
Juergen Spitzmueller
7868929aac tex2lyx: put adjacent comment lines in one ERT inset (#4797) 2022-12-28 09:40:22 +01:00
Thibaut Cuvelier
8b5bfa971b Amend febd1855eb: fix compilability of tex2lyx 2022-12-28 02:33:11 +01:00
Thibaut Cuvelier
4aeba17895 Fix a typo in a comment 2022-12-28 02:32:05 +01:00
Thibaut Cuvelier
febd1855eb XML: overhaul the tag-comparison operators.
First and foremost, this patch implements the latest best practices in C++ (i.e. comparison operators are not member functions).

The main objective of this rewrite is to have these operators callable in slightly more general contexts (*this->asFontTag() == *rhs.asFontTag() yielded an error because no member function could be called). This feature is no more required.

The rewrite took place in the context of https://www.lyx.org/trac/ticket/12585. The first iteration was using more complex code to circumvent XMLStream in DocBook (see details in the bug above and in the mailing list), while this one uses XMLStream fully. The bug was due to font tags being considered equal when they were not, due to the comparison done only on the XML tag and not on the actual font change (XML attributes can complement the tag for various font changes).
2022-12-27 16:52:51 +01:00
Thibaut Cuvelier
16a1aa9901 DocBook: add support for DocBookGenerateTitle.
The new parameter allows more flexibility when encoding some elements that have a poor mapping in DocBook, like theorems. The major use is to wrap the environment in a generic container, figure, which requires a title (but none is available).
2022-12-27 15:52:26 +01:00
Juergen Spitzmueller
69d54ff9d8 Master/Child: do not clean includeonly list while editing (part of #12470) 2022-12-27 15:36:36 +01:00
Juergen Spitzmueller
4c8a698a28 MasterChild.ui: Group radio buttons (part of #12470) 2022-12-27 15:10:37 +01:00
Thibaut Cuvelier
ed7072985e DocBook: for computing font changes, simplify code by removing state evolution from iteration to iteration. This surely makes the code slightly slower (although the compiler should be smart enough), but (much) easier to reason about. 2022-12-27 01:58:48 +01:00
Thibaut Cuvelier
2b03f0a2c1 DocBook: add some TODOs for the future. 2022-12-27 00:03:07 +01:00
Thibaut Cuvelier
e3eddd4cf9 Add comments about variable usage. 2022-12-26 20:57:44 +01:00
Thibaut Cuvelier
8b6ec979ff Fix a typo in a comment. 2022-12-26 20:57:24 +01:00
Thibaut Cuvelier
b2fdc04f96 InsetIPAMacro: implement the XHTML conversion, refactor plaintext and DocBook to share more code. 2022-12-26 20:54:36 +01:00
Thibaut Cuvelier
3839897c0f InsetMathExFunc: use XML entities instead of HTML in MathML.
This part should have been committed with bc73a857 in the first place.
2022-12-26 20:38:06 +01:00
Thibaut Cuvelier
9b80a5ba9e InsetMathSpace: use XML entities instead of HTML in MathML.
This part should have been committed with bc73a857 in the first place.
2022-12-26 20:35:26 +01:00
Thibaut Cuvelier
df025d15df InsetIPAMacro: refactor code between DocBook and XHTML. 2022-12-26 20:23:05 +01:00
Thibaut Cuvelier
21d1d917ba DocBook/HTML: use XML entities for spaces.
This part should have been committed with bc73a857 in the first place.
2022-12-26 19:11:41 +01:00
Juergen Spitzmueller
0c56f60535 Associate "run:" link types with "Other" 2022-12-26 13:19:52 +01:00
Juergen Spitzmueller
be25181d87 Disambiguate string 2022-12-26 11:24:29 +01:00
Juergen Spitzmueller
14d74c9578 Try to be more precise in the hyperlink type tooltips 2022-12-26 10:46:54 +01:00
Juergen Spitzmueller
d3b5905007 tex2lyx: support "Other" type 2022-12-26 10:40:39 +01:00
Juergen Spitzmueller
5f8e41dc9b GuiHyperlink: some minor fixes
* disambiguate "Other" label
* Add accelerator
* Add tooltip to "Other" widget
* Amend tooltip of "Web" widget (since "other" now seems to have taken
part of its function)
2022-12-26 10:13:51 +01:00
Thibaut Cuvelier
2592a36dae Amend bc73a85778
Missing return in `specialCharKindToXMLEntity`. Previously, the
functions that were merged into `specialCharKindToXMLEntity` did not
return any kind of error in case an unknown special character is met
(enumerated value). This behaviour is preserved.
2022-12-26 00:18:47 +01:00
Thibaut Cuvelier
ff2a2b2a8a DocBook: add a comment about the need for DocBook 5.2. 2022-12-25 20:48:26 +01:00
Thibaut Cuvelier
c77872f314 Cleanup following the removal of HTML entities
The remaining part that was not handled in the previous commit. It focuses on lib/symbols.
2022-12-25 20:48:14 +01:00
Thibaut Cuvelier
bc73a85778 LyXHTML: switch the doctype to (X)HTML5 and only output XML entities.
This is a new take on c8e2c17a that was reverted at da67bde61a due to entities no more recognised by the browsers. Corresponding thread on the mailing list: https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg213179.html

This patch is a huge cleanup overall, by removing the distinction between HTML and XML entities (the latter arrived due to the DocBook support).

In InsetListingParams, I also changed the mechanism that relied on &quot; to use an XML entity to be consistent with the rest of the code, mostly in case someone looks for HTML entities and wonders why they are still there.
2022-12-25 20:48:14 +01:00
Thibaut Cuvelier
d85969b8b8 LyXHTML: give the language in the root tag. 2022-12-25 20:48:14 +01:00
Richard Kimberly Heck
3d2bedb160 typo 2022-12-25 12:50:54 -05:00
Richard Kimberly Heck
1413b509ac Update tex2lyx tests. 2022-12-25 12:49:42 -05:00
Richard Kimberly Heck
144cf4bb9a Allow an 'other' type for hyperlinks. Format change.
Also, perform the URL fixing magic for DocBook and XHTML.

As it was, it was impossible to enter e.g. "tel:" type links. Now
choosing the "Other" type just outputs the URL as given.

Also, the addition of "http" or "file" was not being done for
DocBook and XHTML. Now it is.
2022-12-25 12:45:48 -05:00
Juergen Spitzmueller
1e28965589 Do not wrap forceTLR in \L with babel and unicode engines
It does not seem to be needed, the \L macro is undefined, and there
does not seem to be an alternative.
2022-12-24 09:20:02 +01:00
Juergen Spitzmueller
064955b151 Used pressed() signal in status bar widgets (fixes #12613) 2022-12-24 07:20:39 +01:00
Juergen Spitzmueller
f06ddb2342 Fix signals 2022-12-23 16:07:47 +01:00
Juergen Spitzmueller
0bb25ee3cd \R and \L are not defined in babel with Xe/LuaTeX 2022-12-23 10:07:41 +01:00
Juergen Spitzmueller
d90484de0a Fix UI of document color selection
The coloring of push buttons does not work with all themes, so use a
dedicated widget.

Also, accelerators have been used multiple times.
2022-12-23 09:17:01 +01:00
Juergen Spitzmueller
7015d7db07 Mark "edit externally" button of preamble and local layout
while external editing is underway
2022-12-23 08:19:26 +01:00
Juergen Spitzmueller
d888d0d130 Inform user if panel or tab has invalid content (#10827)
This adds a warning icon to either the tab header or the panel stack
entry item if a widget on the panel/stack has invalid content.

Particularly helpful to get aware of such content on other tabs/panes
than the one currently selected.
2022-12-22 15:01:58 +01:00
Thibaut Cuvelier
4f314567b6 XML: improve formatting of error message for unrecognised tag type.
Before, there was always a space after the tag, even when there were no attributes. Now, the space is output conditionally, so that the output makes more sense.

Before, one space too many for the tag name (title), casting doubt on whether the code had this space hard coded or not:

<!-- Output Error: Unrecognised tag type 'para' for 'title ' -->

After, no such space:

<!-- Output Error: Unrecognised tag type 'para' for 'title' -->
2022-12-22 04:10:25 +01:00
Thibaut Cuvelier
43d096f647 DocBook: fix a typo in comments and improve docs. 2022-12-22 03:40:50 +01:00
Jean-Marc Lasgouttes
22c6fe8e0c Remove boolean arguments of scrollToCursor wih an enum
This makes the function inent more obvious. No change intended.

Related to bug #12491.
2022-12-21 18:47:33 +01:00
Jean-Marc Lasgouttes
0fed10e4c3 Simplify and hopely fix scrollToCursor
Remove some special cases that I do not really understand and
streamline the cases.

Also make sure that there is only one code path for centering.

Fixes bug #12491.
2022-12-21 18:47:33 +01:00
Pavel Sanda
b9da7617d8 * lfun doc 2022-12-21 18:29:05 +01:00
Juergen Spitzmueller
226ce75054 Add test 2022-12-20 06:04:29 +01:00
Juergen Spitzmueller
889be483cf Simplify test
Math is useful for something, after all...
2022-12-20 05:50:23 +01:00
Juergen Spitzmueller
9966b4be4a Adapt inset info to new version check 2022-12-19 17:42:49 +01:00
Juergen Spitzmueller
2e6ea5f613 Extend flexible version check to packages 2022-12-19 17:42:27 +01:00