Commit Graph

45092 Commits

Author SHA1 Message Date
Thibaut Cuvelier
7a6024381c Update the format for some doc pages 2022-11-20 15:20:53 +01:00
Thibaut Cuvelier
48d9d01a82 InsetIndex: when building the IndexNode tree, ignore IndexEntry when empty
The previous code always considered it had at least one term (an assumption that is wrong at least for doc/de/Math.lyx).
2022-11-20 14:49:14 +01:00
Thibaut Cuvelier
77f0fbdc9a InsetIndex: enable escaping for terms in the index
The previous code explicitly disabled it and this behaviour caused problems (like "A&A" being output as-is, which is wrong in HTML: it should be "A&A").
2022-11-20 00:19:53 +01:00
Thibaut Cuvelier
e9f21f2e83 InsetIndex: improve formatting of resulting XHTML
There was no line feed before the closing </li> for entries, which was inconsistent with the other block tags.
2022-11-20 00:14:43 +01:00
Thibaut Cuvelier
2f1861380d Improve wording of RELEASE-NOTES entry 2022-11-19 23:33:43 +01:00
Kornel Benko
580dea638d Amend ac248e39, get rid of Qt4 code also in cmake build 2022-11-19 15:50:11 -05:00
Jean-Marc Lasgouttes
546efc3ff1 Remove a workaround that seems to be useless since Qt 4.8 2022-11-19 20:09:59 +01:00
Jean-Marc Lasgouttes
e11c7cb71d Remove all uses of Q_WS_* macros
They are only defined with Qt4.
2022-11-19 19:53:28 +01:00
Jean-Marc Lasgouttes
4310430a38 autoconf: remove support for compiling against Qt4
Most of the changes consist in assuming that USE_QT5=yes.

Update INSTALL and README accordingly.
2022-11-19 19:41:49 +01:00
Jean-Marc Lasgouttes
db70aec262 update release notes 2022-11-19 15:08:21 +01:00
Jean-Marc Lasgouttes
a3327f576c Get rid of setSectionResizeMode helper functions. 2022-11-19 15:04:38 +01:00
Jean-Marc Lasgouttes
11369131ee Remove workaround that was needed only by Qt4 2022-11-19 14:58:50 +01:00
Jean-Marc Lasgouttes
0f8b4e36d8 Remove old workaround that was needed for Qt 4.2
Jürgen believes that this is not needed anymore.
2022-11-19 14:55:33 +01:00
Jean-Marc Lasgouttes
ac248e392d Get rid of Qt4 code in src/
Qt4 code has been identidifed by
  git grep -l 'QT_VERSION.*\(0x050000\|0x04\)' src

Uses of QT_VERSION_CHECK have been checked too.

been used to remember what places need further work.

Then remaining Qt4 references have been searched using
  git grep -i qt4
  git grep -i 'qt 4'
and relevant issues have been either fixed or noted in the new
TODO.killqt4 file.
2022-11-18 17:19:50 +01:00
Pavel Sanda
d984730235 Drop C++17 if init-statements to support older compilers. 2022-11-16 21:23:01 +01:00
Jean-Marc Lasgouttes
94e7421a0a Fix compilation with gcc 4.9
It appears that gcc 4.9 does not implement the following part of C++11:
https://cplusplus.github.io/CWG/issues/1148.html

Therefore, we have to use a special case in C++11 mode that does an
explicit std:move.

With recent compilers (gcc >= 9), this leads in C++11 mode to a warning:

MetricsInfo.cpp: In member function ‘lyx::Changer lyx::MetricsBase::changeFontSet(const string&)’:
../../master/src/MetricsInfo.cpp:83:13: warning: redundant move in return statement [-Wredundant-move]
   83 |  return move(rc);
      |         ~~~~^~~~
MetricsInfo.cpp:83:13: note: remove ‘std::move’ call

