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
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]
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>
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.
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.
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.
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.
Removing. M-c e has a different meaning nowadays
(tabular-feature delete-vline-left)
Please file a new report with an updated description if this is still
an issue.
LyX removes a single backslash when it is inserted in a
macro name by the keyboard. However if it is followed by
another character before moving the cursor, it is retained
causing an assertion (bug #12601).
Disable the arguments append-column and delete-column of tabular-features.
The code is taken from InsetMathCases, with some changes
* no need to record undo here
* in dispatch, return is prefered to break, since we do not want to invoke
InsetMathGrid::doDispatch.
Propagate these changes to InsetMathCases.
Cleanup of the InsetMathCases error messages to fit with other parts
of the code.
The handling of tabular-features in mathed needs to be unified somehow.
Based on a commit from lynx <lorenzobertini97@gmail.com>
Part of bug #12590.
Backslashes are not allowed in macro names and LyX
enforces this by not allowing entering them by keyboard.
However, it was possible to paste them and this may cause
crashes (see bug #12596).
Being able to insert completion in a read-only document is definitely
a bad idea.
This patch acts both on indication of completion and on insertion
itself.
Fixes bug #12582.
I mathed, undo should record the underlying inset on completion,
whereas in test recording the paragraph is enough.
Therefore the recordUndo() in GuiCompleter::tab is removed, and the
relevant recordUndo/recordUndoInset are used at the right places.
As a further cleanup, the parameter `finished' of
Text::insertCompletion is removed as it is useless.
Fixes bug #12581.
This amends [4a7a1935/lyxgit]. Before 4a7a1935 it was assumed
that a labeled row was also numbered. Hence, when unnumbering
a row a label was also deleted. We now have to do this explicitly.
This code was triggering the following warnings:
src/mathed/InsetMathHull.cpp:234:15: error: variable 'counters_to_save' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
const char * counters_to_save[] = {"section", "chapter"};
^
src/mathed/InsetMathHull.cpp:235:21: error: unused variable 'numcnts' [-Werror,-Wunused-const-variable]
unsigned int const numcnts = sizeof(counters_to_save)/sizeof(char *);
The original code was put in at 645f9fdf (and the comment at 8a226ec4).
This commit amends a65e12d6.
Time will tell whether this is too expensive (because most equations
after this on will change too, unless equations are numbered by
section).
Related to bug #11535.
This patch simplifies and fixes the generation of previews with
numbering. Instead of saving the counter values (which is complicated
and error prone), the \thequation macro is set to the numbers_ string
which has been computed by updateBuffer for screen display.
Harcoding the number in the formula means that two equations with
different numbers have different previews, which is the subject of the
bug.
The special code for saving counters in updateBuffer and outputing
them in preparePreview from 645f9fdf (ticket #6894) is removed and
replaced by this simpler approach.
This fixes ticket #11535.