Commit Graph

26479 Commits

Author SHA1 Message Date
Juergen Spitzmueller
eebc0d8cf5 Add missing l7n flag 2020-05-03 13:36:34 +02:00
Juergen Spitzmueller
fba67710d8 Make counter items translatable and sort properly 2020-05-03 09:44:55 +02:00
Juergen Spitzmueller
6e5f90f72f Fix capitalization
We use sentence casing in combo boxes.
2020-05-03 09:13:41 +02:00
Juergen Spitzmueller
cd2c0dcc81 Re-fix layout
Also improve some strings, and fix capitalization
2020-05-03 09:13:13 +02:00
Richard Kimberly Heck
9e4709e4de Avoid a copy 2020-05-03 02:52:56 -04:00
Richard Kimberly Heck
3b2bcef455 Fix some warnings. 2020-05-03 02:46:11 -04:00
Richard Kimberly Heck
99948beff8 Remove unused files. 2020-05-03 02:32:29 -04:00
Richard Kimberly Heck
16e7f26cec requires is a keyword in C++2a 2020-05-03 02:18:17 -04:00
Richard Kimberly Heck
a38408419c Remove obsolete comment.
We assert (or worse) if pos < 0.
2020-05-03 00:51:01 -04:00
Richard Kimberly Heck
0f4b60c642 GuiNames for float counters. 2020-05-02 23:17:17 -04:00
Richard Kimberly Heck
9bcb243ec6 Increment layout format. 2020-05-02 23:17:16 -04:00
Richard Kimberly Heck
666f90cdbb Use GuiNames for counters. 2020-05-02 23:17:16 -04:00
Richard Kimberly Heck
c37500050d More polishing of counter dialog. Thanks to Jürgen for help.
Also, remove the 'display value' option. We will move this to InsetInfo
at some point.
2020-05-02 20:33:03 -04:00
Juergen Spitzmueller
3d630f49c4 Fix broken mark with multiple citations
Patch by Patrick De Visschere (modified by me)
2020-05-02 08:55:58 +02:00
Richard Kimberly Heck
8a4bb40c7e Fix typo. 2020-05-01 19:47:50 -04:00
Richard Kimberly Heck
bc4ca12ab5 Polish the counter UI a bit and add some to the documentation. 2020-05-01 19:03:54 -04:00
Juergen Spitzmueller
4d3a08bf86 Fix build with qt4 2020-05-01 10:17:04 +02:00
Juergen Spitzmueller
a05b3228bc Fix Ui layouts. 2020-05-01 10:10:27 +02:00
Richard Kimberly Heck
de40b09474 Fix thinkos for counter value type 2020-04-30 23:46:18 -04:00
Richard Kimberly Heck
cb9102f986 Update tex2lyx references. 2020-04-30 23:21:34 -04:00
Richard Kimberly Heck
9a147255df GUI for new counter inset. 2020-04-30 23:11:59 -04:00
Richard Kimberly Heck
9a1b26a156 Format and reversion code for new counter inset. 2020-04-30 23:11:59 -04:00
Richard Kimberly Heck
684d27c0fb New counter manipulation inset.
This inset allows counters to be set, reset, saved, restored, etc,
both in the LyX GUI and in the output; optionally, the effect can be
limited to the GUI. Of course, LaTeX provides means for doing all of
these things, so they could previously be done with ERT, as far as
the output is concerned. But there was no mechanism for manipulating
counters in the GUI and none for other output formats.
2020-04-30 23:09:36 -04:00
Jean-Marc Lasgouttes
7035e230ca Avoid some more copies in range-based for loops
This triggers warnings with clang++ 10.
2020-04-28 15:28:51 +02:00
Jean-Marc Lasgouttes
a85c48de5a Do not for copies in range-based for loops.
Spotted by clang++ 10.
2020-04-28 13:27:50 +02:00
Richard Kimberly Heck
1344caa67a Fix problem with c67b6be77 noted by JMarc. 2020-04-26 16:10:50 -04:00
Richard Kimberly Heck
c94a97e36c Fix declaration 2020-04-26 03:37:20 -04:00
Richard Kimberly Heck
491c966436 Remove unnecessary friendship. Thanks Scott! 2020-04-26 03:16:44 -04:00
Richard Kimberly Heck
7b9dc7bc9e Revert last three commits.
There are other issues here. The big one is in TextMetrics::getPitNearY,
where -1 is used as a 'special' return value for pit.
2020-04-26 03:09:27 -04:00
Richard Kimberly Heck
c92b4f27ec Fix compilation problem 2020-04-26 03:04:06 -04:00
Richard Kimberly Heck
57065afb45 Whitespace 2020-04-25 22:57:09 -04:00
Richard Kimberly Heck
b9e2941847 Make pit_type unsigned (in particular, size_t).
This involves not just changing the type but checking that downward
loops and similar tricks don't break.
2020-04-25 22:50:48 -04:00
Richard Kimberly Heck
7d36b9e4fa Remove method that is now unneeded. 2020-04-25 22:27:09 -04:00
Richard Kimberly Heck
e4da314522 Try to fix bug #6505.
Keep track of nested includes and just refuse to re-enter a file
we're already in the process of handling.

