Commit Graph

25541 Commits

Author SHA1 Message Date
Juergen Spitzmueller
a936bc2df5 Do not check for duplicates when pasting a label into a non-outputting inset.
Issue mentioned at #10333
2019-01-25 14:40:30 +01:00
Günter Milde
5ebc0b3f43 Fix second part of #5386.
A \clearpage command issued right before \end{CJK} is recommended by the
package author to prevent any un-processed CJK chars outside the
\begin{CJK} and \end{CJK} scope. Otherwise, TOC, header, footer,
and may contain CJK chars but get processed outside the CJK environment scope.

Tha new dedicated export test fails without the fix.
2019-01-24 14:40:19 +01:00
Günter Milde
197735747e Support for documents in other scripts with parts in CJK scripts.
Fix CJK support for documents using input-encoding "utf8-cjk"
when the main language is not Chinese, Korean, or Japanese.
2019-01-24 00:40:51 +01:00
Richard Kimberly Heck
7f8cfde2e7 Add spaces. Thanks, Kornel. 2019-01-19 22:05:47 -05:00
Richard Kimberly Heck
b804e8851c Rename emergency file when it is kept.
Otherwise, we will ask about it again next time, when the file
may have changed. Also, if we crash again, we'll over-write that
file, which we may not want to do.

See bug #11464.
2019-01-17 23:00:23 -05:00
Jean-Marc Lasgouttes
66a3d64346 Try to compute row height like it should be done
Currently, our computation of row height is not completely standard:
* we ignore completely the QFontMetrics::leading() parameter

* we add arbitrarily 2 hardcoded pixels to the height.

This patch reverses these two choices, which leads to
* slightly larger spacing for MinionPro (which has a big leading).

* an additional spacing of 20% font height that depends on dpi and zoom.

Visual inspection with LibreOffice seems to imply that it disregards
the font leading but uses a interline which is 20% larger than the
font height.
2019-01-16 11:04:53 +01:00
Jean-Marc Lasgouttes
7848d3c90c Allow to type a space in front of another one
This is a follow-up to 714b731e. This fixes the issue when the cursor
is in front of a space
  abc| def
and one inserts another space (to start a word). DEPM would eat one
space and produce
  abc |def
instead of
  abc | def

Additionally, fix the same_par boolean, wheich did not take the cell
index into account.

Related to ticket #11412.
2019-01-14 16:41:12 +01:00
Juergen Spitzmueller
cd6229ee5c Fix copy-paste error 2019-01-13 11:38:28 +01:00
Juergen Spitzmueller
143703f927 Amend 7b639d2db2
Not the (ASCII) encoding matters here, but the (TU) font encoding.
2019-01-13 11:25:17 +01:00
Juergen Spitzmueller
7b639d2db2 Script wrapper is needed with ASCII encoding 2019-01-12 18:45:41 +01:00
Enrico Forestieri
ad0c9a548b Remove PYTHONPATH from the environment on Windows
This make sure to use the the modules distributed with LyX,
avoiding reconfigure failures.
2019-01-12 18:37:41 +01:00
Enrico Forestieri
472bdf5910 Replace environment variables in PATH prefix
The PATH prefix modified through the GUI was set without
replacing embedded environment variables. This might have
caused problems on Windows with external python installations.
2019-01-11 18:15:40 +01:00
Juergen Spitzmueller
ead498f0a6 Add support for U+2693 (ANCHOR)
Fixes: #10706
2019-01-11 16:42:08 +01:00
Jean-Marc Lasgouttes
edb46d2a94 Fix alignment of rows when text width is variable
When several lines of text are in the same variable-width tabular
cell, it is not possible to align properly the rows until the cell
width is known.

Therefore a parameter is added to redoParagraph to skip this
computation, so that it can be done later in TextMetrics::metrics.
Other calls to redoParagraph in the code are not affected. It is not
clear at this point whether they may create artefacts.

computeRowMetrics has been renamed to setRowAlignment to better
reflect its use.

Fixes bug #11447.
2019-01-11 16:23:05 +01:00
Juergen Spitzmueller
f6a77d5d82 "Script chars" also need to be output as macro with full utf8 engines and TeX fonts
Fixes rest of #9681
2019-01-11 10:08:49 +01:00
Richard Kimberly Heck
6848dbfd2b Remove empty file discovered by Kornel.
Looks like an accidental commit.

