Commit Graph

26881 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
77036f5434 Fix and simplify computation of painter monochrome mode
The old code in GuiPainter::filterColor did not work. Tricks with
colors should take place in HSV space, not RGB IMO.

Replace the code with a simpler one which maps the grayscale value
of the original color on the blend color. It works nin the case where
original color is red, but might not work as well when blend color is
not black. Time will tell.

Fixes bug #11904.
2020-07-12 00:01:46 +02:00
Jean-Marc Lasgouttes
2a80b0ac01 Set desktop name for Wayland
Fixes bug 11847.
2020-07-11 20:40:30 +02:00
Juergen Spitzmueller
289cb58f52 Remove unneeded header 2020-07-11 16:41:34 +02:00
Enrico Forestieri
da336cedf3 Fix compilation on platforms where sizeof(wchar_t) == 2.
Use "set" instead of "unordered_set" as some facets are missing when
using gcc on cygwin, mingw and, possibly, FreeBSD.
2020-07-11 16:19:21 +02:00
Juergen Spitzmueller
aaeb425230 Fix header inclusion order
This cures a crash with stdlib-debug on autotools
2020-07-11 12:30:14 +02:00
Juergen Spitzmueller
56c139449d Update tex2lyx test after last file format change 2020-07-11 11:12:00 +02:00
Jean-Marc Lasgouttes
f758894c2f Use Common Number separator instead of European to detect numbers
The is a fixup to commit 611df441. It seems that the wrong unicode
property was selected. It could be that both classes should be used.

