Commit Graph

1196 Commits

Author SHA1 Message Date
Alexander Dunlap
c609e9cbcf Display equation/theorem numbers in insert cross reference dialog.
Fixes bug #11466,
2023-07-26 13:35:42 -04: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
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
Pavel Sanda
6b7da5ec8c typo 2023-04-13 21:50:43 +02:00
Pavel Sanda
f664498ba7 typo 2023-04-13 21:36:17 +02:00
Juergen Spitzmueller
849d0c81ca Record babel use for single par preview 2023-04-02 14:51:47 +02:00
Pavel Sanda
9bbec4a75a Fix #12678. 2023-02-26 22:30:17 +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
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
ff2a2b2a8a DocBook: add a comment about the need for DocBook 5.2. 2022-12-25 20:48:26 +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
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
e26a60edef Regenerate previews after zoom (#11919) 2022-11-20 18:18:59 +01:00
Jean-Marc Lasgouttes
2c53f0315e Fix another use of unqualified std::move 2022-11-04 21:36:43 +01:00
Jean-Marc Lasgouttes
6c2d4f9392 constify 2022-10-28 18:03:50 +02:00
Enrico Forestieri
90551a03ac Amend f426470a
The synctex option can also be specified by a single dash and
any value different from zero will do.
2022-09-14 20:10:01 +02:00
Stephan Witt
f426470a54 Improved synctex support
- Add check for converter with active synctex support to check for synchronized output for activate forward search.
2022-08-13 14:20:03 +02:00
Jean-Marc Lasgouttes
96e7fcd4e0 When pasting as LaTeX, honor textclass and modules
There are several small parts that are needed here:

* Implement LayoutModuleList::asString() that returns a comma-separated
  list of modules.

* in Converter::convert(), handle the new tokens $$c for the current
  textclass and $$m for the list of modules.

* in Buffer::importFile(), pass the current buffer as parameter instead
  of nullptr.

* in pasteClipboardText(), copy the parameters of the current buffer to
  the internal one used for importation, so that the textclass and
  modules information is available to convert().

* finally, modify configure.py to pass "-c $$c -m $$m" to tex2lyx for
  the latexclipoard->lyx converter.

Fixes bug #11312.
2022-07-19 00:28:28 +02:00
Jean-Marc Lasgouttes
d15a96d93d updateBuffer needs an undo group
Otherwise warning messages appear when loading a file that contains
missing modules, for example (which may require to adjust depths in
document).
2022-03-08 16:16:50 +01:00
Juergen Spitzmueller
1c2628b5de Do not try to access user_defined_bullet with nesting > 3
We only have 4 nesting labels available.

In the workarea, display a fallback label with deeper nesting.
2022-03-06 17:27:28 +01:00
Juergen Spitzmueller
c02fe70797 Use a more transparent lexic for bullet label functions 2022-03-05 09:00:47 +01:00
Thibaut Cuvelier
997f0621c5 Rename LATEX debug level to OUTFILE and use it for DocBook, HTML, and XML messages. 2022-03-01 16:05:42 +01:00
Juergen Spitzmueller
6c530e1215 Still more indentation fixes. 2022-02-28 08:04:55 +01:00
Daniel Ramöller
df59649a18 Properly show labels from broken references in Cross-references dialog
Fix for bug #12456.

The labels are transmitted from Buffer to GuiRef by reference of refs_
in the getLabelList function. Previously, only one string was
transmitted. But I needed both the formatted string, e.g. "x enu:test"
or "Missing: enu:test", as well as the plain label, e.g. "enu:test".
The former is for the list of labels to choose from in GuiRef and the
latter for the label as shown in the line edit that contains the plain
label in order to create a new reference from it. Transmitting both is
what the pair achieves.
2022-02-19 18:14:47 +01:00
Daniel Ramoeller
122b452b20 Display manually set itemize symbols
Display manually set itemize symbols and their size in the work area.

Fix for bug #2277.

Also fixes a problem with document settings changed() not correctly emitted.
2022-02-06 17:58:50 +01:00
Pavel Sanda
33c68d7750 Revert 65b674ba4e.
We do not for what crash was this fix intended, but we know
that the fix introduced freeze in xhtml exports (e.g. merged manual).

https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg216835.html
2022-01-28 18:12:45 +01:00
Juergen Spitzmueller
e366dba9bf Factor out Buffer::requestSpellcheck() function 2021-11-25 17:04:17 +01:00
Thibaut Cuvelier
b5533a24f4 Typos and comment improvements. 2021-10-13 19:26:49 +02:00
Yuriy Skalko
d3c335a5d5 Remove useless casts reported by GCC with -Wuseless-cast option 2021-09-30 10:37:24 +03:00
Thibaut Cuvelier
de77854275 DocBook: fix MathML prefix in root tag.
Patch written by lynx: https://www.lyx.org/trac/ticket/12229
2021-05-24 23:55:11 +02:00
Jean-Marc Lasgouttes
c9146e5be0 Fixup f3a0e8ff: costly thinko
When the buffer stuff has been updated, the Buffer::needUpdate()
should be reset to false. This was forgotten in f3a0e8ff.

Fixes performance issues with MergedManuals, for example. UpdateBuffer
would be run again and again when selecting text.
2021-04-09 18:15:31 +02:00
Richard Kimberly Heck
eb2e8e1579 Polish 2021-04-03 17:58:46 -04:00
Pavel Sanda
9d1031771e Fix #4658: showing diff between original and emergency files.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg215796.html
2021-04-03 13:19:53 +02:00
Juergen Spitzmueller
07396ab244 Meet per-document spelling dictionaries (fixes #86 [sic!])
Now who can beat that? ;-)
2021-03-06 16:53:33 +01:00
Richard Kimberly Heck
946d112ee6 Allow to call cap::switchBetweenClasses without an ErrorList.
It turns out that we usually don't care about the errors and so
were creating dummy ErrorList objects in several places.
2021-02-25 21:49:50 -05:00
Jean-Marc Lasgouttes
65b674ba4e Fix a crash when closing tabs
Although I do not know how to reproduce the crash, the change makes sense.

This is backported from gadmm's lyx-unstable tree
261ce4ea98
2021-02-18 15:54:29 +01:00
Juergen Spitzmueller
be14b73787 Fix a null pointer dereference spotted by coverity 2021-01-30 13:46:47 +01:00
Juergen Spitzmueller
c83526c3ca Revert "No need to set background color of a newly created branch."
This breaks color initialization with new branches in dark mode.

This reverts commit 5145694cd0.
2021-01-30 09:16:15 +01:00
Jean-Marc Lasgouttes
5145694cd0 No need to set background color of a newly created branch.
Fixes a null pointer dereference spotted by coverity.
2021-01-29 18:29:55 +01:00
Jean-Marc Lasgouttes
911b01a3ca Fixup f3a0e8ff: Reset needUpdate after buffer update 2021-01-29 14:31:10 +01:00
Jean-Marc Lasgouttes
f3a0e8ff9a Run updateBuffer when adding/merging changes
Following 4a4ded22, the enabling of some change-related functions is
handled in updateBuffer. However, this method is not ran at every
document change for performance reasons.

This patch adds code to every place that modifies
Paragraph::Private::changes_ that checks whether the `changedness' of
the paragraph, err... changes.

To this end, a new helper struct is introduced that remembers
paragraph state at contruction time, and compares it to new state in
the destructor.

New forceUpdate/needUpdate methods are added to Buffer class, since
the cursor is in general not available in the places where these
changes are made.

Fixes bug #12074.
2021-01-28 11:30:05 +01:00
Juergen Spitzmueller
6775d7c3a2 Prevent more local colors from leaking (#6626) 2021-01-22 10:34:41 +01:00
Juergen Spitzmueller
514cd87970 Prevent branch background color from leaking out of the document
This is assured by a unique branchlist ID that is now part of the branch
color name
2021-01-21 08:09:41 +01:00
Juergen Spitzmueller
ee475b62fa Do not rely on hardcoded color when determining boxbgcolor 2021-01-20 14:15:48 +01:00