Partly reverts commit fff28c57.
2022-11-16 17:49:52 +01:00
Jean-Marc Lasgouttes
12bff77722 Merge branch 'breakspace'
This branch improves handling of spaces on display (see #10117):
* caret is correctly shown in the middle of double spaces in justified rows;

* sequence spaces are correctly shown at the end of rows before
  automatic row breaks.

Moreover, this branch:
* streamlines the code that handles spaces in row breaking

* improves display in Qt4 : although the improvements outlined above
  are not present in Qt4 for monospaced fonts, some dsplay glitches
  are resolved.

* improves performance for very long paragraphs (#12598).
2022-11-16 10:22:11 +01:00
Juergen Spitzmueller
5bf7f938a4 Fix tex2lyx corner case (#12537) 2022-11-11 08:12:14 +01:00
Jean-Marc Lasgouttes
50e1bdf320 (almost) Fix Qt4 support
When is it detected that our zero-width characters are not really
zero-width, avoid to use them altogether. Currently, this is known to
happen in Qt4 with monospace fonts.

This allow to remove the special Qt4 code in breaskString_helper.

Related to bug #10117.
2022-11-10 17:27:45 +01:00
Scott Kostyshak
d35753a6d0 CMake build: disable warn about not known policy
This only showed up with -DLYX_EXTERNAL_ICONV=OFF.
2022-11-10 10:34:15 -05:00
Jean-Marc Lasgouttes
23cd38bc1c Use TextLayoutHelper in x2pos and pos2x
This leads to substantial code simplification.

No intended behavior change.

Related to ticket #10117.
2022-11-10 16:13:29 +01:00
Jean-Marc Lasgouttes
7fdc604606 Refactor GuiFontMetrics::getLayout
This allows to create a new version that takes an already built
TextLayoutHelper struct as parameter.

No intended change.

See discussion in bug #10117.
2022-11-10 16:13:28 +01:00
Jean-Marc Lasgouttes
201c95a76e Handle multiple spaces at row break
In order to work around the Qt row breaking algorithm, which considers
multiple spaces as one at QTextLine break, we insert word_joiner unicode
characters beteween each pair of spaces.

The TextLayoutHelper class makes it easy to handle that.

Update Row::Element::rtrim() to only remove one space at row end.

Update support::countExpanders() to count all spaces, without special
handling for consecutive ones.

Fixes bug #10117.
2022-11-10 15:21:02 +01:00
Jean-Marc Lasgouttes
a48efa03b1 Introduce a struct to handle docstring <-> QString index translation
This new code allows to get rid of some hardcoded stuff and will be a
foundation for handling of consecutive spaces.

This code can be used in the future for getTextLayout, x2pos, and
pos2x in order to streamline code. Actually some features as the naked
parameter are here to prepare for this second set of changes.

No change intended. The modified code is much clearer, though.

Related to bug #10117.
2022-11-10 12:06:15 +01:00
Jean-Marc Lasgouttes
a99f76477d Revert "Fixup 572b06d6: reduce cache size for breakString"
10MB cache is not so large after all, and it can be helpful with
Scott's perverse examples.

This reverts commit 2abe771407.

Fixes part of bug #12598.
2022-11-08 00:12:40 +01:00
Jean-Marc Lasgouttes
ec151de2cc Fix expensive thinko: operator++ returns a reference, not a copy
This accounts for 45% of the row breaking time on the (huge) paragraph
of the MWE in bug #12598.

Fixes part of bug #12598.
2022-11-08 00:12:40 +01:00
Kornel Benko
5691863043 Update sk.po 2022-11-07 11:28:15 +01:00
Juergen Spitzmueller
069122feba Revert "Try to be more pedantic wrt blank lines in lyx2lyx output"
This reverts commit 9ce0ff50c1.
2022-11-06 17:17:33 +01:00
Juergen Spitzmueller
9ce0ff50c1 Try to be more pedantic wrt blank lines in lyx2lyx output
Hopefully to the tests' please
2022-11-06 16:40:12 +01:00
Scott Kostyshak
cbc3804a2f Correct typos of "occurred" in warnings/errors
Change "occured" and "ocurred" to "occurred".
2022-11-06 10:06:50 -05:00
Jean-Marc Lasgouttes
90ea508111 Fix pasting as LaTeX in documents with no modules
When there is no module, the old code would invoke tex2lyx with option
 -m
instead of
 -m ""
and an error would ensue.

This is because the QProcess command line parser used in Systemcall is
broken and does not recognize empty parameters as such. The solution
is to rewrite our parsecmd() parser to generate a list of parameters.
This is post-2.4.0 work.

The workaround used here is:

- set the list of modules to "," when it should be empty. In effect,
  this is a list of two empty modules.

- change tex2lyx to accept empty module names and ignore them; this is
  good in terms of robustness anyway.

Additionally, when there is no receiving buffer, set the defaults as
the BufferParams defaults instead of empty (this is cleaner, but
should not make a difference in practice).

In the long term, we should switch to use the QStringList-based API of
QProcess in Systemcall (see QTBUG-80640).
2022-11-06 13:20:02 +01:00
jpc
157d67d55d Update fr.po 2022-11-06 11:15:08 +01:00
Juergen Spitzmueller
2604274a88 de/UserGuide: document index-tag-all 2022-11-06 09:11:18 +01:00
Juergen Spitzmueller
8eff70089f de.po 2022-11-06 09:09:12 +01:00
Scott Kostyshak
c94bb34c50 ctests: ignore a couple more roundtrip tests
Export fails after compilation with the following error:

  ERROR: CHAR: index 0 should be less than the length of the string
2022-11-05 14:50:34 -04:00
Scott Kostyshak
378c19bfc2 Guard some debug code
Amend f352a375 and 3bf1b97a.
2022-11-05 14:35:27 -04:00
Juergen Spitzmueller
3bbce7f24a Introduce index-tag-all lfun
This is a convenience function for indexing. It adds a copy of the
index inset under cursor after any word in the buffer that is equal
(case-insensitively) to the word preceding the index inset.

The function can be easily used to generate bad indexes (and I warn
about that in the UserGuide), but if used with care, it can also be
extremely convenient.
2022-11-05 18:39:33 +01:00
Scott Kostyshak
c52808ce1a ctests: log a waste 2022-11-05 10:37:48 -04:00
Scott Kostyshak
0fe28df08f ctests: ignore a couple fragile lyx2lyx tests
From Kornel [1]:

  Exporting to 2.3 format and exporting from the exported differ in extra lines and
  in changed sequence of 2 lines at begin.

  $ diff doc/fr/UserGuide.23.lyx fr/UserGuide.23.23.lyx

[1] https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg218252.html
2022-11-05 10:37:48 -04:00
Juergen Spitzmueller
e2105bed61 Update RELEASE_NOTES 2022-11-05 08:34:36 +01:00
Daniel Ramoeller
89394bcd0f Show suggestions containing the input in the command buffer
Previously, only the suggestions starting with the current input were
shown.

Contains the following minor improvements:
- Add space to indicate when only one suggestion is found

- Select first item in suggestion-list in order to make selecting with
  arrow keys more intuitive

- Fix selection with Shift+Up/Down in text-field

Fix for bug #12572.
2022-11-04 22:27:31 +01:00
Jean-Marc Lasgouttes
fad170be1a New lfun to copy index insets from ToC
The new function inset-insert-copy can only be invoked from the ToC.
It is currently only implemented for Index inset.

It is a special lfun because Inset::dispatch is called directly from
the ToC widget with cursor pointing to the inset, whereas the patch
happens in the workarea at caret position. This function cannot be
called directly.

Add an entry for this function in the toc context menu.

Fixes bug #4582.
2022-11-04 21:52:46 +01:00
Jean-Marc Lasgouttes
d2f05b9e6f When Inset::dispatch is called from TOC, process screen flags
This is needed because we are not using the complete dispatch
machinery here.

Part of bug #4582.
2022-11-04 21:46:32 +01:00
Jean-Marc Lasgouttes
0b27eb7deb Introduce new function copyInsetToTemp
This is a version of copyInset that does touch the cut stack and the X
selection.

Part of bug #4582.
2022-11-04 21:44:24 +01:00
Jean-Marc Lasgouttes
2c53f0315e Fix another use of unqualified std::move 2022-11-04 21:36:43 +01:00
jpc
9dc6f09c65 Update fr.po 2022-11-04 18:05:43 +01:00
Kornel Benko
2333af615d Amend 9be6a425, Workaround for advanced search in 'uncover'-inset.
Use getInset(i)->toString() instead of getInset(i)->plaintext()
if searching, so that we get the option of 'uncover' visible to the search engine.
2022-11-04 15:34:49 +01:00
Kornel Benko
3b3f43cf35 Update sk.po 2022-11-04 12:47:35 +01:00
Juergen Spitzmueller
1b910e3fd9 de.po 2022-11-04 11:37:38 +01:00
Juergen Spitzmueller
68e268e117 Add some options to index context menu 2022-11-04 11:29:56 +01:00