> git log GuiGraphicsUi.h
commit a1cec91afa
Author: André Pönitz <poenitz@gmx.net>
Date:   Fri Aug 31 05:53:55 2007 +0000

    move our stuff off the Q* namespace

    git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19935 a592a061-630c-0410-9148-cb99ea01b6c8

That's all a rename, basically. The original file, QGraphicsUi.h, was commited at 12e5a52b92, and it was empty then, too.
2019-01-10 13:23:33 -05:00
Günter Milde
41055bab88 Fix handling of Thai tis620-0 input encoding.
The Thai tis620-0 input encoding is supported via the inputenc "plug in"
(data) file tis620.def from https://ctan.org/pkg/babel-thai.

We can handle it like the other contributed input encodings, e.g.,
Greek (ISO 8859-7) and the several Cyrillic encodings from
http://www.ctan.org/pkg/latex-cyrillic.

Under TeXLive 2018, the input encoding defaults to utf8, if there is no call to
inputenc. The added test file fails without the patch but compiles fine, if the
file "tis620.def" is present in the TEXPATH.
2019-01-09 09:23:16 +01:00
Juergen Spitzmueller
9982651fd6 CJKutf8 is only to be used with the dedicated utf8-cjk encoding 2019-01-09 08:29:41 +01:00
Juergen Spitzmueller
52371c969b Improve readability
No functional change.
2019-01-07 17:02:06 +01:00
Jean-Marc Lasgouttes
4bc8e90c25 use range-based for loops 2019-01-07 15:33:45 +01:00
Juergen Spitzmueller
9d20bc4e98 When using polyglossia (bidi), paragraph directions don't need to be swapped
Bidi does that.

Fixes: #11399
2019-01-07 13:54:23 +01:00
Richard Kimberly Heck
d6b4db1a4f Remove now unused routine. 2019-01-06 17:50:14 -05:00
Richard Kimberly Heck
c4fdab6993 Use combo box data rather than looking up info from InsetRef. 2019-01-06 17:46:40 -05:00
Richard Kimberly Heck
b35d90014e Add comment. 2019-01-06 13:02:40 -05:00
Richard Kimberly Heck
b91e2b9998 Remove debugging code. 2019-01-06 13:00:21 -05:00
Richard Kimberly Heck
9b3f9cc687 Fix problem caused by re-ordering of menu at 5f6332bf4.
This broke the activation and de-activation of plural, capitalize,
etc. I guess that tells us how much those get used....
2019-01-06 12:52:44 -05:00
Juergen Spitzmueller
c9dd349bee Don't output CJK environment with non-TeX fonts
This amends d193cd05a8.
2019-01-06 16:40:36 +01:00
Juergen Spitzmueller
d193cd05a8 Properly implement CJKutf8
If we use that, the document actually needs to be in utf8 encoding, and
the CJK environment needs to account for it.

Candidate for stable.
2019-01-06 14:36:11 +01:00
Enrico Forestieri
7296e0e6ba Avoid crash with gzipped file
In computing the length of the extension, the code does not account
for the prefix "unzipped_", which is added when the zipped filename
does not have one of the extensions "gz", "z", "Z", or "svgz", and
thus the used index is out of bounds. See also this thread:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg207360.html
2019-01-05 19:17:37 +01:00
Jean-Marc Lasgouttes
5fc035f99c Fixup 5c1d65af: proper spacing between text and label in rtl
Fix bug #11425.
2019-01-04 17:13:10 +01:00
Jean-Marc Lasgouttes
5c1d65afee Fix drawing of labels in insets
In many cases, the origin xo_ of insets was forgotten.

Fixes bug #11425.
2019-01-04 17:06:49 +01:00
Jean-Marc Lasgouttes
a69e01d0b4 Avoid crash when using inset-select-all in tabular
When changing cell idx, it is important to set the pit to a reasonable
value.
2019-01-04 13:57:13 +01:00
Jean-Marc Lasgouttes
f97c11f4e9 Remove unused mathod (CursorSlice::at_cell_end is the same) 2019-01-04 13:55:57 +01:00
Juergen Spitzmueller
35534231d4 Always update bibfiles cache with bibliography environment before opening citation dialog
We need to do this unconditionally, since there is no (trivial and non-
awkward) way to update it when the bibliography paragraphs are modified.