There's a question whether we should do this in updateBuffer and
validate, or whether we should do it separately. For now, this seems
to work.
2020-04-25 22:22:58 -04:00
Richard Kimberly Heck
9319144703 Buffer methods for dealing with recursive includes. 2020-04-25 22:17:46 -04:00
Richard Kimberly Heck
aa794a8806 Return early from the short path. 2020-04-25 17:33:49 -04:00
Richard Kimberly Heck
f1d5926a5d Fix warnings. 2020-04-25 01:26:37 -04:00
Richard Kimberly Heck
c67b6be77e Refactor code to avoid the problem fixed at the last commit. 2020-04-25 01:11:30 -04:00
Richard Kimberly Heck
b5a5a529a3 Fix bug #11850.
When we copy the paragraphs, the Buffer members for the insets are
not set. As a result, we crash when attempting to access them.
2020-04-25 01:05:15 -04:00
Jean-Marc Lasgouttes
b9538b10d4 Ignore some more files when building in source tree 2020-04-23 19:17:15 +02:00
Juergen Spitzmueller
3e1702b1bd Hint at (new) filter function in tooltip. 2020-04-23 14:24:32 +02:00
Juergen Spitzmueller
532e3b8952 Use CategorizedCombo for font selection
We do not have categories, but this gives as a nice filter functionality
for long (non-TeX) font lists for free.

See #11849
2020-04-23 12:43:38 +02:00
Juergen Spitzmueller
631d6b9b2e Categorized Combo: Do not draw category line if the combo has zero categories 2020-04-23 08:31:50 +02:00
Enrico Forestieri
a73c2c2b93 Raise the window in single-instance mode
Other than issuing a warning on the console, now the LyX window is
raised when in single-instance mode and no files to load are specified.
In this way, the user is aware that something happened after double
clicking the program icon. To support this functionality the new lfun
window-raise has been introduced.
2020-04-21 21:55:20 +02:00
Richard Kimberly Heck
986a55fd7e Comment. 2020-04-19 13:31:57 -04:00
Richard Kimberly Heck
d509d85c68 Fix warning 2020-04-19 11:10:56 -04:00
Scott Kostyshak
721d39ddc7 Fix debug message 2020-04-19 10:04:12 -04:00
Juergen Spitzmueller
05c7c65d93 Improve reporting of undefined control sequences in preamble
Fixes #11844
2020-04-19 10:56:58 +02:00
Kornel Benko
478a303f4a Use c++11 to remove last char from a string
Thanks Scott.
2020-04-19 08:59:54 +02:00
Kornel Benko
333e023e82 Amend(4) 689f26d2: Add default path to server pipe (cmake build)
Rename the placeholde $$User to $$UserDir

