Commit Graph

28590 Commits

Author SHA1 Message Date
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 " 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
Juergen Spitzmueller
029adfa28c Improve LaTeX version checking
Instead of having to add and individually test the versions to check
for, we store the current version and test on that with a specific
function isAvailableAtLeastFrom(package, year, month, day)

Currently only used for the LaTeX version, but could also be extended
for package versions.
2022-12-19 15:15:41 +01:00
Juergen Spitzmueller
41146030b6 Simplify output code 2022-12-19 11:09:50 +01:00
Juergen Spitzmueller
0c6d0a86b9 Remove unnecessary conversion 2022-12-19 10:55:28 +01:00
Juergen Spitzmueller
c2a324e242 Amend 9716e79624
If the main language does not require the inputenc package, but a
secondary language does, inputenc needs to be loaded as well
(without options)

Also simplify the code a bit.
2022-12-19 08:00:06 +01:00
Juergen Spitzmueller
4a3871f5db Add toolbar option to reset font + language settings (#12199) 2022-12-18 16:36:30 +01:00
Juergen Spitzmueller
97c9404b71 language reset should reset to the buffer language
not reset_language, which links to default_language, which is always
English.
2022-12-18 16:35:07 +01:00
Juergen Spitzmueller
005dc32e54 Disable non-functional insets in math (#4039)
... finishing 15 year old work of mine :-(
2022-12-18 15:12:21 +01:00
Juergen Spitzmueller
17634087ea Correct date 2022-12-18 14:17:46 +01:00
Juergen Spitzmueller
3d63b78d07 Correct counting 2022-12-18 14:17:29 +01:00
Juergen Spitzmueller
9fc190d61c Improve functions for bibliography managers (#8193)
- new function to list bibtex databases
- citation-insert returns the list of undefined keys
  if the request comes from the LyX server

Original patch from Benjamin Piwowarski (2012!).
Modified and updated by Riki Heck and myself.
2022-12-18 13:25:24 +01:00
Juergen Spitzmueller
9716e79624 inputenc only expects one option
File switches with documents are done via \inputencoding.
Other than with fontenc, these do not need to be laoded via options
beforehand.

Also, out current code loaded the additional languages' encoding last,
which might result in wrong encoding settings.
2022-12-17 15:14:47 +01:00
Juergen Spitzmueller
23a2920dae Remove preceding spaces 2022-12-15 08:39:52 +01:00
Richard Kimberly Heck
fdabd46e8e Fix shortcut 2022-12-12 17:36:07 -05:00
Richard Kimberly Heck
88f0a98b52 Fix bug #12609 2022-12-12 17:33:56 -05:00
Richard Kimberly Heck
bbe2ee10a4 Pronoun 2022-12-12 17:18:35 -05:00
Jean-Marc Lasgouttes
02783aec66 Revert "Remove left/right spacing around top/left buttons"
Let's try to find a better solution (see ticket #12335)

This reverts commit d2f23c303c.
2022-12-11 20:48:44 +01:00
Enrico Forestieri
e18709b176 Further amend fb7b7e52
This restores the previous behavior of runCommand().
When the child process could not be properly terminated the
error "RunCommand: could not terminate child process" was being
issued. However, in fb7b7e52 there was a misinterpretation
between this condition and the exit status of the child and
these two different errors were mixed up. They are now
disentangled again.
2022-12-11 15:06:22 +01:00
Juergen Spitzmueller
163844a6d0 Allow defaultfamily change with non_TeX fonts (#12608) 2022-12-11 14:47:13 +01:00
Enrico Forestieri
d7910e1870 Amend fb7b7e52
pclose() returns -1 only in specific cases, otherwise it returns the
exit status of the child, to be retrieved by the macro WEXITSTATUS.
2022-12-11 12:15:37 +01:00
Juergen Spitzmueller
c7c3b39413 Minor checkedLineEdit fixes
* Do not disallow application if an invalid widget is disabled
* Fix coloring of text
2022-12-11 10:01:09 +01:00
Daniel Ramoeller
bfff93d879 Restrict toolbar menu to toolbar
Partial fix for bug #11949.
2022-12-10 20:30:58 +01:00
Jean-Marc Lasgouttes
46992201b7 Add != operator to FuncRequest and special value FuncRequest::prefix
Use this value (and `unknown' where relevant)
2022-12-10 20:30:58 +01:00
Scott Kostyshak
9f7bbeadda Change Doc Settings "Edit" PB to "Edit Externally"
"Edit" by itself is not clear if the user doesn't already know what
it does.

This affects both the local layout tab and the LaTeX preamble tab.

Brief ML discussion here:

  https://www.mail-archive.com/search?l=mid&q=20221202193312.myfnuhuz6xcil6qt%40gary
2022-12-10 10:02:48 -05:00
Juergen Spitzmueller
7f1cb306f9 Warn if buffer is switched with unapplied document changes (#9369) 2022-12-10 14:28:46 +01:00
Thibaut Cuvelier
0e2513a0e8 Amend d4095dc0
Apostrophes were being converted inside code-like areas, like LilyPond insets. This patch fixes tests that started to fail:

  Processing `./60/lily-95ee389a.ly'
  Parsing...
  ././60/lily-95ee389a.ly:7:12: error: undefined character or shorthand: &
  \relative c
             &#8217;&#8217; {  g a b c}
2022-12-09 20:17:58 +01:00
Thibaut Cuvelier
5b7fbb4190 XHTML: support NONE as item tag when no item tag should be output.
This patch mimics a similar feature for DocBook (albeit not as pervasive).
2022-12-09 02:48:52 +01:00
Thibaut Cuvelier
6c22e32cee MathML: update code for InsetMathCases to newest classes.
Based on a commit from lynx <lorenzobertini97@gmail.com>

Part of bug #12590.
2022-12-09 01:49:19 +01:00
Thibaut Cuvelier
5893ea866e MathML: output substacks as grids.
Based on a commit from lynx <lorenzobertini97@gmail.com>

Part of bug #12590.
2022-12-09 01:48:14 +01:00
Thibaut Cuvelier
d4095dc0e6 Export ' (straight) as ’ (curly) in DocBook
This is similar to what LaTeX does in its output.

See the (long) discussion in ticket #11244. Port of ad3e6c69b2 for DocBook.

This patch requires delaying entire strings instead of just characters, so that the DocBook code path can be as similar to the XHTML one as possible.
2022-12-09 01:25:34 +01:00
Stephan Witt
deae5ea23a Follow-up for change a66ee4109e - guard Qt 5.4 code with version check 2022-12-08 18:05:37 +01:00
Stephan Witt
a66ee4109e Add OS version info to About box. 2022-12-07 00:08:11 +01:00
Jean-Marc Lasgouttes
f3f478c2fb C++11 compilation fix 2022-12-06 17:12:45 +01:00
Richard Kimberly Heck
c50f0b125d Add HTMLClass for InsetLayout as well. Layout format change. 2022-12-05 23:42:50 -05:00
Juergen Spitzmueller
a759fb7ae9 Update tex2lyx tests again 2022-12-05 18:01:31 +01:00
Juergen Spitzmueller
4d337e78ab Fix crash when inserting label before label in change tracking mode 2022-12-05 11:15:58 +01:00
Juergen Spitzmueller
6c904004b6 More refs sorting fixes
This now uses a Vector of pairs, which is more robust with non-unique
labels (e.g. in change tracking).
2022-12-05 09:45:40 +01:00
Juergen Spitzmueller
c715db4ae8 Amend 14b108fc22 2022-12-05 08:20:25 +01:00
Juergen Spitzmueller
dedcee9117 tex2lyx support for starred refs 2022-12-05 07:52:41 +01:00
Richard Kimberly Heck
e0e84eba01 Update tex2lyx tests 2022-12-05 01:09:05 -05:00
Juergen Spitzmueller
7a0c8f366d Typo spotted by Pavel 2022-12-05 06:47:52 +01:00
Richard Kimberly Heck
d4f2460ac4 Fix bug #11410.
Main part of patch from Daniel, adapted by me.
I also added the lyx2lyx code.
2022-12-04 18:33:58 -05:00
Jean-Marc Lasgouttes
ff1ddf6251 Fixup 71623b88: change semantics of "delete" LFUNs again
Instead of specifying "force" to disable the deletion protection
mechanism, invert the default so that "confirm" is needed to activate
it. The idea is to keep the lfun reasonable for scripting and add a
special argument for interactive use.

Document in release notes.

Update LFUN.lyx documentation

Update bind files.

Add conversion step to prefs2prefs_lfun.py.
2022-12-04 21:13:51 +01:00
Richard Kimberly Heck
7b5a5e524b Fix CSS output for lists.
Somehow that got committed before it was done. I guess I'm out of
practice...
2022-12-04 14:56:01 -05:00
Richard Kimberly Heck
5ac560cfa1 Add i, ii, iii, iv suffixes to CSS class as well in the case of itemizations 2022-12-04 14:34:29 -05:00
Richard Kimberly Heck
69a6c41b94 Introduce HTMLClass tag, to make it easier to give these. 2022-12-04 13:36:34 -05:00
Richard Kimberly Heck
6f4f7442ef Fix bug #11769 2022-12-04 12:51:47 -05:00
Richard Kimberly Heck
dfa87371f7 Use ranges 2022-12-04 12:06:48 -05:00
Richard Kimberly Heck
b37ac5807f Do not output label tags if there is no label 2022-12-04 12:01:42 -05:00
Richard Kimberly Heck
b9c52f20c7 Whitespace 2022-12-04 11:59:54 -05:00
Juergen Spitzmueller
3ec87be050 Fixup refs sorting
This has been broken at df59649a18
2022-12-04 16:21:14 +01:00
Juergen Spitzmueller
abd69b06f4 Fixup refs grouping
This has been broken at df59649a18
2022-12-04 15:32:47 +01:00
Daniel Ramoeller
7bdf372ecc Properly reset on ESC key on LayoutBox/CategorizedCombo
Fix for bug #12497.
2022-12-04 13:45:49 +01:00
Juergen Spitzmueller
891ba7263e Workaround for #11676
Avoid the crash we get with this combination. Having identified the real
cause would of course have been better. But it seems no one has a clue.
2022-12-04 11:09:00 +01:00
Richard Kimberly Heck
3eb3608138 Fix bug #11418.
Add new HTMLInToc layout tag: When false, the thing will not be output
to the TOC. It's now set to false for starred sections.
2022-12-04 00:33:14 -05:00
Richard Kimberly Heck
eb949f1d05 Use ranges 2022-12-04 00:02:51 -05:00
Richard Kimberly Heck
9f258704ae Use a couple ranges 2022-12-03 23:33:44 -05:00
Richard Kimberly Heck
fc6643e4aa Fix bug #11853 2022-12-03 23:03:33 -05:00
Richard Kimberly Heck
233ce1ec12 Partially fix bug #10827. Patch from Daniel, slightly modified by me. 2022-12-03 22:44:05 -05:00