Fixes: #4899
2019-01-04 13:01:03 +01:00
Richard Kimberly Heck
ba8cf1a50b Also pay attention to OutputParams::free_spacing. 2019-01-03 19:16:48 -05:00
Richard Kimberly Heck
6135824f40 Fix bug #11432.
Take account of Layout::free_spacing.
2019-01-03 19:13:43 -05:00
Jean-Marc Lasgouttes
d8498d4785 Fix vertical offset of fonts like MinionPro
For some reason, adding a LTR/RTL Override unicode character before a
MinionPro string increases the ascent of the line.

This creates vertical offset issues when painting if the ascent used
as reference is the one of the font. Use the QTextLine ascent instead
for better results.

This is a followup to 1bed76e2a.

Fixes (reopened) ticket #11284.
2019-01-03 12:19:47 +01:00
Juergen Spitzmueller
62f8b8beb9 Update tex2lyx tests 2019-01-03 12:00:23 +01:00
Jean-Marc Lasgouttes
c8f4b68423 Add override statements to please clang
Eventually, all overridden virtual methods should be marked properly.
Currently, clang only warns about those in classes that already use
override in at least one place (which was the case dor GuiApplication).
2019-01-02 18:49:23 +01:00
Jean-Marc Lasgouttes
fba9f5b9e8 Remove premature (and bad) optimization
When blinking the caret, it looks like a cool idea to only update the
small rectangle containing the caret. Actually it is an awful idea, since
the paint event will paint some rows, and these rows will not be
properly painted outside of the small rectangle. Unfortunately, the
painter will skip those "painted" rows on next paint events.

This leads to painting errors that depend on the ordering of "real"
and "caret" paint events. This is the reason why they only appeared
with split screens.

Quote of the day: ``The real problem is that programmers have spent far
too much time worrying about efficiency in the wrong places and at the
wrong times; premature optimization is the root of all evil (or at
least most of it) in programming.''
-- Donald Knuth, The Art of Computer Programming.

Fixes bug #11354.
2019-01-02 18:36:02 +01:00
Enrico Forestieri
9755371729 Fix conversion of math braces to html 2019-01-02 09:49:59 +01:00
Juergen Spitzmueller
8f332f4429 Fix Include dialog UI
#11443
2019-01-02 09:19:45 +01:00
Enrico Forestieri
b3cba2a09c Amend [2dcb7300/lyxgit]
Avoid a crash by checking that a cell is not empty before
accessing its content.
2019-01-02 09:08:39 +01:00
Juergen Spitzmueller
1db5abbfbd Mark labels in non-outputting insets as inactive.
Fixes: #11437
2018-12-31 18:32:38 +01:00
Juergen Spitzmueller
e61c60fae8 Add inactive labels to the toc
It makes sense to navigate to them.

They are marked as inactive with the cross.
2018-12-31 18:30:20 +01:00
Juergen Spitzmueller
54366c38ef Fix gotoLabel with inactive labels
This now frist looks for the active label. Only if none is found, it
jumps to the (first) inactive label.
2018-12-31 18:28:44 +01:00
Juergen Spitzmueller
5afacb144d Separate LabelCache from RefCache
We only assign references to label _string_. Which inset this corresponds
to will be decided in context.
2018-12-31 18:27:34 +01:00
Juergen Spitzmueller
48c6d5de21 typo 2018-12-31 14:19:06 +01:00
Juergen Spitzmueller
5cfd256974 When checking inset activity status, also check containing insets
which could be deteled
2018-12-30 18:27:28 +01:00
Juergen Spitzmueller
e8c1cb5074 Expand comment 2018-12-30 13:24:51 +01:00
José Matos
8663a371f3 Merge branch 'master' of git.lyx.org:lyx 2018-12-29 19:24:59 +00:00
José Matos
3f03f0a447 Move all python shebangs from /usr/bin/env to python3.
The change is only relevant to development as all the call to python scripts is done
calling C++ os::python that invoques the appropriate python version.

The change is two fold, on one hand remove all the uses of /usr/bin/env for python.

On the other hand rename all the calls to python from python to python3 making it explicit
and being compliant with PEP 394 -- The "python" Command on Unix-Like Systems:
https://www.python.org/dev/peps/pep-0394/

Remove the sheebang from src/graphics/GraphicsConverter.cpp because it is not necessary.

