Commit Graph

5213 Commits

Author SHA1 Message Date
Juergen Spitzmueller
8b92a2a689 Add NeedMBoxProtect [inset]layout option
This accesses the inulemcmd output param which protects specific commands
(\cite, \ref) in an \mbox.

This is needed in ulem and soul commands, since their complex
detokenization makes such commands (who produce multiple words via local
assignment) fail.

So now it is possible to properly support ulem and soul via
[inset]layout

Fixes a case reported in #9404
2019-03-12 14:08:05 +01:00
Juergen Spitzmueller
c41df5b671 Warn if included file does not exist
Patch by Jürgen Womser-Schütz
2019-03-12 09:00:59 +01:00
Juergen Spitzmueller
3c83f01f1b More exceptions to percent encoding
See #11511
2019-03-10 16:37:31 +01:00
Juergen Spitzmueller
936cddc715 Do not percent-encode & in urls
This is query syntax

Fixes: #11511

follows up [c2db448ff5/lyxgit]
2019-03-10 13:23:36 +01:00
Juergen Spitzmueller
55c9bc218a Do not use GUI language for shortcut info inset if no translation is available
Fixes: #11508

Now there is the opposite case which needs to be addressed:
If no translation is available for a shortcut in a non-latin-scripted
document, we need to switch the language to English.
2019-03-09 12:00:40 +01:00
Kornel Benko
aaffcd0b39 FindAdv: Do not use data from included listing if in search mode
Fixes #11496 	"Find and replace (advanced)" is too slow
2019-02-27 10:17:56 +01:00
Jean-Marc Lasgouttes
2ae51b947b Rename TextMetrics::dimension() to dim() 2019-02-19 18:04:43 +01:00
Jean-Marc Lasgouttes
4c90183e4d Remove unused method 2019-02-18 16:03:38 +01:00
Jean-Marc Lasgouttes
c521e3e1de Initialize member
Spotted by coverity
2019-02-18 15:10:30 +01:00
Enrico Forestieri
26c692a0c8 Use braces for listings caption
Commit [3366c49f/lyxgit] intended to strip braces only for minted
but was actually stripping them also for listings. As the braces
are necessary for the listings package, reintroduce them.
This is a master-only issue.
2019-02-05 19:04:12 +01:00
Enrico Forestieri
6316b9b7ae Fix bug #11484
When splitting parameters at commas, take into account that
commas inside curly braces are not parameter separators.
2019-02-04 10:49:02 +01:00
Juergen Spitzmueller
c2db448ff5 ? and = must not be percent-encoded in hrefs
Fixes: #11482
2019-01-29 14:50:06 +01:00
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
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
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
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
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
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
5cfd256974 When checking inset activity status, also check containing insets
which could be deteled
2018-12-30 18:27: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
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
Kornel Benko
cd94180492 FindAdv: Simplify search for chars '&', '%', '#' and '_'
This is not possible for '$', because of the latex-meaning to
start/end math inset.
Therefore, if not ignoring format, we still have to use
[\\][\$] in regex in order to find '$' in text.
2018-12-05 13:36:43 +01:00
Guillaume MM
131f4b92ba Fix segfault after deleting monitor
The boost signal was sent synchronously, and so made the Qt signal to be posted
in FileMonitor::changed after the boost signal returned, so after the sender was
possibly destroyed.

The solution is to make the boost signal asynchronous using the Qt event loop.

Thanks to Scott Kostyshak for the report and MWE.
2018-12-04 00:05:01 -05:00
Enrico Forestieri
bd21aa99d2 Fix bug #11398
When deciding how to strike out deleted math in change-tracking
mode, differentiate only on begin-of-line or not, and not on
after-paragraph-break or not.