Fixes bug #11900.
2020-07-10 18:06:41 +02:00
Richard Kimberly Heck
33eb33d0e7 Revert "Simplify code a bit. Should be equivalent, unless backs is empty!"
This reverts commit 3c094c739b.
2020-07-09 22:25:09 -04:00
Juergen Spitzmueller
2c0b650aa6 Do not attempt to mark par break in single-line insets 2020-07-09 18:47:53 +02:00
Juergen Spitzmueller
11a57ce6c6 Fix header inclusions 2020-07-09 17:19:01 +02:00
Jean-Marc Lasgouttes
aaec8459bf Cleanup: remove trailing underscores
These ToobarItem members are public, not private.
2020-07-09 16:27:00 +02:00
Juergen Spitzmueller
01c1d1e156 tex2lyx: add support for libertinus 2020-07-09 12:26:25 +02:00
Juergen Spitzmueller
8cb9a6d3f6 Add support for the libertinus family of fonts (#11899)
File format change.
2020-07-09 11:46:07 +02:00
Juergen Spitzmueller
780d9a5f4c LaTeXFonts: Add ScaleCommand
This is needed to add support for scaling to fonts that are switched
via command
2020-07-09 11:41:21 +02:00
Juergen Spitzmueller
3335344261 Provide option to prevent unnecessary font loading.
If an OSF font is an alternative to a non-OSF one, only load the OSFFont
if osf is requested.
2020-07-09 11:39:43 +02:00
Eugene Chornyi
06969f9dd4 Workaround Qtbug where QAbstractScrollArea::mouseMoveEvent(...) is called falsely when quickly double tapping on a touchpad of a notebook running Windows 2020-07-09 09:36:12 +02:00
Richard Kimberly Heck
e6b2c7c4ce Change in ::docbook args 2020-07-09 03:27:32 -04:00
Thibaut Cuvelier
af5257b6c3 Fix Coverity false positive for null-pointer dereference 2020-07-09 09:24:35 +02:00
Richard Kimberly Heck
3c094c739b Simplify code a bit. Should be equivalent, unless backs is empty! 2020-07-09 00:03:58 -04:00
Richard Kimberly Heck
747afa36cd Best to use braces when there are comments. 2020-07-09 00:03:58 -04:00
Kornel Benko
5f827b5a9d Amend 3883b85f: Typo in "New DocBook support" 2020-07-09 00:19:34 +02:00
Richard Kimberly Heck
8ae0841826 Whitespace 2020-07-08 12:38:05 -04:00
Pavel Sanda
77e0f69901 Fix another constructor order of parameters 2020-07-08 14:27:24 +02:00
Pavel Sanda
7175a87f14 comment only 2020-07-08 14:05:54 +02:00
Pavel Sanda
20a33941fa Wrong order in constructor 2020-07-08 13:34:45 +02:00
Thibaut Cuvelier
25bb51c865 Remove DOCBOOK enum values, no more used. 2020-07-08 13:15:05 +02:00
Thibaut Cuvelier
fd6e14414f Remove GuiRef::nameAllowed, as the DocBook support no more uses it 2020-07-08 09:55:59 +02:00
Thibaut Cuvelier
3a24550765 Remove GuiRef::typeAllowed, as it is now always allowed. 2020-07-08 09:41:45 +02:00
Thibaut Cuvelier
b596921211 The new DocBook output has no prerequisite on the document, so enable it for each and every document. 2020-07-08 09:35:03 +02:00
Thibaut Cuvelier
3883b85f49 New DocBook support 2020-07-08 08:42:16 +02:00
Pavel Sanda
28968b1f0d Add required elements in the layouts to support DocBook.
Slightly modified patch from Thibaut Cuvelier.
2020-07-07 09:49:48 +02:00
Juergen Spitzmueller
0bddf448ef Prevent outputting \maketitle within an inset embedded in title.
Amends [e4ef8ddc0f8202/lyxgit]
2020-07-04 10:54:20 +02:00
Juergen Spitzmueller
e4ef8ddc0f Properly fix handling of title layouts within insets (#11787) 2020-07-03 16:20:38 +02:00
Juergen Spitzmueller
ccde0fb01d constification 2020-07-02 08:22:49 +02:00
Juergen Spitzmueller
d0cbcda3b9 Fix yet another thinko in the math grid paste code
This is a Hydra!
2020-06-30 17:23:58 +02:00
Juergen Spitzmueller
b84e497ab6 Fix cursor positioning with specific matrix pastings 2020-06-30 09:25:59 +02:00
Juergen Spitzmueller
3718ff9a15 Fix c&p of tabular data between different LyX instances (#4448) 2020-06-29 18:52:10 +02:00
Juergen Spitzmueller
7869960888 Fix math matrix column insertion on paste 2020-06-29 18:05:46 +02:00
Juergen Spitzmueller
5c663849d1 Update cursor idx after grid paste if columns are appended 2020-06-29 17:57:18 +02:00
Juergen Spitzmueller
7f773cf24e Resize table if needed on multi-cell paste 2020-06-29 17:51:24 +02:00
Juergen Spitzmueller
3b895bb47a Fix math grid paste when needing more cells 2020-06-29 16:30:49 +02:00
Juergen Spitzmueller
5cb89a8f81 Implement proper pasting from multiple table cells to non-table (#4447) 2020-06-29 15:13:45 +02:00
Juergen Spitzmueller
2cee820f71 Correctly initialize font (language) for multiple-cell paste (#11898) 2020-06-29 13:41:19 +02:00
Juergen Spitzmueller
6dd990560e Do not paste \t when pasting multiple table columns outside table (#4449) 2020-06-29 12:51:15 +02:00
Juergen Spitzmueller
16d0785e67 Fix pasting of math grid with more rows in source than target (#11897) 2020-06-29 09:48:05 +02:00
Juergen Spitzmueller
557adebcc1 Honor "provides parskip 1" 2020-06-29 09:00:28 +02:00
Juergen Spitzmueller
e121bd04bb Support halfline and fullline also in vspace. 2020-06-28 18:27:59 +02:00
Juergen Spitzmueller
361d4d43e3 update tex2lyx tests 2020-06-28 17:27:36 +02:00
Juergen Spitzmueller
b0c102cfb4 use package parskip to separate paragraphs with vertical space (#4796)
File format change
2020-06-28 17:20:18 +02:00
Juergen Spitzmueller
261625f412 Force local switch for info insets that change language
Fixes compilation of current English UG
2020-06-27 09:40:12 +02:00
Juergen Spitzmueller
ae4c2b122f Update tex2lyx tests after file format change 2020-06-26 11:32:01 +02:00
Juergen Spitzmueller
a68b0389bc Add support for medspace and thickspace (in text) (#11893)
File format change.
2020-06-26 11:12:35 +02:00
Jean-Marc Lasgouttes
8ceb4f6b58 Run codespell on src/frontends
Command was:
codespell -w -i 3  -S Makefile.in -L mathed,afe,tthe,ue,fro,uint,larg,alph,te,thes,alle,Claus,pres,pass-thru  src/frontends/
2020-06-26 00:21:47 +02:00
Pavel Sanda
7a132f4f8c typo left by codespell 2020-06-26 00:07:03 +02:00
Jean-Marc Lasgouttes
110f8f67ac Run codespell on tex2lyx/, client/, convert/ and graphics/
Command was
codespell -w -i 3  -S Makefile.in -L mathed,afe,tthe,ue,fro,uint,larg,alph,te,thes,alle,Claus,pres,pass-thru  src/xxx
2020-06-25 23:50:52 +02:00
Jean-Marc Lasgouttes
5d4e6dfb68 Run codespell on src/insets
Command was
codespell -w -i 3  -S Makefile.in -L mathed,afe,tthe,ue,fro,uint,larg,alph,te,thes,alle,Claus,pres,pass-thru  src/insets/
2020-06-25 23:46:16 +02:00
Jean-Marc Lasgouttes
3c4e567d44 Run codespell on src/mathed
codespell -w -i 3 -S Makefile.in -L mathed,afe,tthe,ue,fro,uint,larg,alph,te,thes,alle,Claus,wit,nd,numer  src/mathed/
2020-06-25 23:31:42 +02:00
Jean-Marc Lasgouttes
9fe1ed4d68 Run codespell on src/support
Codespell is run with command line
codespell -w -S Makefile.in -L mathed,afe,tthe,ue,fro,uint,larg,alph,te,thes,alle,Claus -i 3 src/support/
2020-06-25 23:17:18 +02:00
Juergen Spitzmueller
9f13bb73f8 Consider nesting level when autonesting 2020-06-25 10:37:04 +02:00
Jean-Marc Lasgouttes
3fea3b0096 Allow row-breaking after some insets
Add new RowFlags value CanBreakAfter, which says that the row can be
broken after the inset if needed. There is no CanBreakBefore yet,
because I do not know of an inset that needs it.

This makes screen closer to the actual behavior of insets.

Currently, only unprotected spaces and some special characters are
concerned. There may be more that need this handling.

Fixes bug #11621.
2020-06-23 23:34:49 +02:00
Jean-Marc Lasgouttes
49e1466f93 Make all unbreakable spaces of the same Color_latex color
Of course, this means that negative spaces cannot be recognized anymore.
2020-06-23 23:33:37 +02:00
Jean-Marc Lasgouttes
8535efafde Fix comment 2020-06-23 23:32:05 +02:00
Jean-Marc Lasgouttes
f96e2f3a6a The hard-coding of word_wrap has been fixed at bf88ad49. 2020-06-23 00:10:41 +02:00
Jean-Marc Lasgouttes
ba738d0167 Use new rowFlags() values to remove some inset hardcoding.
The enum DisplayType is replaced with the flags RowFlags that can be
combined. Here is the correspondence between the old DisplayType and
the new Inset::RowFlags:

DisplayType   RowFLags             Meaning
 Inline        Inline               plain inline inset
  --           BreakBefore          row ends before this inset
  --           BreakAfter           the row ends after this inset
 AlignCenter   Display	            the inset is centered on its own row
 AlignLeft     Display | AlignLeft  the inset is left-aligned on its row
 AlignRight    Display | AlignRight the inset is right-aligned on its row
  --           RowAfter             an extra row is needed after this inset

Display is just a shortcut for BreakBefore | BreakAfter.

The flags for the newline inset will be BreakAfter | RowAfter,
while the separator inset will just use BreakAfter.

This groundwork does not introduce any new feature at this point. It
aims to remve the numerous isNewLine and isSeparator all over the
code, and to eventually optional break after some insets like spaces
(see #11621).

Most display() methods are renamed to rowFlags(). Some are removed
because they returned Inline.

Now display() is only a helper function for hull insets.
2020-06-22 23:11:40 +02:00
Eugene Chornyi
4dc33e52f8 Amend e501f2c4
put icons in cmake bin dir so that tex2lyx can also see them
2020-06-21 19:50:21 +02:00
Juergen Spitzmueller
bde95c1876 Fix swapped logic (#11889) 2020-06-19 16:40:07 +02:00
Thibaut Cuvelier
8f89768211 Fix in symbols handling: parse the XML entity with \def. 2020-06-19 08:22:56 +02:00
Thibaut Cuvelier
718eede94b MathML: Convert HTML entities to XML entities. 2020-06-18 19:37:08 +02:00
Thibaut Cuvelier
054bdc5d18 MathML stream allows for name spaces. 2020-06-18 19:32:51 +02:00
Richard Kimberly Heck
ef65414d25 Focus keyword filed in Thesaurus dialog 2020-06-18 10:51:21 -04:00
Pavel Sanda
ebcaa5b1db Rename-XHTMLStream-to-XMLStream #3.
Fix paragraph id in xHTML output to the pre-refactoring status.
Tested on math manual (plus minus nonessential newlines).

Slightly modified patch from Thibaut Cuvelier.
2020-06-18 16:05:15 +02:00
Eugene Chornyi
e501f2c473 Assure that LyX and tex2lyx use src/lyxwinres.rc 2020-06-18 14:31:25 +02:00
Jean-Marc Lasgouttes
c42776868d Do not dereference getFormat() if it is null
Return early when format is unknown. I am not sure whether this is
supposed to happen and whether we should assert on this condition.

Spotted by coverity.
2020-06-18 11:39:45 +02:00
Jean-Marc Lasgouttes
48d164ddef Initialize properly Counter::saved_value_ member
Spotted by coverity.
2020-06-18 11:23:26 +02:00
Jean-Marc Lasgouttes
5aadf0879f Pass BufferParams by address
Spotted by coverity.

Note that this probably fixes a bug in getTokenValue(), where an author
was added to the BufferParams copy.
2020-06-18 11:17:32 +02:00
Enrico Forestieri
70ccf9f243 Use the same icon as in the cmake build 2020-06-17 19:52:27 +02:00
Enrico Forestieri
ddcbfb77bf Update copyright notice 2020-06-16 21:22:42 +02:00
Pavel Sanda
86387120bc Rename-XHTMLStream-to-XMLStream #2.
Refactor font-related stuff to come closer to the previous xHTML output.
Patch from Thibaut Cuvelier.
2020-06-15 23:37:27 +02:00
Pavel Sanda
8e2b18ada9 Amend a6b07608d8, took older patch. 2020-06-15 13:13:00 +02:00
Thibaut Cuvelier
a6b07608d8 Rename XHTMLStream to XMLStream, move it to another file, and prepare for DocBook adoption.
xml.cpp/h also merges functionalities from sgml.cpp/h.
2020-06-15 13:01:56 +02:00
Enrico Forestieri
85ac309eed Amend 5a80f7bb
Was missing these.
2020-06-12 11:50:58 +02:00
Thibaut Cuvelier
c8d0492194 MathML: generate only a mathvariant for double-struck font, no redundant class 2020-06-11 23:22:48 +02:00
Enrico Forestieri
5a80f7bb6a Add support for the doublestroke package
This commit adds the mathed command \mathds that selects a
font more appropriate than \mathbb for typesetting the
mathematical symbols for the natural (N), whole numbers (Z),
rational numbers (Q), real numbers (R), complex numbers (C),
and some others.

As in the \mathbb case, only capital letters are supported,
but in addition one can also typeset a symbol often used for
representing the indicator function (\mathds{1}) and the
letters a, h, k.

Fixes bug #11887.
2020-06-11 16:42:31 +02:00
Juergen Spitzmueller
64edb7a196 UI improvement to math matrix dialog, suggested by magistere (#11888) 2020-06-11 11:29:11 +02:00
Thibaut Cuvelier
716e3dc1a8 Output double-struck fonts as such in MathML, not in bold 2020-06-11 10:30:48 +02:00
Juergen Spitzmueller
134cb3b265 Consider parbreakIsNewline in plaintext output
Fixes #11886
2020-06-11 10:20:27 +02:00
Juergen Spitzmueller
76f19c6c6e Fix some typos in comments, by Thibaut Cuvelier 2020-06-08 06:56:25 +02:00
Juergen Spitzmueller
cbe75042c0 Do not track row/column deletion in paste_tabular
Fixes #11884.
2020-06-07 19:18:00 +02:00
Kornel Benko
ed665a0333 Amend 2d48072e: Get rid of Qt resources
Remove the cmake handling too
2020-06-07 12:07:58 +02:00
Jean-Marc Lasgouttes
2d48072e66 Get rid of Qt resources
It turns out that the resources were mostly not used anyway. Removing
them shrinks LyX binary by ~6MB.

Only autotools have been adapted. cmake will require the same
simplification.
2020-06-07 01:15:28 +02:00
Jean-Marc Lasgouttes
6b221751c1 Move BulletsModule to frontend namespace 2020-06-07 01:15:28 +02:00
Richard Kimberly Heck
da362a6a59 Need this for std::endl now, according to Eugene 2020-06-06 13:06:06 -04:00
Jean-Marc Lasgouttes
12a9753fb5 Allow to provide explicit icons for things like command-alternative
The automatic icons for "command-alternative", "math-insert",
"math-(big)delim" and "command" can be overriden by an explicit icon
name.

Besides that, the iconName function is refactored, and now returns an
additional bool that indicates whether the icon should be flipped.

The code that uses resources is still useless. This will be the
subject of further work.
2020-06-06 01:21:02 +02:00
Jean-Marc Lasgouttes
a71b96ac42 Fixup 74540c98: handle selection for label background
74540c98 was a fixup of d207e85c, which avoided using inset background
as inset label background.

d207e85c introduced a background under inset labels to avoid fake bold
effect.

Hopefully, this last variation will be the right one !
2020-06-05 22:32:58 +02:00
Richard Kimberly Heck
acc3f2cef8 Forgot this part. 2020-06-01 12:27:32 -04:00
Richard Kimberly Heck
9f5491baf9 Internal buffers are valid 2020-06-01 12:23:20 -04:00
Kornel Benko
38ec7471e7 Amend 44816adce6: Be careful before using buffer parameters in colAlign
The LASSERT(isBufferValid()..) leads to crash in find-adv dialog
2020-06-01 10:20:38 +02:00
Juergen Spitzmueller
1bf18368cf Add support for the xindex index processor
This is a modern alternative for makeindex that is fully unicode-aware
and written in lua.

As opposed to xindy, it is more lightweight and actively maintained.

The program is still in a rather early stage of development, so we do
not propose this as default.

This relies on xindex 0.22 (about to be released) to function properly.
2020-05-30 12:54:20 +02:00
Juergen Spitzmueller
79df18e4d4 update tex2lyx tests after 5b2479176b 2020-05-30 09:27:37 +02:00
Kornel Benko
9da4390a9b FindAdv: Correct next test (keytest/findadv-16)
Provided that the LASSERT in src/mathed/InsetMathGrid.cpp:1824
is removed.
2020-05-29 20:04:57 +02:00
Kornel Benko
8028dce129 FindAdv: Correct some testcases 2020-05-29 14:22:34 +02:00
Kornel Benko
03ad03320e Findadv: Convert some messages from LYXERR0(...) to LYXERR(Debug::INFO, ...)
Due to a hint from Scott:
> I don't think it should be printed to LYXERR0. That goes to the terminal
> for the user. Even our lyx2lyx tests fail if they detect any information
> printed to the terminal (although we escape some warnings). If "find" is
> not a good debug level for it, maybe we can put it in "info" (the first
> debug level)?
2020-05-29 08:44:56 +02:00
Jean-Marc Lasgouttes
e06e2e24e7 Revert part of 56e012be: hardcode again "too small" preview size
It seems that the use of zoom in determining the size of the minimal
value was a bad idea.

It still think that the situation is not very satisfying, we need a new idea.
2020-05-28 20:43:01 +02:00
Kornel Benko
b7cac34d96 Findadv: 2 more possible out of range access cases corrected 2020-05-26 18:49:50 +02:00
Kornel Benko
8dd2ac7171 Findadv: Do not use out of range index into a string
Thanks Scott. Crashing if using _GLIBCXX_DEBUG preprocessor setting
2020-05-26 15:58:23 +02:00
Juergen Spitzmueller
5b2479176b tex2lyx: reset language after polyglossia lang environment has been closed
Fixes #11878
2020-05-26 10:15:52 +02:00
Jean-Marc Lasgouttes
8d51b3e7bb Simplify code by using initializer lists for vectors.
{ REFERENCE_NEXT, NOTE_NEXT } can be used as a value for a
vector<FuncCode> since C++11.
2020-05-23 17:10:17 +02:00
Jean-Marc Lasgouttes
7761e1317e Fix first draw of auto-open inset
note-next and reference-next should trigger an update so that metrics
are updated when the cursor ends up in an auto-open inset.

Fixes bug #11870.
2020-05-23 16:50:04 +02:00
Richard Kimberly Heck
44dc38e120 Revert part of 47973dc2b, which was causing bug #11873. 2020-05-22 23:43:44 -04:00
Richard Kimberly Heck
a2b21e3cd4 Fix more warnings and simplify a tiny bit. 2020-05-19 18:06:20 -04:00
Richard Kimberly Heck
6942dc9fb4 Fix warnings 2020-05-19 17:08:38 -04:00
Richard Kimberly Heck
ca417d2c87 Fix warnings 2020-05-18 01:15:50 -04:00
Richard Kimberly Heck
d7dde0c723 Fix warnings. 2020-05-18 00:46:58 -04:00
Richard Kimberly Heck
2de99c5dd9 Fix bug #11456.
Add cancel button and take no action if we're canceled.
2020-05-18 00:28:36 -04:00
Richard Kimberly Heck
b2517d60b8 Fix bug #11405.
We don't actually prevent hidden buffers from being dirty, so we need
to save them if they are.
2020-05-18 00:07:56 -04:00
Richard Kimberly Heck
a96ec2db45 Remove debugging code. Thanks Scott! 2020-05-17 20:59:34 -04:00
Richard Kimberly Heck
e1615f4107 Const-ness, and a missing Class declaration. I do not understand
why this ever worked.
2020-05-17 20:52:58 -04:00
Richard Kimberly Heck
5d9e175256 Fix copy-paste error.
See bug #11869.
2020-05-17 20:52:18 -04:00
Richard Kimberly Heck
c6b3f35c8c Properly check return values so TIMEOUT is recognized. 2020-05-17 14:58:15 -04:00
Enrico Forestieri
49098aa318 Fix bug #11854
The code was checking only for particular vertical alignment requests
in order to decide to nest a standard array into a 1x1 ams matrix.
However, also vertical lines are not possible in ams matrices.
2020-05-17 18:15:00 +02:00
Juergen Spitzmueller
6057fba90a Fix indentation 2020-05-17 15:18:38 +02:00
Juergen Spitzmueller
0328ecd019 Properly close and reopen lyxdeleted macro at font change
Fixes #11867, amends [28da0f4360a/lyxgit]
2020-05-17 14:54:59 +02:00
Juergen Spitzmueller
602ac1401e return from switch
we don't break in this switch
2020-05-17 13:57:31 +02:00
Juergen Spitzmueller
f2243a3bc7 Disable bookmarksopenlevel SL when bookmarksopen is false
Fixes #11289
2020-05-16 10:31:48 +02:00
Juergen Spitzmueller
92ba05c53b Assign InsetBibtex to appropriate toc level
Fixes #11863
2020-05-15 10:14:22 +02:00
Juergen Spitzmueller
11dc817e9d Check class options for uncodable glyphs
Fixes #11865
2020-05-15 09:50:25 +02:00
Jean-Marc Lasgouttes
fc5b22a2f1 Get rid of lyx::next uses for RandomAccessList
These uses are inefficient (a loop really) and require that pit_type
is ptrdiff_t.

Instead, RandomAccesslist::constIterator is renamed to iterator_at and
a version adding a non-const iterator is added. Additionally, the
method retirns end() when position is equal to the size of the
container (see #11861).

lyx::next and lyx::prev are removed, and std::prev is used in the few
places where the code requires it (for no good reason IMO).
2020-05-14 10:35:49 +02:00
Richard Kimberly Heck
97bbcf2b9b Remove include no longer needed 2020-05-13 14:54:16 -04:00
Richard Kimberly Heck
b0def618f8 Simplify. 2020-05-13 14:49:01 -04:00
Richard Kimberly Heck
5353cf90c0 Replace functors in ExternalTemplate.cpp. 2020-05-13 14:42:52 -04:00
Richard Kimberly Heck
ce33715d2b Don't make copies! 2020-05-13 14:23:27 -04:00
Richard Kimberly Heck
47973dc2b4 Remove a couple more functors from PrevewLoader. 2020-05-13 13:33:27 -04:00
Richard Kimberly Heck
1e904625b2 Remove functors in PreviewLoader.cpp.
Also fix some warnings.
2020-05-13 13:33:27 -04:00
Jean-Marc Lasgouttes
c756749991 Revert "Get rid of lyx::next uses for RandomAccessList"
This is not ready (see #11861).

This reverts commit 6d97e39934.
2020-05-13 10:45:25 +02:00
Juergen Spitzmueller
2663e3845e Move \PassOptionsToPackage before the first package loaded
Fixes #11862
2020-05-13 08:48:08 +02:00
Jean-Marc Lasgouttes
e52af39864 Avoid a warning 2020-05-12 17:42:50 +02:00
Jean-Marc Lasgouttes
6d97e39934 Get rid of lyx::next uses for RandomAccessList
These uses are inefficient (a loop really) and require that pit_type
is ptrdiff_t.

Instead, RandomAccesslist::constIterator is renamed to iterator_at and
a version adding a non-const iterator is added.

lyx::next and lyx::prev are removed, and std::prev is used in the few
places where the code requires it (for no good reason IMO).
2020-05-12 17:29:21 +02:00
Richard Kimberly Heck
b1a0f7ac54 Fix typo (from Thibaut) 2020-05-08 13:32:08 -04:00
Richard Kimberly Heck
195c0bfbad Rename some routines 2020-05-05 11:19:21 -04:00
Richard Kimberly Heck
5989160154 Remove functors in IndicesList.cpp. 2020-05-05 11:19:21 -04:00
Richard Kimberly Heck
958958453f Replace functors in Format.cpp. 2020-05-05 11:16:28 -04:00
Richard Kimberly Heck
7f875d7dac Replace functor in BranchList 2020-05-05 11:16:24 -04:00
Richard Kimberly Heck
c506f304bc Fix a number of issues that were stopping compilation with MSVC 19.
Patch from Thibaut Cuvelier, modified slightly by me (mostly for style).
2020-05-04 19:45:58 -04:00
Richard Kimberly Heck
91265c1f46 Missing include according to VC19 2020-05-04 14:19:29 -04:00
Richard Kimberly Heck
d6a7ec506e s/requires_/required_/ for code consistency 2020-05-04 14:05:44 -04:00
Richard Kimberly Heck
3b09ef61a6 Fix remaining (I think) requires keyword issues. 2020-05-04 13:46:01 -04:00
Scott Kostyshak
23abb5aaa3 Fix commented out code
Since the if condition changed at af4ee1a4, the "else" in the
comment needed correction.
2020-05-04 09:27:35 -04:00
Scott Kostyshak
af4ee1a487 Only set dummy X11 selection if we do not own it
Before, we would continually set the selection to the empty string,
to maintain ownership. This causes problems with clipboard managers
GPaste and CopyQ. Further, in theory this should have better
performance since checking ownership should be faster than setting.

A disadvantage of this change is that the timestamp of the selection
will be old at this point in the code. However, when the selection
is requested, we put the selection contents at that point so the
selection timestamp should be accurate then. Further, the selection
contents are not accurate at this point in the code (they are just
the empty string), so it is not clear whether having an accurate
timestamp is beneficial.

Fixes #11715.
2020-05-04 08:58:56 -04:00
Juergen Spitzmueller
210c4aa9a2 Use translated GUI name of counter in button label 2020-05-04 09:28:07 +02:00
Juergen Spitzmueller
5171b7ea6c Keep sort order of counter actions 2020-05-04 09:22:35 +02:00
Richard Kimberly Heck
5f5cb7eea7 Fix warnings by using size_t as the loop variable. 2020-05-03 15:02:40 -04:00
Richard Kimberly Heck
e8800373e6 is_utf8 is always passed a char. 2020-05-03 15:02:25 -04:00
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
Scott Kostyshak
27ba830b8e Fix Qt deprecation warns for setAutoCompletion()
This commit fixes a few warnings from Qt 5.14 like the following
one:

  error: ‘void QComboBox::setAutoCompletion(bool)’ is deprecated: Use setCompleter() instead. [-Werror=deprecated-declarations]

We only generated setAutoCompletion() from setting the property in
the .ui files. There does not seem to be a .ui file property that
generates setCompleter(). However, the default in both Qt5 [1] and
Qt4 [2] is to enable case-insensitive autocompletion, which seems to
be the same type of autocompletion as when we were relying on
setAutoCompletion(true). Thus, we can remove the properties that set
autocomplete to true. There is only one file, SearchUi.ui, where we
were turning off the autocompletion; we now do so using
setCompleter(0) in GuiSearch::GuiSearch().

[1] https://doc.qt.io/qt-5/qcombobox.html#setCompleter
[2] https://doc.qt.io/archives/qt-4.8/qcombobox.html#setCompleter
2020-03-18 23:17:44 -04:00
Richard Kimberly Heck
861c6167ca Track whether we have warned about mixing layouts across e.g. branches. 2020-03-17 01:54:47 -04:00
Richard Kimberly Heck
b536759c07 Track whether title has been issued via OutputParams.
When branches are used in the title, we may need to track whether
we've issued the title across branch insets. So we put the relevant
variables into OutputParams.
2020-03-17 01:50:28 -04:00
Richard Kimberly Heck
7af6575cf6 Fix bug #11787.
Make sure we are actually at the end of the document before issuing
\maketitle because we are at the end of the document.
2020-03-17 01:39:07 -04:00
Richard Kimberly Heck
771940d5d7 Remove unused function 2020-03-16 02:18:19 -04:00
Richard Kimberly Heck
cf14e81412 Fix some warnings 2020-03-16 02:12:16 -04:00
Richard Kimberly Heck
4732da8dc2 Nullptr warnings 2020-03-16 02:09:39 -04:00
Richard Kimberly Heck
ada09a2cda Fix warning about 'requires' being a keyword. 2020-03-16 01:31:30 -04:00
Richard Kimberly Heck
7c7ea3113f Use ranges and fix nullptr warnings. 2020-03-16 01:31:30 -04:00
Scott Kostyshak
24e0bd3afe Fix Qt deprecation warns for QTime
This commit fixes a couple of warnings from Qt 5.14 like the
following one:

  error: ‘int QTime::restart()’ is deprecated: Use QElapsedTimer instead [-Werror=deprecated-declarations]

This commit changes two uses of QTime to QElapsedTimer, one used
only when the "files" debug flag is set, and the other for timing
whether a script (e.g., knitr) takes longer than a certain amount of
time to run.

QElapsedTimer is superior for these two use cases in that it uses a
monotonic clock if possible, and is thus more robust to certain
changes (e.g., daylight savings changes) [1]. Similarly, the commit
in Qt Base that makes this deprecation [2] mentions the following in
the commit message:

  QElapsedTimer does the job better and without the DST kludges.

Note that QElapsedTimer class was introduced in Qt 4.7, so no
conditioning on Qt version is necessary.

Not all methods of QTime are deprecated and we still use some of
the non-deprecated methods in our code (e.g., to get the current
wall clock time in GuiProgress::currentTime()).

[1] https://doc.qt.io/qt-5/qelapsedtimer.html
[2] https://code.qt.io/cgit/qt/qtbase.git/commit/?id=ed99a591a83a399458f12341d0a1c0b3152f247a
2020-03-15 22:47:08 -04:00
Juergen Spitzmueller
9a31c1b90b update tex2lyx tests 2020-03-15 17:19:23 +01:00
Juergen Spitzmueller
4d7f4762a1 Outliner: Add filter combo for non-output items
Addresses #11442, #10786
2020-03-15 10:46:35 +01:00
Richard Kimberly Heck
f044d3a359 Fix bug #11780.
The preamble snippets are for LaTeX and do not need to be output
with HTML.
2020-03-14 18:31:25 -04:00
Richard Kimberly Heck
5333998570 Use a reference 2020-03-14 18:06:18 -04:00
Juergen Spitzmueller
b96ce9a9c1 Outliner: distinguish non-active refs from broken refs
See #11782
2020-03-14 16:29:53 +01:00
Juergen Spitzmueller
0f9ef6877c Add active refs to non-active labels to brokenrefs toc 2020-03-14 15:35:47 +01:00
Juergen Spitzmueller
a1da60642c Add outliner section for broken refs and citations 2020-03-14 15:18:28 +01:00
Juergen Spitzmueller
4ddc9e2501 Color broken citations, xrefs, and includes
Fixes #11503
2020-03-14 14:17:30 +01:00
Juergen Spitzmueller
bb277747d2 Support log parsing for multi-line warnings wrt undefined references 2020-03-14 11:16:12 +01:00
Juergen Spitzmueller
037b1e1478 thinko 2020-03-14 09:51:07 +01:00
Juergen Spitzmueller
02d2e4aa32 Do not break on undefined references that are part of the family.
Thus a document can be viewed if it contains references to
its master, children or siblings that are being excluded via includeonly,
or viewed standalone if it contains references to its master or siblings.
2020-03-14 09:43:57 +01:00
Juergen Spitzmueller
38a46b43c7 Improve error message 2020-03-14 09:43:16 +01:00
Juergen Spitzmueller
59e3ff27ff Fixup tooltips 2020-03-13 16:24:51 +01:00
Jean-Marc Lasgouttes
7d54d78691 Revert "Do not display caret when we're not ready"
I did not mean to push this.

This reverts commit 9bc255dc89.
2020-03-13 16:23:01 +01:00
Jean-Marc Lasgouttes
65e0aa767d remove constructs and comments about old compilers 2020-03-13 16:15:41 +01:00
Jean-Marc Lasgouttes
9bc255dc89 Do not display caret when we're not ready
Using a dialog may trigger a redraw at times where the metrics caches
have not been updated yet. To fix this, do as in paintEvent() and
abort caret blinking if there is an open undo group.

Move the decision to skip the caret painting to showCaret(), closer to
where real work happens. hideCaret () is now an alias for
showCaret(false), which allows some code refactoring.

See also commit c7496a11b2.

Fixes bug #11763 (although it does not trigger on master).
2020-03-13 16:02:36 +01:00
Juergen Spitzmueller
f4af191403 Introduce maintain unincluded children "mostly"
This is a mode for includeonly handling that is effective and still outputs
at least mostly correct counters and references. This is intended for non-
final editing work.

File format change.
2020-03-13 15:46:35 +01:00
Scott Kostyshak
36208d488e Fix preview check box for include insets
GuiInclude::initialiseParams() calls InsetCommand::string2params()
which calls InsetCommandParams::clear(), however this last function
did not reset the special "preview_" parameter. Now this parameter
is reset to false as part of clear().

The ParamData class documents (see InsetCommandParams.h) the
following:

  // No parameter may be named "preview", because that is a required
  // flag for all commands.

Thus, we must handle preview_ separately from the other parameters.

This commit fixes #11779.
2020-03-13 10:16:24 -04:00
Juergen Spitzmueller
6c889209a7 Improve performance of includeonly with "maintain counters and references"
First, we do not need to run bibtex/biber on the maintenance run, as
the necessary references will be generated on the includeonly run.

Second, exclude the master from DepTable in maintenance run, as the
master is re-checked in any case in the includeonly run, and as it will
always be detected as changed due to the \includeonly statement, which
will trigger a complete build.

More improvements to follow.
2020-03-13 11:49:07 +01:00
Scott Kostyshak
2b86751057 Fix correction with continuous spellcheck
This commit amends 8d26ae57ba.
2020-03-12 22:22:40 -04:00
Juergen Spitzmueller
b568a49593 Fix UI quirk in IncludeOnly settings
Fixes #11564
2020-03-12 10:37:56 +01:00
Scott Kostyshak
adb7283b69 outline-up/down: preserve cursor's position
There is no need to change the cursor's position to the beginning of
the line.

This change does not affect the behavior of using the buttons in the
Outliner pane, but is useful for using the keyboard shortcuts.
2020-03-11 14:19:05 -04:00
Scott Kostyshak
2cfcd706ab Fix Qt deprecation warns for setting tab
Fix warnings coming from deprecations of QTextEdit::tabStopWidth()
and QFontMetrics::width(). Regarding tabStopWidth(), the ChangeLog
states the following [1]:

  Introduced tabStopDistance property in QTextOption, QTextEdit and
  QPlainTextEdit as replacement for the inconsistently named tabStop and
  tabStopWidth properties. QTextOption::tabStop, QTextEdit::tabStopWidth and
  QPlainTextEdit::tabStopWidth are now deprecated.

Note that QFontMetrics::horizontalAdvance() is what we want here, as
opposed to QFontMetrics::boundingRect(), because we want to know
where to draw the next character after the tab.

[1] https://code.qt.io/cgit/qt/qtbase.git/tree/dist/changes-5.10.0/?h=v5.10.0
2020-03-08 11:48:54 -04:00
Stephan Witt
0885098bd3 #11747 follow-up of change d94b708a0f to fix a compiler warning 2020-03-08 13:33:30 +01:00
Scott Kostyshak
2ee5d3c3d5 Revert "Do not display caret when we're not ready"
This reverts commit e99436b529.

Kornel discovered a regression due to this commit. See:

  https://www.mail-archive.com/search?l=mid&q=20200307121525.56be047b%40admin1-desktop
2020-03-07 16:50:59 -05:00
Richard Kimberly Heck
c32e37b702 Revert b7509419.
There are double updates of dialogs in some cases, but this isn't why.
2020-03-07 16:04:01 -05:00
Juergen Spitzmueller
3bd03709fd Consider CT underlining pref in captions markup 2020-03-07 07:28:37 +01:00
Scott Kostyshak
c6f4682b75 Fix Qt deprecation warn for QPixmapCache::find()
Fix the following warning from Qt 5.14.1:

  error: ‘static bool QPixmapCache::find(const QString&, QPixmap&)’ is deprecated: Use bool find(const QString &, QPixmap*) instead [-Werror=deprecated-declarations]
2020-03-06 22:46:18 -05:00
Scott Kostyshak
690c671b1d Fix Qt deprecation warn for QList::fromSet()
Fix the following warning from Qt 5.14.1:

  error: ‘static QList<T> QList<T>::fromSet(const QSet<T>&) [with T = QString]’ is deprecated: Use QList<T>(set.begin(), set.end()) instead. [-Werror=deprecated-declarations]

Regarding QList::fromSet(), the documentation now states the
following [1]:

  Since Qt 5.14, range constructors are available for Qt's generic
  container classes and should be used in place of this method.

[1] https://doc.qt.io/qt-5/qlist.html
2020-03-06 22:36:12 -05:00
Juergen Spitzmueller
5e21a8fbf7 Markup changed captions in workarea by underline and strikeout, resp. 2020-03-06 18:58:25 +01:00
Juergen Spitzmueller
f5a2d770b8 Footnote: (re-)add a fallback dummy counter 2020-03-06 18:21:18 +01:00
Juergen Spitzmueller
b8cac52759 Use real counter in deleted footnotes 2020-03-06 18:16:34 +01:00
Scott Kostyshak
1045020e05 Fix Qt deprecation warn for setConfirmOverwrite()
Fix the following warning:

  error: ‘void QFileDialog::setConfirmOverwrite(bool)’ is deprecated: Use setOption(DontConfirmOverwrite, !enabled) instead [-Werror=deprecated-declarations]

Note in the change that "false" changes to "true" because the option
is *Dont*ConfirmOverwrite.

QFileDialog::setConfirmOverwrite() is obsolete at least since 4.8
and QFileDialog::setOption() is available since 4.5 [1].

[1] https://doc.qt.io/archives/qt-4.8/qfiledialog-obsolete.html
[2] https://doc.qt.io/qt-5/qfiledialog.html#setOption
2020-03-06 09:56:01 -05:00
Scott Kostyshak
1c78b563ff Fix Qt deprecation warn for getContentsMargins()
Fixes the following warning:

  error: ‘void QWidget::getContentsMargins(int*, int*, int*, int*) const’ is deprecated: use contentsMargins() [-Werror=deprecated-declarations]

The new code also has advantages in that 'l' can be set to const and
it is more readable because it is clear that only 'l' is used.

QWidget::getContentsMargins() was deprecated in 5.14.0 [1]. and
QWidget::contentsMargins() is available since 4.6 [2].

[1] https://code.qt.io/cgit/qt/qtbase.git/tree/dist/changes-5.14.0/?h=v5.14.0
[2] https://doc.qt.io/archives/qt-4.8/qlayout.html#contentsMargins
2020-03-06 09:37:43 -05:00
Juergen Spitzmueller
339424ce00 Handle deleted BibTeX/Biblatex bibliographies
Since we cannot strike-out these, we output a placeholder when
show changes in output is active.

Fixes #11762
2020-03-06 13:49:10 +01:00
Juergen Spitzmueller
d94b708a0f Tell updateBuffer whether an inset is deleted.
Fixes #11747
2020-03-06 13:23:01 +01:00
Juergen Spitzmueller
e6105275af Consider change tracking in setBeginOfBody()
Fixes #11749
2020-03-06 11:49:32 +01:00
Juergen Spitzmueller
21567a260c Use range-based loop 2020-03-06 11:20:46 +01:00
Juergen Spitzmueller
228d738868 Account for changes in insets when checking changes in selection
This is not ideal, see FIXME.

Fixes #11774
2020-03-06 10:53:54 +01:00
Scott Kostyshak
b38a452efb Fix Qt deprecation warning for isItemSelected()
These methods are related to the deprecated setItemSelected() and
setItemHidden() methods that were converted at 24926b2e.
2020-03-05 20:38:31 -05:00
Scott Kostyshak
273af8803d Fix Qt deprecation warning for setItemHidden()
Consistent with commit 24926b2e.
2020-03-05 20:38:31 -05:00
Scott Kostyshak
27ca2bd950 Rename a var "sort" to not mask std::sort()
This allows us to use sort() without the "std" prefix.
2020-03-05 12:46:48 -05:00
Scott Kostyshak
14f369b47f Fix deprecation warnings from use of qSort()
This commit replaces qSort with std::sort to fix warnings from compiling with
Qt 5.14.1. Below is one of the warnings:

  error: ‘void qSort(RandomAccessIterator, RandomAccessIterator, LessThan) [with RandomAccessIterator = QList<lyx::ColorCode>::iterator; LessT$
  an = bool (*)(lyx::ColorCode, lyx::ColorCode)]’ is deprecated: Use std::sort [-Werror=deprecated-declarations]

qSort() has been deprecated since Qt 5.2. Quoting from the ChangeLog [1]:

  With STL no longer being optional for building and using Qt, a number of
  parts of QtAlgorithms no longer make sense, and have therefore been
  deprecated. Replacements are available in the STL, and generally have
  much better performance

There are some cases that require more than just a trivial substitution, but
our code does not appear to use any of those cases.

For some discussion on the differences in speed of std::sort() and
qSort(), see the following:

  https://phabricator.kde.org/D10857

These are just warnings now, but will likely be errors with Qt 6:

  https://bugreports.qt.io/browse/QTBUG-73048

I tested that LyX can still be built against Qt 4.8.7 with this commit.

This commit follows 24926b2e, which also fixes some deprecation warnings.

[1]
https://code.qt.io/cgit/qt/qtbase.git/tree/dist/changes-5.2.0/?h=v5.2.0
2020-03-05 12:44:39 -05:00
Scott Kostyshak
24926b2e23 Fix a few deprecation warnings in Qt 5.14.1
These changes fix a few instances of the following type of warning:

  error: ‘void QListWidget::setItemSelected(const QListWidgetItem*, bool)’ is deprecated: Use QListWidgetItem::setSelected() instead [-Werror=deprecated-declarations]

as well as similar warnings for setItemHidden() and
setItemExpanded(). These are just warnings now, but it is planned to
remove the methods for Qt 6:

  https://bugreports.qt.io/browse/QTBUG-73048

I tested that LyX can still be built against Qt 4.8.7 with this
commit. Indeed, these methods have been deprecated for a while (it
is just that QT_DEPRECATED_WARNINGS was only turned on by default
starting with 5.13.0). See, e.g.,

  https://doc.qt.io/archives/qt-4.7/qlistwidget-obsolete.html
2020-03-05 11:12:31 -05:00
Richard Kimberly Heck
e5b6be0712 Fix bug #10316.
By sending the request through the usual dispatch machinery, we
make sure the cursor is valid when we're done.
2020-03-03 23:17:09 -05:00
Richard Kimberly Heck
15659fed53 Andr'e points out this is wrong. Of course it is, since that is not a pointer. 2020-03-03 14:27:03 -05:00
Jean-Marc Lasgouttes
e99436b529 Do not display caret when we're not ready
Using a dialog may trigger a redraw at times where the metrics caches
have not been updated yet. To fix this, do as in paintEvent() and
abort caret blinking if there is an open undo group.

Move the decision to skip the caret painting to showCaret(), closer to
where real work happens. hideCaret () is now an alias for
showCaret(false), which allows some code refactoring.

See also commit c7496a11b2.

Fixes bug #11763 (although it does not trigger on master).
2020-03-03 12:30:27 +01:00
Richard Kimberly Heck
84e91772eb Fix nullptr warning 2020-03-03 00:08:46 -05:00
Richard Kimberly Heck
37c5cae58b Send a DispatchResult object with dispatch requests to the TOC.
This allows us to request a buffer update.
2020-03-03 00:08:06 -05:00
Richard Kimberly Heck
bd0bf2125c Fix nullptr warnings 2020-03-01 15:31:58 -05:00
Kornel Benko
9c4642fbcc Cmake tests: Amend f6f51587 2020-02-29 20:37:04 +01:00
Richard Kimberly Heck
4a81983edd Avoid a copy. 2020-02-29 05:55:20 -05:00
Richard Kimberly Heck
585823704a Fix warnings and use ranges. 2020-02-29 00:21:02 -05:00
Richard Kimberly Heck
9afc001fc5 Fix warnings 2020-02-29 00:21:00 -05:00
Richard Kimberly Heck
33d663720b Fix a bunch of warnings 2020-02-29 00:06:35 -05:00
Richard Kimberly Heck
99bf96c56b Fix warnings in support/. 2020-02-29 00:06:35 -05:00
Richard Kimberly Heck
4460df3292 Fix header. 2020-02-29 00:06:35 -05:00
Richard Kimberly Heck
56a5a8280e Null pointers. 2020-02-29 00:06:35 -05:00
Richard Kimberly Heck
8d26ae57ba Use ranges, fix warning 2020-02-28 01:55:05 -05:00
Richard Kimberly Heck
5baca8171f Use ranges, fix warning 2020-02-28 01:48:10 -05:00
Richard Kimberly Heck
969a1bab7d Use range 2020-02-28 01:44:48 -05:00
Richard Kimberly Heck
12d164393e Fix nullptr warnings 2020-02-28 01:42:32 -05:00
Richard Kimberly Heck
cf37ad8c80 Use ranges, fix warnings 2020-02-28 01:40:30 -05:00
Richard Kimberly Heck
084baebbf9 Fix nullptr warnings 2020-02-28 01:28:08 -05:00
Richard Kimberly Heck
3f9aa81452 Use ranges, fix warnings 2020-02-28 01:25:30 -05:00
Richard Kimberly Heck
94f64cd304 Fix warnings 2020-02-28 01:21:02 -05:00
Richard Kimberly Heck
5728625b65 Fix warnings 2020-02-28 01:16:21 -05:00
Richard Kimberly Heck
a9e663546b Use range 2020-02-28 01:16:10 -05:00
Richard Kimberly Heck
31c511d2ce Fix warnings 2020-02-28 01:09:45 -05:00
Richard Kimberly Heck
83779e7972 Use range and rename private variable 2020-02-28 01:08:28 -05:00
Richard Kimberly Heck
5b5b6998cb Use more ranges 2020-02-28 01:06:22 -05:00
Richard Kimberly Heck
7a66c93265 Use ranges 2020-02-28 00:52:38 -05:00
Richard Kimberly Heck
81597aabdb Polish 2020-02-28 00:39:50 -05:00
Richard Kimberly Heck
62af7ee772 More requires --> required, for C++2a. 2020-02-28 00:36:55 -05:00
Richard Kimberly Heck
21b4ecca7f Apparently, "requires" is a keyword in C++2a. 2020-02-28 00:28:18 -05:00
Richard Kimberly Heck
0dc9fca86e Remove code that has not been used since 2010.
See 208acbc72.
2020-02-28 00:21:48 -05:00
Richard Kimberly Heck
b750941910 Stop dialogs from updating twice all the time.
I've long wondered why dialogs seem to update twice when it seems
they just need to update once. It seems it was this code. But it
was only put there to deal with a problem with code in the button
controllers that was disabled in 2007! So I'm going to try removing
it. If we start seeing weird behavior with dialogs in master, then
this will be why.
2020-02-28 00:11:45 -05:00
Richard Kimberly Heck
f53243f81b Fix warnings 2020-02-28 00:10:23 -05:00
Richard Kimberly Heck
78ade7e6ec Remove code that has not been used for 13 years. 2020-02-28 00:08:30 -05:00
Richard Kimberly Heck
1948391a94 Fix warnings. 2020-02-28 00:07:53 -05:00
Richard Kimberly Heck
c483565522 Fix a bunch of warnings. 2020-02-27 23:58:01 -05:00
Richard Kimberly Heck
2165855d5e Revert unintended change 2020-02-27 14:36:46 -05:00
Richard Kimberly Heck
f4d5122a10 Fix null pointer warnings. 2020-02-27 00:05:41 -05:00
Richard Kimberly Heck
79bcf68018 Fix warning (and simplify) 2020-02-26 23:37:24 -05:00
Richard Kimberly Heck
64f7da961a Fix bug #11748.
Track the last chosen citation style when we clear the entries.
2020-02-26 23:00:09 -05:00
Richard Kimberly Heck
ca40d1f92a Fix a bunch of warnings 2020-02-26 22:29:40 -05:00
Richard Kimberly Heck
2e444dd657 Fix problem with validation when using InsetLayout. 2020-02-26 22:19:36 -05:00
Enrico Forestieri
f28334ac8b Cleaner fix to ensure 32-bit XCB events
This fix still satisfies Valgrind and is cleaner than the approach
at 19c41bd0: instead of using calloc we now use the C++11 specifier
alignas. For more info, see the following ML thread:
https://www.mail-archive.com/search?l=mid&q=20200219024908.5n4x4osni55gylo3%40tallinn
2020-02-25 12:37:51 +01:00