Some small whitespace changes.
2018-12-29 19:14:41 +00:00
Enrico Forestieri
69726b832b Fix bug #4269
Call gunzip with quoted filenames as they may contain spaces or
other special characters.
2018-12-29 20:11:56 +01:00
Juergen Spitzmueller
c457ea90e7 micro amendments 2018-12-29 17:53:21 +01:00
Pavel Sanda
33284ee5c8 Completion popup menu did not respond to Esc.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg207346.html
2018-12-29 14:36:38 +01:00
Juergen Spitzmueller
da273a944f Fix some parsing glitches in Autonest and IsAutonestedBy
Layouts can have spaces, underlines (that must be read as spaces, and
be enquoted)

Candidate for stable
2018-12-29 13:36:39 +01:00
Juergen Spitzmueller
59d73f52b8 Do not auto-insert separator for keepempty layouts
Candidate for stable
2018-12-29 13:35:39 +01:00
Juergen Spitzmueller
a67c541d6b Fixup LocalLayout ui after [3847e0ef/lyxgit] 2018-12-29 11:47:37 +01:00
Juergen Spitzmueller
a550a613e8 Some minor amendments to [3ae6bff538/lyxgit] 2018-12-29 10:26:28 +01:00
Juergen Spitzmueller
3ae6bff538 Do not consider deleted labels in ambiguity check
This adds a new (boolean) parameter "active" to the label cache, where
we track whether a label is deleted in ct mode (the same could be done,
if wanted, for labels in notes and inactive branches).

Deleted (inactive) labels are neither considered in the uniqueness check
nor added to the outliner. This also means that undeleted references to
deleted labels are now (correctly) marked as BROKEN.

Fixes: #6563
2018-12-29 10:08:02 +01:00
Richard Kimberly Heck
ac3693c04f Fix bug #11422.
We need to load the master document before applying the params, since
otherwise the TOC reset (and other things) happen before the master
has been loaded (and set as parent).
2018-12-29 00:23:26 -05:00
Juergen Spitzmueller
254affa0b9 Fix regression introduced in a65f1e54dc 2018-12-28 17:25:53 +01:00
Scott Kostyshak
c5301a6495 Fix assertion when checking if change in selection
The check for the iterator being in the same paragraph as the end of
selection was incorrect, because paragraphs in different cells could
have the same pit. We now additionally condition on having the same
idx.

This commit amends d1279875 (and thus 23de5e5e).

For discussion, see:

  https://www.mail-archive.com/search?l=mid&q=a5afd0c01a0eb9a84fd4d050d15eb23016d6f38a.camel%40lyx.org

Thanks to Jürgen.
2018-12-28 10:46:30 -05:00
Juergen Spitzmueller
a65f1e54dc Properly set up paste and textstyle-apply MenuButtons when no buffer is open. 2018-12-28 14:34:14 +01:00
Juergen Spitzmueller
4d010d97fa style 2018-12-28 12:44:55 +01:00
Juergen Spitzmueller
d50e02d07c Always set main Icon Button to the QMenuButton 2018-12-28 12:41:19 +01:00
Juergen Spitzmueller
cb84f752f2 Add tabular-features set-inner-lines and fix set-all-lines behavior
Patch by Daniel Ramöller (racoon)

Fixes: #11382
2018-12-28 10:11:42 +01:00
Juergen Spitzmueller
2f9876a410 LFUN_TEXTSTYLE_UPDATE: Do not force any unspecified settings.
Fixes: #11111 (yay!)
2018-12-27 15:30:57 +01:00
Juergen Spitzmueller
e704cc6e82 Add "Reset to Default" item to textstyle-apply button menu
Fixes: #5922.
2018-12-27 14:16:38 +01:00
Juergen Spitzmueller
2d876f8d9d Disable LFUN_FONT_DEFAULT if there's noting to reset. 2018-12-27 14:16:00 +01:00
Juergen Spitzmueller
c57d04908f No need for an extra icon 2018-12-27 11:18:13 +01:00
Juergen Spitzmueller
eb1b88aba7 Use more convenient MenuButtonPopup 2018-12-27 11:09:52 +01:00
Juergen Spitzmueller
01872b4dd5 Remove unused variable 2018-12-27 08:51:17 +01:00
Kornel Benko
9ee515c984 Amend 154b4fde 2018-12-26 17:45:34 +01:00
Juergen Spitzmueller
9495ff665d Make "paste recent" accessible from toolbar
via button menu
2018-12-26 17:11:24 +01:00
Juergen Spitzmueller
154b4fdece Give textstyle-apply a history
The last 20 applications are saved now and accessible both via the lfun
(textstyle-apply n) and the toolbar (via button menu)