Make it more readable. Suggestion from Stephan Witt.
2020-04-18 22:26:56 +02:00
Richard Kimberly Heck
3aae85edf1 Fix some warnings 2020-04-18 14:52:08 -04:00
Richard Kimberly Heck
d550774772 Tell the user that LyX is already running when we do not start
because of 'use single instance'.
2020-04-18 14:41:26 -04:00
Kornel Benko
237378477f Amend(3) 689f26d2: Add default path to server pipe (cmake build)
Omit duplicated separators if replacing string '$$User' with actual userdir
2020-04-18 16:32:24 +02:00
Juergen Spitzmueller
ca28c9866a Remap typographical apostrophe from Hunspell to plain apostrophe (#11832) 2020-04-18 11:25:18 +02:00
Juergen Spitzmueller
9e71bdfd32 fix comment 2020-04-18 08:01:39 +02:00
Kornel Benko
689f26d247 Add default path to server pipe (cmake build + unix)
Actually the change is affecting only builds if
1.) Using cmake build
2.) on unix

To use it on
  cygwin: one has to patch development/cygwin/lyxrc.dist.in
  MacOSX:     -//-         development/MacOSX/lyxrc.dist.in

We need also a Windows-version

Also the compilation with automake lacks the handling of development/unix/lyxrc.dist.in
2020-04-17 18:38:51 +02:00
Juergen Spitzmueller
d9b884341c Reset failedtoload_ bool when include inset params are changed (#11842) 2020-04-17 10:19:46 +02:00
Juergen Spitzmueller
5bc66b5f45 Fix tablefootnote loading order (#11841) 2020-04-17 09:12:51 +02:00
Richard Kimberly Heck
86a4c79dc4 Make it nicer, thanks to JMarc 2020-04-16 21:05:38 -04:00
Richard Kimberly Heck
46f1f6f1cb Fix bug #11635 2020-04-16 17:16:26 -04:00
Jean-Marc Lasgouttes
bb0117d182 Simplify code for bidi icons
Most of the RtL icons that we provide are simply mirrors of the LtR ones.
Therefore let the code do that by default if no +rtl icon is found.

The only RtL icon left for now is for "layout Enumerate" (notice the
numbers in it).

Also remove useless getPixmap wrapper and several old bidi_xxx icons
that were forgotten in previous patch.
2020-04-16 20:54:53 +02:00
Jean-Marc Lasgouttes
43eda5ad73 Reimplement properly bidi icons
When the cursor in RTL text, icons for "depth-increment" or
"layout-toggle Enumerate" look wrong.

Instead of relying on the clumsy "bidi" lfun of 2898c335, this new
version relies on a new Toobar tag BidiItem that inserts an action
which can have two icons, depending on the direction of the paragraph
containing the caret (or of the direction of the UI when no file is
open).

The alternative icon has the same name as the original one, with a
"+rtl" string appended to the lfun string. The alternative icon is
only active if the file is found. The icon themes `default', `oxygen'
and `classic' have been updated accordingly.

Fixes bug #4451.
2020-04-14 22:47:56 +02:00
Jean-Marc Lasgouttes
ce0538e372 Revert "Add mechanism to change icons in RTL mode"
This is really too clumsy. Revert in preparation for a better
mechanism.

This reverts commit 2898c335be.
2020-04-14 22:47:50 +02:00
Jean-Marc Lasgouttes
543038e64e Fixup 294969c6: do not forget to update metrics 2020-04-14 17:57:49 +02:00
Kornel Benko
4b052dec77 Amend ef42541d26: Missed to commit these 2020-04-13 13:39:33 +02:00
Kornel Benko
ef42541d26 Prepend dir containing created dtl executables to PATH
This should work on Windows, but needs test.
The changes (namely the installation directory for the dtl executables)
for automake are not yet done. (JMarc?)

It may fix bug #11325 if cmake configured with '-DLYX_EXTERNAL_DTL=OFF'
2020-04-13 12:51:04 +02:00
Jean-Marc Lasgouttes
b5d6caac41 Fix embarassing crash caused by debug message
After commit 6a936d63, the helpful debug message tries to display
non-existing elements and crashes the program :(

Fix by radical simplification of the message.

Part of bug #11777.
2020-04-13 12:02:26 +02:00
Richard Kimberly Heck
eea4ef9b6e Debug output for paragraph params. 2020-04-08 17:21:43 -04:00
Richard Kimberly Heck
f7065fa22e Fix bug #11817.
Preserve line spacing when breaking a paragraph at the beginning.
2020-04-08 17:21:43 -04:00
Kornel Benko
80cd116805 Fix indentation 2020-04-07 11:47:08 +02:00
Juergen Spitzmueller
2748e33be5 Fix indentation 2020-04-06 16:29:34 +02:00
Juergen Spitzmueller
c0adb03a7a Fix quotation marks in PDF TOC 2020-04-06 08:53:29 +02:00
Juergen Spitzmueller
f9999039ac Strip polyglossia options from pdf string
Fixes #11813
2020-04-05 15:23:22 +02:00
Jean-Marc Lasgouttes
5202d44ef5 Do not compute caret geometry when we are not ready to do so.
This avoid crashes with invalid cache.

Fixes bug #11763.
2020-04-04 18:11:07 +02:00
Juergen Spitzmueller
ed137ee435 Disable append-column with gathered
Fixes #11812
2020-04-04 09:27:24 +02:00
Juergen Spitzmueller
fe09ddf1b9 Implement buffer-write force 2020-03-31 08:01:17 +02:00
Juergen Spitzmueller
1e34871d38 Prevent wrong reference to duplicated (but deleted) label
Fixes #11803
2020-03-29 17:47:59 +02:00
Richard Kimberly Heck
2d0ad7d308 Remove code disabled since 2005.
No one knew then what it was supposed to do.
2020-03-28 23:52:55 -04:00
Richard Kimberly Heck
38c2cde0d8 Remove obsolete (and false) comment. 2020-03-28 23:23:52 -04:00
Scott Kostyshak
b67ff925e5 PreviewLoader: start fake pids after PID_MAX_LIMIT 2020-03-28 19:18:21 -04:00
Scott Kostyshak
8f3c95f757 Use << for raising 2 to power instead of ^
The ^ is interpretted as bitwise XOR, so 2^(20) evaluated to 22.

Thanks to Riki for the << trick. This way, we do not have to use
pow() and include the <cmath> header for this one expression.
2020-03-28 19:18:21 -04:00
Richard Kimberly Heck
104fdcc9be Fix crash after 24926b2e23.
The matched element may not have a parent. I guess the old version of
setExpanded too care of that. Now we have to do so.
2020-03-28 15:23:13 -04:00
Richard Kimberly Heck
c5c1683024 Remove newlines from shortcut LFUNs. 2020-03-28 15:15:36 -04:00
Scott Kostyshak
a1169188c7 Fix assertion from setCursor() in outline-down/up
The function outline() itself can change the cursor position in some
cases so we need to store the old position before calling outline().

Spotted by Kornel. For an example file that triggered the assertion,
see:

  https://www.mail-archive.com/search?l=mid&q=20200326183314.09ad4c7c%40admin1-desktop

This commit amends adb7283b.
2020-03-26 19:00:37 -04:00
Juergen Spitzmueller
5db8b65e46 Fix typo. 2020-03-26 16:32:13 +01:00
Pavel Sanda
426ca3a5d6 Let hyperlink insets to be longer if name is given.
Thanks to Oystein Senneset Haaland.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg210882.html
2020-03-25 07:40:27 +01:00
Jean-Marc Lasgouttes
eb92f74d1f Avoid bleeding of inset background outside of inset
As a consequence of fix e64ea357 to ticket #10797, we draw a bit too
much of the inset background outside of the inset (visible for insets
with colored background). #10797 is a ticket that triggers when the
cursor has a width larger than 1.

This patch limits the problems in two respects

* nothing is done on the left, since the cursor width only expands on
  the right.

* on the right, the extra width is limited to cursor width.

Fixes bug #11786.
2020-03-24 12:13:36 +01:00
Juergen Spitzmueller
52cd43dfdc Paste some special chars as insets
See #11790
2020-03-23 12:07:47 +01:00
Juergen Spitzmueller
7b3404fcab Don't omit ZERO WIDTH NON-JOINER on clipboard paste
Fixes #11790
2020-03-22 11:07:57 +01:00
Juergen Spitzmueller
3f364864d4 Fix indentation 2020-03-22 10:10:36 +01:00
Juergen Spitzmueller
1e409a1a75 Properly resolve tracked changes when pasting multiple tabular cells
Fixes #11791
2020-03-21 15:54:37 +01:00
Scott Kostyshak
0d2773ff5e Restore XLFD code for Qt 4
There is a chance that this code is still useful for Qt 4. We keep
it around just in case.

For the case of Qt 4, this commit restores the code changed in
f8e40f8a, d255339a, and d4ff3a29.
2020-03-20 20:51:44 -04:00
Richard Kimberly Heck
9d36f720a5 Revert "Fix bug reported by Kornel."
This reverts commit 438f15da21.

Revert "Track whether we have warned about mixing layouts across e.g. branches."

This reverts commit 861c6167ca.

Revert "Track whether title has been issued via OutputParams."

This reverts commit b536759c07.

There are massive complications here, and I don't have time to fix them all
right now.
2020-03-20 17:19:19 -04:00
Richard Kimberly Heck
438f15da21 Fix bug reported by Kornel.
The old code was actually wrong. Obviously, this should be set only
if we actually do issue the title command.
2020-03-20 15:25:47 -04:00
Scott Kostyshak
35bb9cb4a6 Change a couple instances of QFontMetrics::width()
Use QFontMetrics::boundingRect() instead. QFontMetrics::width() does
not actually calculate the width of the bounding box and is mostly
useful for knowing where to draw text after a string, taking into
account bearings. Indeed, it has been renamed to
QFontMetrics::horizontalAdvance().

For the code touched in this commit, we want to center a string.
Either method would likely be fine, but it is more easy to
understand exactly what QFontMetrics::boundingRect() does.

This commit does change functionality, although it should not be
noticeable.
2020-03-20 10:53:30 -04:00
Scott Kostyshak
f8e40f8ab8 Remove redundant font loader code
Setting the family to "family" is already attempted above. A
different case was adapted to be this duplicate case at d4ff3a29,
but it should have just been removed.

Spotted by Enrico.
2020-03-20 09:18:09 -04:00
Scott Kostyshak
d255339a4c Remove remnants regarding old XLFD font handling
These fonts are no longer supported by Qt 5 and our code no longer
uses the "xlfd" member of the struct modified in this commit. See
d4ff3a2959.
2020-03-19 12:39:16 -04:00
Scott Kostyshak
d4ff3a2959 Fix Qt dep warn and remove XLFD font workaround
This commit fixes a few warnings from Qt 5.14 regarding
QFont::setRawName() and QFont::rawName() like the following one:

  error: ‘void QFont::setRawName(const QString&)’ is deprecated [-Werror=deprecated-declarations]

These methods were deprecated in Qt 5.3. [1]

This commit removes code from 2002 (539ce478) that worked around a
problem in Qt's handling of XLFD fonts that no longer seems relevant
since XLFD is no longer supported in Qt 5 [2]. Even if the problem
were relevant, setRawName() would not fix anything since it is now
an empty method. [3]

I tested that compilation with Qt 4.8.7 works without error.

[1] https://code.qt.io/cgit/qt/qtbase.git/tree/dist/changes-5.3.0/?h=v5.14.0
[2] https://code.qt.io/cgit/qt/qtbase.git/commit/?id=3a8d7b0b9a4db91415b7bda2582a59a76b3754dc
[3] https://codereview.qt-project.org/c/qt/qtbase/+/100292/
2020-03-19 12:30:27 -04:00
Scott Kostyshak
8583410617 Fix Qt deprecation warns for setTextColor()
This commit fixes the following warning from Qt 5.14:

  error: ‘void QTreeWidgetItem::setTextColor(int, const QColor&)’ is deprecated: Use QTreeWidgetItem::setForeground() instead [-Werror=deprecated-declarations]

setForeground was introduced in Qt 4.2 [1].

We have a couple of commented out uses of a setTextColor() method in
GuiDocument.cpp, but the QTextEdit::setTextColor() is not deprecated so no
change is needed.

[1] https://doc.qt.io/archives/qt-4.8/qtreewidgetitem.html#setForeground
2020-03-19 10:16:47 -04:00
Scott Kostyshak
1d015ee9f3 Fix commented out code 2020-03-19 10:16:47 -04:00