The assumption that a new paragraph is always started after a
float seems to be not true and was causing this bug.
2018-12-02 18:27:38 +01:00
Kornel Benko
de4ca7b742 FindAdv: Use plain text as value for \index{}
If we are in search mode, there is no need for
any special handling.
2018-11-29 11:57:11 +01:00
Juergen Spitzmueller
523d284729 missed this. 2018-11-09 11:47:51 +01:00
Juergen Spitzmueller
a5004a394a Fix thinko
Actually use the replaced path string :-/
2018-11-09 11:28:38 +01:00
Juergen Spitzmueller
4115d2487f Clear bibfile cache when set of bibliography files change
Part of #9158
2018-10-13 11:06:24 +02:00
Richard Kimberly Heck
17b7eab0cc Fix up e5fc7327. 2018-10-04 17:56:14 -04:00
Richard Kimberly Heck
e5fc7327e3 Extend fix for #7404 to allow any inset collapsible to be edited
externally.
2018-10-04 13:41:41 -04:00
Richard Kimberly Heck
92ccf0a1a2 Allow 'module in child not used in master' warning to be disabled. 2018-09-27 21:58:37 -04:00
Juergen Spitzmueller
a89e3c344b Add bibtex inset to outliner if "add to toc" is checked.
Fixes #11309
2018-09-25 15:24:46 +02:00
Juergen Spitzmueller
5e26a3a633 Implement layout format in insetinfo
The docs refer to the outdated layout formats. The inset prevents this.
2018-09-20 11:33:03 +02:00
Jean-Marc Lasgouttes
82516e356b Use std::move in InsetText::updateBuffer for notes and friends
Avoid as much as possible to do full copies of all counters, since
that can be expensive. Unfortunately, it is only posible when we want
to restore the saved counters.

An earlier version (05d3a649) defined swap() for Counter, but caused
problems on windows.

Part of bug #5973.
2018-09-18 23:18:17 +02:00
Jean-Marc Lasgouttes
f5f2f5b7ea Revert "Use swap in InsetText::updateBuffer for notes ad friends"
This reverts commit 05d3a64952.
2018-09-18 23:07:48 +02:00
Jean-Marc Lasgouttes
0920872ebd Revert "Try to please windows compiler"
This reverts commit a8b0e64094.
2018-09-18 23:06:36 +02:00
Jean-Marc Lasgouttes
ad29b0067f Revert "Use new display() values to remove some inset hardcoding."
This is a work in progress that committed by mistake.

This reverts commit b28ec44476.
2018-09-12 15:26:15 +02:00
Jean-Marc Lasgouttes
b28ec44476 Use new display() values to remove some inset hardcoding.
The enum is now made of flags that can be combined.

This introduces several new values for Inset::DisplayType:
BreakBefore, BreakAfter and Display=BreakBefore|BreakAfter. This
last value replaces AlignCenter.

Additionally the flags NoBoundary and CanBreakAfter are introduced for
future use.

Now a left aligned displayed inset will be defined as Display|LeftAlign.

A newline inset is characterized as BreakAfter.

This structure is used in breakRow to avoid explicit calls to
isNewline() or isEnvSeparator(). More improvements will be built on
top of this.

Additionally several redundant display() methods (which returned
Inline) have been removed.
2018-09-12 11:38:01 +02:00
Jean-Marc Lasgouttes
819cf53c22 Handle branches with space in their name
1/ Handle space in color name in set-color (with quoting)

2/ read properly branch inset when name has a space

Fixes bug #11108.
2018-09-08 13:07:07 +02:00
Richard Kimberly Heck
6014492699 Try yet again try to fix bug #9158.
The problem with the previous attempt was that, every time through
updateBuffer, we looked up the file location using kpsewhich, which
took too long on Windows. The new solution is to cache that info, and
to look it up only when we need it.

Previously, this info would have been re-read whenever we parsed the
bibfiles. So we re-read it now whenever the bibinfo cache is invalid,
which is less often, but should be good enough. We can add more such
re-reads if need be.
2018-09-02 11:50:03 -04:00
Richard Kimberly Heck
2bb8bd3ec4 Signal need for reload of bibinfo cache rather than doing it. 2018-09-02 00:16:45 -04:00
Richard Kimberly Heck
a3e87dad80 Revert "Try yet again try to fix bug #9158."
(Unintentionally committed.)

This reverts commit 7b29d4e7aa.
2018-09-02 00:09:19 -04:00
Richard Kimberly Heck
7b29d4e7aa Try yet again try to fix bug #9158.
The problem with the previous attempt was that, every time through
updateBuffer, we looked up the file location using kpsewhich, which
took too long on Windows. The new solution is to cache that info, and
to look it up only when we need it.

