Commit Graph

24036 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
e8b744ad2e Fix broken logic
Spotted by coverity.
2017-03-01 16:36:46 +01:00
Jean-Marc Lasgouttes
f52325f051 Initialize pointer class member
Found by coverity.
2017-03-01 16:34:01 +01:00
Jean-Marc Lasgouttes
9251a360a9 Initialize class member to please coverity 2017-03-01 16:31:00 +01:00
Jean-Marc Lasgouttes
af45bfaee1 Initialize class members to please coverity 2017-03-01 16:28:30 +01:00
Jean-Marc Lasgouttes
ea8f0d2076 Initialize properly a class member
This was forgotten at 0552563c99, and it only meant to keep coverity happy.
2017-03-01 16:21:45 +01:00
Enrico Forestieri
17ab47b3e6 Allow Input of local includes from local layout files
When including files, LyX always searches the user and the system
directory, in that order. This means that when using local layout
files broken down into multiple includes, the various includes should
be specified with a path relative to the user layouts directory
(typically ~/.lyx/layouts), making this very impractical.
This commit allows including local files by specifying their path
as explicitly relative to the main layout file position, i.e., by
specifying their path with either "./" or "../". If the main layout
is not loaded from a local file, the usual search order is used,
even if the path are explicitly relative. So, for system layouts,
both "Input ./name.inc" and "Input name.inc" are equivalent.
2017-03-01 09:19:18 +01:00
Guillaume Munch
a1faa41c83 buffer-export without argument exports the default format
buffer-export is proposed as a default binding in the preferences so now it does
what a user expects when binding it to a key.
2017-02-28 00:46:33 +01:00
Guillaume Munch
887722dbfa Remove LyXToolBox
It extended QToolBox with size calculation to fix UI issues with the previous
design of GuiCitation. Since it always needed some kind of hack and since
QToolBoxes do not appear so popular, it probably won't be used anymore.
2017-02-26 22:16:10 +01:00
Guillaume Munch
06416763ac Give focus to the filter in GuiRef
This is now consistent with GuiCitation. Compared to the previous behaviour
there is only one down key press difference.
2017-02-26 22:16:10 +01:00
Guillaume Munch
750c48eda3 Fix focus events in GuiCitation 2017-02-26 22:16:10 +01:00
Guillaume Munch
d50b66fc88 Whitespace and remove obsolete #ifdef. 2017-02-26 22:16:10 +01:00
Guillaume Munch
eab83ec678 Implement down key press in FancyLineEdit 2017-02-26 22:16:10 +01:00
Guillaume Munch
e6180e9914 Implement left-right navigation in GuiCitation 2017-02-26 22:16:10 +01:00
Guillaume Munch
26b2cc89d3 Fix 18 memory leaks
Also whitespace.
2017-02-26 22:16:10 +01:00
Enrico Forestieri
3c329db0a5 Allow inserting consecutive dashes
Because latex allows to do so, and there is no easy way to achieve this.
This was apparently implemented to allow cycling between the various dash
types, but it was a bad idea bringing no benefit and causing griefs.
2017-02-25 14:13:02 +01:00
Juergen Spitzmueller
73ccee113e rename BufferParams::font_encoding() to ::main_font_encoding()
Because that's what's actually returned.
2017-02-25 12:49:49 +01:00
Jean-Marc Lasgouttes
83cf59cf94 Remove unreachable return statement
ALso re-indent a bit.

Fixes coverity issue 134137
2017-02-25 00:32:58 +01:00
Jean-Marc Lasgouttes
8a9ea4d264 Initialize properly pointer
Fixes coverity issue 23411
2017-02-25 00:20:51 +01:00
Juergen Spitzmueller
e68afbe671 Plain quote fixes
\textquote... commands are only available in t1.
2017-02-23 10:39:50 +01:00
Juergen Spitzmueller
cf82bcadfb Use proper font encoding in InsetQuotes 2017-02-23 10:39:31 +01:00
Juergen Spitzmueller
7d54edbf94 \textquotedbl and \textquotesingle are now covered by TU encoding
Generally, TU is on par with T1 now. Thus introduce a new latexSpecialTU
method that currently just links to latexSpecialT1.
2017-02-23 10:17:52 +01:00
Guillaume Munch
0a7ba185a3 GuiCitation: set instant search as the default
It was already supposed to be the default after 7d429291, but one has to set the
default value at the level of the QSettings.
2017-02-22 16:58:38 +01:00
Guillaume Munch
8353a53cc3 Clarify comment 2017-02-22 16:57:13 +01:00
Juergen Spitzmueller
b6a7530ba2 xunicode (only) needs to be loaded for tipa emulation.
Previous fontspec loaded xunicode internally, for recent version, this
is no longer desired. However, we still need it for tipa emulation.
We use fontspec's trick to bypass XeTeX test with LuaTeX.
2017-02-22 11:27:51 +01:00
Jean-Marc Lasgouttes
d2ad9ae6e2 Rewrite selection code in mathed
Now the selection is not done by the inset, but by the MathData
itself. This allows for some code simplification and avoids an
extra redraw.

Additionally, this fixes the selection inside macros, which was broken
by the new MathRow code.
2017-02-22 11:00:30 +01:00
Jean-Marc Lasgouttes
1c1b3519f9 Use a plain font in macro edit box
Without this, the font would be mathcal in a mathcal environment.
Additionally, set the font size to tiny when computing metrics too.
2017-02-21 11:49:12 +01:00
Jean-Marc Lasgouttes
b9d45e5ef6 Set the cursor a bit on the left in empty cells 2017-02-21 09:53:52 +01:00
Jean-Marc Lasgouttes
5211ca52ca Move comment
It is slightly more useful here.
2017-02-21 06:52:34 +01:00
Jean-Marc Lasgouttes
e04079aa52 Fixup to 33b696c8: fix compilation with gcc 4.6 2017-02-21 06:21:49 +01:00
Jean-Marc Lasgouttes
fc02744119 Revert "Linearize macros in box edit mode too."
Guillaume tells me that there are problems. We'll return to it later.