Fixes: #7133

This also changes the default icon and toolbar position of the action,
as requested in #11427
2018-12-26 15:46:14 +01:00
Juergen Spitzmueller
057d83d8ae Handle null pointer 2018-12-26 14:38:02 +01:00
Juergen Spitzmueller
0492239be0 Fix qt4 build 2018-12-25 18:35:52 +01:00
Juergen Spitzmueller
7610179bc7 More alignment fixes 2018-12-25 18:20:02 +01:00
Juergen Spitzmueller
47ecd75d7f Unify group box style across dialogs. 2018-12-25 17:02:18 +01:00
Juergen Spitzmueller
7674a83ce9 Prefs dialog: some layout fixes. 2018-12-24 18:38:23 +01:00
Juergen Spitzmueller
e52bd7bb00 Advanced F&R layout fixed
Patch by Daniel Ramöller (racoon)
2018-12-24 17:02:11 +01:00
Juergen Spitzmueller
5258cee93e Fix height of paragraph dialog
Patch by Daniel Ramöller (racoon)
2018-12-24 16:48:22 +01:00
Juergen Spitzmueller
fa5703196f Fix Text Properties dialog height
Patch by Daniel Ramöller (racoon)
2018-12-24 16:18:54 +01:00
Juergen Spitzmueller
9ee4a914da Tabular Create layout fixes
Patch by Daniel Ramöller (racoon)
2018-12-24 16:13:29 +01:00
Juergen Spitzmueller
499871d141 Messages panes layout fixes
Patch by Daniel Ramöller (racoon)
2018-12-24 16:08:39 +01:00
Juergen Spitzmueller
30d527895e Layout fixes for compare dialog
Based on a patch by racoon.
2018-12-24 16:00:43 +01:00
Juergen Spitzmueller
4c7b3fc109 Theasurus dialog layout fixes
Patch by Daniel Ramöller (racoon)
2018-12-24 15:24:03 +01:00
Juergen Spitzmueller
5936edfe24 Spellchecker dialog alignment fixes
Patch by Daniel Ramöller (racoon)
2018-12-24 15:16:28 +01:00
Juergen Spitzmueller
d2527038a3 Polishment of the simple Search dialog
Based on a patch by racoon.
2018-12-24 14:47:48 +01:00
Juergen Spitzmueller
4d51206585 When cancelling saving of a children, cancel the whole process.
Fixes remainder of #11405
2018-12-24 13:02:41 +01:00
Juergen Spitzmueller
4f67cf2344 Fix prefs color layout
the list widget is too narrow with some localizations.
2018-12-23 12:08:54 +01:00
Juergen Spitzmueller
81e4f8dfb6 Allow to restore default UI colors in prefs
Patch by Daniel Ramöller (racoon), with slight modifications of mine.

Fixes: #10062
2018-12-22 18:44:58 +01:00
Jean-Marc Lasgouttes
dff0c5729e Make DEPM respect current cursor position.
Spaces are now conserved when they surround current cursor. Examples:
  abc   |   def
becomes
  abc | def
after DEPM and
  abc |
is kept as it is.

Fixes ticket #11412.
2018-12-21 15:40:03 +01:00
Juergen Spitzmueller
7c31bfa423 Compile fix for Qt < 5.7
Only after that version, the QAction argument is optional.
2018-12-21 13:37:07 +01:00
Juergen Spitzmueller
4ea64ca89a GuiThesaurus: maintain default state of Replace button
Rest of #11417
2018-12-21 12:56:02 +01:00
Juergen Spitzmueller
ac8aac5b36 GuiCharacter: Add menu to Restore button
and allow for resetting all widgets to "No Change" besides "Default"
2018-12-21 12:31:25 +01:00
Juergen Spitzmueller
e6b562d027 Rename ambiguous enum 2018-12-21 12:14:11 +01:00
Juergen Spitzmueller
7fae26c9a7 Handle GuiParagraph for OK default button issue as well 2018-12-20 15:12:53 +01:00
Juergen Spitzmueller
44a0748ba3 Add forgotten initialization 2018-12-20 13:46:41 +01:00