Previously, this info would have been re-read whenever we parsed the
bibfiles. So we re-read it now whenever the bibinfo cache is invalid,
which is less often, but should be good enough. We can add more such
re-reads if need be.
2018-09-01 23:13:00 -04:00
Juergen Spitzmueller
bc644d131c Fix potential null pointer detected by Coverity 2018-09-01 10:45:03 +02:00
Juergen Spitzmueller
5279f3e11f Fix uninitialized value revealed by Coverity 2018-09-01 10:41:29 +02:00
Juergen Spitzmueller
b0f579655c InsetInfo: Move validateArgument() to params
and use it for LFUN_INFO_INSERT validation
2018-08-18 14:29:15 +02:00
Juergen Spitzmueller
6d71b9b69a Fix line break in tooltip
Fixes: #11252
2018-08-17 10:32:57 +02:00
Juergen Spitzmueller
b124adbd38 Introduce listpreamble argument type
This uses the InsetArgument interface to provide access to a document
part hitherto inaccessible by LyX: the part between \begin and the first
\item in a list (where lengths and counters can be redefined, for
instance).

Fixes: #11098

File format change, layout format change
2018-08-17 10:22:32 +02:00
Juergen Spitzmueller
e9b187af08 New info-inset type l7n
This returns a localized version of a string (in the GUI language)
if available, removing trailing colons and accelerator marks.

This can be used to refer to dialog items in the docs in a portable way.
2018-08-13 17:18:44 +02:00
Juergen Spitzmueller
d6a93143ec InsetInfo: enable inset dissolve 2018-08-11 17:43:25 +02:00
Juergen Spitzmueller
806f742263 Amend 5f45b3ed9c 2018-08-09 17:23:05 +02:00
Juergen Spitzmueller
5f45b3ed9c Fix shortcuts info output on the Mac
QKeySequence returns special characters for keys on the mac rather than
textual key names (as on other OSes).

Since these symbols are not included in many fonts, we re-translate them
to textual names

Fixes: #10641
2018-08-09 16:59:06 +02:00
Juergen Spitzmueller
b8ed202658 Consider default output format 2018-08-08 15:50:04 +02:00
Juergen Spitzmueller
91a5263d68 Extend list of accessible menu info
When searching for and item in the menu, also try to consider those that
require a BufferView (such as View/Update formats).

Also, be explicit for the default format in order to find it.

Fixes: #9851
2018-08-08 15:05:58 +02:00
Juergen Spitzmueller
dd3ae00f74 Disambiguate time (period) from time (of day). 2018-08-07 15:24:40 +02:00
Juergen Spitzmueller
c6d8efba6c Add user name and email to Insert > Fields
This is a low hanging fruit, since it's already available (although
quite hidden)

Generally, output "not set" i a pref is not set rather than an empty
string.
2018-08-07 14:57:44 +02:00
Juergen Spitzmueller
2cd7aab7cf Validate (fix) date vs. time specifier 2018-08-07 12:56:43 +02:00
Juergen Spitzmueller
7efdf98fc8 Further extend Info insets:
* Add time type (time, modtime, fixtime)
* Add "name-noext" buffer type (file name w/o extension)
2018-08-07 12:14:45 +02:00
Juergen Spitzmueller
307319e95e Introduce InsetInfoParams
This allows to open the dialog without having an inset already.
2018-08-06 20:07:15 +02:00
Juergen Spitzmueller
e730234e57 Add date-related info insets
With this commit, info insets leave the dark backstage room of an opaque
and quite hidden dev-only feature and come frontstage.

In the UI, they present themselves as "Fields" since this is what people
know from word processors. Other user-related fields that could be
implemented next: time, user name (I plan to do that for 2.4).

Since this supersedes date-insert, I removed Insert > Date from
the menu and propose to ditch date-insert and the corresponding rc.

The lyx2lyx reversion routine has lots of room for improvement and
attractive tasks for pythons (file timestamp, switch of localization).
Please feel invited!