This reverts commit 0140348118.
2017-02-21 05:43:38 +01:00
Guillaume Munch
33b696c8ac Introduce support/Cache.h
Useful to cache copies of objects, including shared_ptrs. No risks of dangling
pointer, and avoid naked pointers in the source.

Fix memory leak when compiling with Qt5.
2017-02-21 00:06:07 +01:00
Jean-Marc Lasgouttes
9a54376aef Better handling for negative position in pos2x
This code is already in stable actually. The old one does not work
well in RtL text.
2017-02-20 15:39:28 +01:00
Guillaume Munch
591b311984 Amend 71623b88
Fix loop of word-delete-backward at the start of a paragraph.
2017-02-19 14:54:44 +01:00
Guillaume Munch
7337c968b3 Fix InsetMathRef mouse behaviour (#10568)
Fix mouse-selection behaviour.

Don't open dialog when releasing if it was not a real click.
2017-02-18 23:03:54 +01:00
Guillaume Munch
63be456c8d When pressing math with the mouse, move to the closest edge (#9748)
Unless it has some dialog that we want to activate.
2017-02-18 23:03:54 +01:00
Guillaume Munch
bac8a95871 Improve mouse selection over InsetCollapsable button. 2017-02-18 23:03:54 +01:00
Guillaume Munch
faeb199793 When selecting math with the mouse, selection happens in the middle (#9748) 2017-02-18 23:03:54 +01:00
Guillaume Munch
eb4a2a190f When selecting text with the mouse, inset selection happens in the middle 2017-02-18 23:03:53 +01:00
Guillaume Munch
86d9abeea7 Move cursor in front of InsetMathSpace before opening the dialog (#7749) 2017-02-18 23:03:53 +01:00
Guillaume Munch
71623b88b2 Generalise the deletion protection mechanism from math to text (#9540)
Now backspace and delete in text will select non-empty math and text insets
before deleting them. This is consistent with what happens in math already.

This is implemented for InsetText as well but can be disabled in case of
negative feedback.

This can be set for any sort of inset with the new virtual method
Inset::confirmDeletion.

New option "force" for the LFUN_*_DELETE_* commands, that bypasses the
confirmDeletion check.
2017-02-18 23:03:23 +01:00
Juergen Spitzmueller
ffacdd8b46 Output Preamble code of InPreamble styles before the styles themselves.
This assures that macros are defined.

Fixes: #10215
2017-02-18 10:40:42 +01:00
Juergen Spitzmueller
e688b9876e Use ASCII number in \char definition
The backtick version breaks in some cases (footnotes in sections)
2017-02-18 10:18:36 +01:00
Juergen Spitzmueller
46e3885d19 \\textquotedbl and \\textquotesingl are unknown in TU encoding.
Use \\char` instead.
2017-02-15 08:37:02 +01:00
Juergen Spitzmueller
7ea6377066 Don't assume T1 font encoding for XeTeX/LuaTeX
They used OT1 internally, and the new TU encoding, which does not (yet?)
contain all macros of T1, as of the Jan 17 LaTeX release.
2017-02-15 08:35:46 +01:00
Jean-Marc Lasgouttes
0140348118 Linearize macros in box edit mode too.
The special mode used by macros where the macro name is displayed as
grey text in a box is now one of the possible marker types for any
inset. The new code puts the macro name below the text, which means
that only the text below the current line will be moved. This makes
edition much more comfortable.

The marker_type enum has been moved from Inset to InsetMath.

A new BOX_MARKER enum value has been added and is taken care of in
afterMetricsMarkers (renamed from metricsMarkerVertical) and
drawMarkers.

The InsetMath::marker() macro now takes a BufferView pointer as
argument, so that the marker type can depend on editing state.

MathRow::metrics now makes changes to the MathRow object when needed.

The specific metrics/draw code in MathMacro has been removed and
replaced by assertions. Code in addToMathRow and marker is adapted to
reflect the cases where linearization is possible.
2017-02-14 01:02:00 +01:00
Juergen Spitzmueller
00417a1c80 Make openbtUnit raunparam mutable instead of using a copy of runparams
in latexParagraphs()

The latter results in output stream encoding errors.
2017-02-12 18:12:38 +01:00
Guillaume Munch
527cc8ca9c Disable InsetMathKern with invalid lengths (#10539)
From now on \kern and \mkern remain as ERT as long as the length is invalid.

Fixes #10539 (regression at 10c8d51b).

The only way to produce an InsetMathKern now is via parsing (i.e. file opening
or copy-paste). This is because there has never been any sensible way to input a
valid InsetMathKern, but this is another issue.
2017-02-11 21:52:09 +01:00
Juergen Spitzmueller
ff0d96c371 InsetHyperlink: Fix replacement of empty name with target 2017-02-08 09:17:14 +01:00
Jean-Marc Lasgouttes
ace5dc157c Compilation fix: missing header for std::max 2017-02-07 11:43:06 +01:00
Enrico Forestieri
5665209caa Ensure that QT_VERSION is defined
Otherwise checks such as "#if QT_VERSION >= 0x050600" will fail silently.
2017-02-07 11:16:05 +01:00