This is a file format change.
2018-08-05 10:01:36 +02:00
Juergen Spitzmueller
87a7f728ca reorder entries 2018-08-01 16:51:38 +02:00
Juergen Spitzmueller
abaccece15 InsetInfo: use localized shortcuts 2018-08-01 15:17:46 +02:00
Juergen Spitzmueller
8d45179403 More GuiInfo usability work 2018-08-01 09:28:03 +02:00
Juergen Spitzmueller
a76c69dea8 Typo.
Thanks, Kornel.
2018-07-30 17:02:28 +02:00
Juergen Spitzmueller
358436ea1e Split vcs Info inset from buffer Info inset
This should go separately in the GUI, and thus in the inset.
2018-07-29 19:41:34 +02:00
Juergen Spitzmueller
5075ce0297 InsetInfo: add useful shortcuts. 2018-07-29 18:28:18 +02:00
Juergen Spitzmueller
a8b0e64094 Try to please windows compiler 2018-07-28 10:26:52 +02:00
Juergen Spitzmueller
803a88f243 Sort out problems with InsetInfo language settings
* use the context language of the info inset (rather than the buffer
language), and translate strings accordingly

* for menu and shortcuts, use the Gui language instead

* actually care that all translatable strings end in po
(this wasn't the case).

Fixes: #5348, rest of #10463
2018-07-27 12:14:37 +02:00
Jean-Marc Lasgouttes
ab2b5e02f9 Revert "Make formal table lines exagerately thick to identify \cmidrule"
This not the correct solution. Let's see if we find a better one.

This reverts commit d900b1fcec.
2018-07-25 17:40:42 +02:00
Juergen Spitzmueller
d1ec35a0dc Amend 79cf3f5ec1
Some InfoInsets have to be LTR always.
2018-07-25 11:38:56 +02:00
Juergen Spitzmueller
79cf3f5ec1 Fix text direction issue for InsetInfo in RTL context
Fixes: #10463
2018-07-25 11:00:00 +02:00
Juergen Spitzmueller
1883c4346d Revert "Fix toggle-line for multi-cell selection"
This changes the behavior of the table border toolbar in a way I am not sure everybody appreciates.

This reverts commit 022228e56f.
2018-07-24 08:48:33 +02:00
Jean-Marc Lasgouttes
d900b1fcec Make formal table lines exagerately thick to identify \cmidrule
Width is now 3 for top/bottomrule, 2 for midrule and 1 for cmidrule.
These numbers are bogus of course, but the goal is to help the user
see what he is doing.
2018-07-24 00:07:59 +02:00
Jean-Marc Lasgouttes
ad954a32a5 Aesthetics: off-by-one in line drawing
It is a general problem when doing graphics to know where a line
begins and where it ends pixel-wise. At the instigation of Scott, and
with the use of the kmag magnifier, this commit corrects 3 areas:

* foreign marks were larger than the row element they were supposed to
  mark. This could lead to moving lines, depending on paint ordering.

* visible spaces were drawn outside of their box (select a single
  space to see this).

* the `L' blinking caret would leave a cursor dropping because the
  horizontal part was too wide.
2018-07-23 17:16:03 +02:00
Juergen Spitzmueller
022228e56f Fix toggle-line for multi-cell selection 2018-07-23 17:00:31 +02:00
Juergen Spitzmueller
91254472e6 Allow to change multiple columns' width at once
Fixes: #11205
2018-07-23 16:36:19 +02:00
Enrico Forestieri
16ca5290c0 Fix bug #11203
Minted does not have a language option but it is possible to enter
this option in the LyX interface for compatibility with the listings
package, and also for letting to enter a language not present in the
gui. So, this option is only used for properly specifying a language
in a listing, unless it is entered in the document settings dialog.
This case was not foreseen and thus the option was being passed to
the package as is, causing havoc. With this commit the option is
still available but is used to set a default language for a new
listing in place of the default "tex" language used so far.
2018-07-22 22:22:13 +02:00
Juergen Spitzmueller
8ef7d1aaec Amend d41c3f27d9
Quote insets are allowed in ERT.
2018-07-22 20:04:19 +02:00
Jean-Marc Lasgouttes
05d3a64952 Use swap in InsetText::updateBuffer for notes ad friends
Avoid as much as possible to do full copies of all counters, since
that can be exensive. Unfortunately, it is just posible when we want
to restore the saved counters.

Explanations why we use friend swap is here:
https://stackoverflow.com/questions/5695548/public-friend-swap-member-function

Part of bug #5973.
2018-07-22 12:35:05 +02:00
Jean-Marc Lasgouttes
84328c8538 Amend 8651cd89: only full top/bottom rules are thicker 2018-07-21 20:07:33 +02:00
Juergen Spitzmueller
0bf7b3211d (a)mend edb2d14124 2018-07-21 18:33:49 +02:00
Juergen Spitzmueller
edb2d14124 Set RTL tooltips RTL
Fixes: #10672
2018-07-21 18:23:47 +02:00
Jean-Marc Lasgouttes
8651cd89f6 Draw top/bottom rules heavier for booktab
This gives a better idea of the TeX output, even though the width are
not correct.
2018-07-20 00:26:41 +02:00
Jean-Marc Lasgouttes
76512a7569 Use a unicode character for menu separator on screen
Additionally, use a left pointing character in a RtL setting.
2018-07-19 23:05:00 +02:00
Jean-Marc Lasgouttes
9b3fede789 Introduce FontMetrics::xHeight
Use it instead of measuring the height of character 'x'.
2018-07-19 22:16:40 +02:00
Juergen Spitzmueller
e5a9244bef Proper logos with RTL
Fixes #10423
2018-07-15 20:56:55 +02:00
Juergen Spitzmueller
aa1d9638fe Fix quotation marks in RTL script
Fixes: #11188
2018-07-15 12:11:10 +02:00
Juergen Spitzmueller
d41c3f27d9 Disallow any inset inside ERT
Attempting to do this crashes in master, and is not supported anyway.
2018-07-10 07:11:59 +02:00
Juergen Spitzmueller
e6e3777363 Add support for bib files encoding
File format change.

Fixes: #6223
2018-07-07 15:25:35 +02:00
Juergen Spitzmueller
1cfa56b5cb Correctly calculate cell metrics with xtabular columns
Fixes rest of #11182
2018-07-07 09:18:47 +02:00
Juergen Spitzmueller
fa9675965a Do not expand tabular cells to maxwidth on line break
Fixes part of #11182.
2018-07-06 16:15:13 +02:00
Juergen Spitzmueller
25f274f2a0 Amend e5c79a43ee
Consider some tabularx specifics for the display of tabular/column widths
in the workarea.
2018-07-02 19:16:22 +02:00
Juergen Spitzmueller
e5c79a43ee Attempt to reflect tabular width in workarea
This is not perfect, since variable width columns will break at a certain
treshold, but it is better than what we have now (no tabular width
indication at all)
2018-07-02 17:05:46 +02:00
Juergen Spitzmueller
9dcb24d578 Support varwidth's V tabular column type
This effectively enables linebreaks, multipars and layout changes in
non-fixed width (i.e., standard) table columns.

Fixes: #6577

TODO: metrics are wrong (too wide) on screen with linebreaks.
2018-07-01 19:18:38 +02:00
Juergen Spitzmueller
88e5e5fd34 Wrap rotated cells with linebreaks in varwidth
Fixes: #8085
2018-06-30 14:32:27 +02:00
Juergen Spitzmueller
21005cbd6f Fix definition of boolean 2018-06-25 12:01:26 +02:00
Juergen Spitzmueller
8db5ff18cf With xltabular, multi-page tables can have a fixed width 2018-06-25 10:53:40 +02:00
Enrico Forestieri
380f34a114 Fix bug #11180
When a raster image with an advertised pixel density different
from 72 dpi is included in a latex file, the output image dimensions
are scaled by the ratio 72/pixel_density. Hence, if a clipping
bounding box is specified, it has to be scaled by the same ratio,
otherwise the images will be clipped differently on screen and output.
Here we use the extractbb command (present in any TeX distribution)
to ask about the output dimensions of the image as dictated by the
pixel density and compute the scaling ratio by the knowledge of the
actual dimensions. If, for whatever reason, extractbb is not found,
everything goes as before, because the clipping bounding box will
simply not be corrected.
2018-06-24 20:06:40 +02:00