Commit Graph

24108 Commits

Author SHA1 Message Date
Juergen Spitzmueller
89c4357bf1 Fix Hebrew quotation marks
All typographic quotation marks are supported, if the proper
LaTeX macros (as opposed to ligatures) are used.

So no need for forcing straight quotes.

This is in line with what babel-hebrew suggests.
2016-12-12 18:08:20 +01:00
Juergen Spitzmueller
ec4adcc3a5 Add FIXME 2016-12-12 18:00:28 +01:00
Juergen Spitzmueller
1f84ae63d9 Thinko 2016-12-12 17:52:59 +01:00
Juergen Spitzmueller
d739e48574 Fix command termination before line breaks. 2016-12-12 17:00:20 +01:00
Juergen Spitzmueller
526b6a4afc Correctly handle the " \\fg" case. 2016-12-12 16:57:06 +01:00
Juergen Spitzmueller
83d2c7fa37 Properly terminate quote macros by means of new textstream function
This prevents kerning destruction.
2016-12-12 15:57:42 +01:00
Juergen Spitzmueller
66f7c2930a texstream: implement way to terminate a command depending on the context
i.e.,
* space if non terminating char follows
* {} if space follows
* nothing if \, { or } follow
2016-12-12 15:55:28 +01:00
Juergen Spitzmueller
84ffa4b834 Update tex2lyx tests
Thanks Scott for the heads-up!
2016-12-12 10:27:26 +01:00
Juergen Spitzmueller
dc38b66e60 Do not use babel quotation mark macros with non-TeX fonts
These rely on [O]T1 font encoding.

Also, add some comments.
2016-12-10 17:25:04 +01:00
Juergen Spitzmueller
449a89825b Fix xhtml output of French double guillemets (spacing) 2016-12-10 16:13:02 +01:00
Juergen Spitzmueller
6e0cfe5bee Do not output quote TextCommand definitions for polyglossia
These are meant to be output for non-T1 8bit font encodings.
2016-12-10 16:07:04 +01:00
Juergen Spitzmueller
fc1fa0698b The extra space for French quotes only applies to guillemets. 2016-12-10 14:59:45 +01:00
Tommaso Cucinotta
6e22bb17c7 Remove unused lyxrc.use_converter_wrappers that inadvertently slipped through [244de5d2/lyxgit]. 2016-12-10 14:57:20 +01:00
Juergen Spitzmueller
e8c932ff84 Enable InsetQuote in verbatim and Hebrew
In this context, the inset outputs straight quotes in LaTeX.

File format change.

Fixes: #7309
2016-12-10 11:53:42 +01:00
Jean-Marc Lasgouttes
c139aef379 Add a way to disable the poor man's profiler
Just define DISABLE_PMPROF _before_ #including the header.
2016-12-09 15:47:19 +01:00
Guillaume Munch
c96faefdae Validate html
Qt html is based on html 4. </p> is in fact optional, but <p> is mandatory
around <tt>.
2016-12-08 17:23:09 +01:00
Guillaume Munch
a7b993143e Fix compilation with MSVC 2016-12-08 16:28:16 +01:00
Günter Milde
81f5e596b4 File format update after 418016bf79
Removing unsupported encoding "pt254" from \inputencoding values makes documents using this value invalid (J.S.).
2016-12-07 18:38:41 +01:00
Juergen Spitzmueller
e4c46abeb7 Fix mis-nomer 2016-12-07 16:50:54 +01:00
Juergen Spitzmueller
ad83520390 Fix some quote inset bugs:
* Adjoining closing Single + double quote becomes double + single quote
  (for English, Swedish and German, LaTeX export as ''').

* French double quotes are converted to << >> in the LaTeX file and to
  double inverted question/interrogation marks in the output, if the font
  encoding is set to [None] or OT1 but the global default is T1. (test
  for lyxrc.fontenc instead of the document-specific fontenc setting in
  InsetQuotes.cpp).

* Quote type ignored for LyXHTML: always "English" quotes used.

See #10451
2016-12-07 15:37:03 +01:00
Jean-Marc Lasgouttes
10c8d51b90 Accept \kern and \mkern for math kerning
Also output the right one depending on whether the unit is "mu" or
not. Indeed, the two macros are identical, except that \mkern only
accepts unit mu, and kern does not accept it.

With this patch, both macros accept all units, but on writing beck,
the right one is used.
2016-12-06 16:29:38 +01:00
Jean-Marc Lasgouttes
c8a829d273 Handle negative values gracefully.
It may happen (for example with on the fly spell checking) that
GuiFontMetrics::pos2x is called with a negative pos value. Add a
special case for this situation.

Fixes bug #10506
2016-12-06 16:16:57 +01:00
Jean-Marc Lasgouttes
7f6f56f40a Get rid of Inset::setDimCache
This helper method is used to set the inset dimension cache at metrics
time. However this is already done by the metrics code itself
(MathRow::metrics, TextMetrics::redoParagraph), so that there is no
need to do this same work again in a different place.

Also, InsetPhantom::metrics is removed, since it does not do anything
interesting.

This commit comes with a mild risk attached (it might be that some of
these calls were useful after all!), but all of this is fixable.
2016-12-06 16:15:47 +01:00
Jean-Marc Lasgouttes
02e82157ec Get rid of Inset::setPosCache
This helper method is used to set the inset position cache at drawing
time. However this is already done by the drawing code itself
(MathRow::draw, RowPainter::paintInset), so that there is no need to
do this same work again in a different place.

Note that the inset positions are still set in InsetTabular::draw for
each cell.

This commit comes with a mild risk attached (it might be that some of
these calls were useful after all!), but all of this is fixable.
2016-12-06 16:15:47 +01:00
Jean-Marc Lasgouttes
8aaec85c8c Now Inset::dimension is only an access to cache
Up to now Inset::dimension was either a helper function to access
CoordCache, or... something else. This created problems to properly
use it.

In particular, the definition of InsetText::dimension created problems
for child classes. Removing this definition (actually renaming it to
dimensionHelper) allows to streamline the code.
2016-12-06 09:52:17 +01:00
Jean-Marc Lasgouttes
fd50fb720f Introduce (Inset|InsetList|Paragraph)::resetBuffer
This avoids an ugly cast like
     setBuffer(*static_cast<Buffer *>(0));
that clang does not appreciate.
2016-12-05 14:48:32 +01:00
Guillaume Munch
588d939722 Cosmetic changes to the needauth dialogs
* Use rich text for this complicated message

* More concise

* Fix line breaking issues

* Remove "Do not show again" checkbox
2016-12-04 18:28:03 +01:00
Guillaume Munch
f9528c63c8 GuiAlert: Convert html to plain text on console output 2016-12-04 18:28:03 +01:00
Guillaume Munch
dbcbf305b2 Improve prediction of block outside covered areas 2016-12-04 18:28:02 +01:00
Guillaume Munch
b329b471d4 Remove useless return leftover from earlier code 2016-12-04 18:28:02 +01:00
Tommaso Cucinotta
9c1142c880 Remove unneeded templatization code from bformat(). 2016-12-04 17:10:10 +01:00
Tommaso Cucinotta
f0f555b5be Converters Prefs UI layout clarification. 2016-12-04 17:09:30 +01:00
Guillaume Munch
ee0e95aafb GuiSymbols: Better handling of empty blocks
* endInsertRow was incorrectly placed before endResetModel, sometimes leading to
  bad access by the view before it was informed that the model was empty. In
  fact begin/endInsertRows were redundant with begin/endResetModel.

* Empty blocks are not supposed to be shown. This happened when moving the
  cursor. A valid block is now selected intead. Due to the design/optimisation
  of the model update, this requires a first update with an empty
  model. Simplify the old code.
2016-12-03 23:35:15 +01:00
Guillaume Munch
a19be0314b GuiSymbols: fix char->block lookup 2016-12-03 23:35:15 +01:00
Guillaume Munch
c8d1d0d33c GuiSymbols: put ASCII chars first
Having À before A was weird. This only affects GuiSymbols.
2016-12-03 23:35:15 +01:00
Guillaume Munch
3a73b822a5 GuiSymbols: show all symbols when UseNonTeXFonts 2016-12-03 23:35:15 +01:00
Guillaume Munch
6f07721187 GuiSymbols: Improve the tooltip 2016-12-03 23:35:15 +01:00
Guillaume Munch
851ed60e49 Check the validity of an item before querying its tooltip
In case data() does not handle invalid items.
2016-12-03 23:35:15 +01:00
Guillaume Munch
03a0e983bc GuiSymbols: handle the case of an invalid data
The docs do not guarantee that the index must be valid
2016-12-03 23:35:14 +01:00
Jean-Marc Lasgouttes
d85cf3218a Remove unused method in ArgumentProxy
Also reorder some methods.
2016-12-02 16:19:02 +01:00
Jean-Marc Lasgouttes
2acc4fc54c Improve spacing of BOX elements
Tweak the algorithm so that a BOX math row element can have some
spacing. To this end, MathRow::before/after do not look at the type of
an element for deciding when to skip it, but rather to its math class.

In the new setting, the spacing algorithm works on all elements, but
skips the MC_UNKNOWN elements as if they were not present. As a
consequence, the two element types BEGIN and END have been replaced by
a single DUMMY (they can be recognized from their class).

To simply the code, add a new `mclass' argument to the
MathRow::Element constructor (default is MC_UNKNOWN).
2016-12-02 16:14:12 +01:00
Jean-Marc Lasgouttes
190d312e35 Factor out the code that handles default macro arguments 2016-12-02 14:56:09 +01:00
Jean-Marc Lasgouttes
0f15dcc698 Rewrite handling of macro nesting in math rows
Macro nesting is now recorded into the macro inset itself. This allows
the ArgumentProxy inset to determine whether it is editable or not by
looking at its macro.

Remove code in the metrics and draw methods of ArgumentProxy: this
code is AFAICS not active anymore, since arguments are linearized into
math rows.

Use Changer idiom to change locally the values of MecticsInfo::base.macro_nesting.
2016-12-02 11:56:49 +01:00
Jean-Marc Lasgouttes
58e479527e Reintroduce broken support for default macro arguments
This got forgotten in the math typesetting rewrite.

Fixes bug #10508.
2016-12-02 11:18:51 +01:00
Enrico Forestieri
e8f480e7c2 Fix display and output of math macros with optional arguments
This is a long standing issue, present since the new math macros
inception in version 1.6. It manifests as a display issue when a
macro with optional arguments appears in the optional argument of
another macro. In this case the display is messed up and it is
difficult, if not impossible, changing the arguments as they do not
appear on screen as related to a specific macro instance. It also
manifests as latex errors when compiling, even if the latex output
is formally correct, due to limitations of the xargs package used
to output the macros. Most probably, both aspects have the same
root cause, as simply enclosing in braces the macro and its
parameters solves both issues. However, when reloading a document,
lyx strips the outer braces enclosing a macro argument, thus
frustrating this possible workaround.

This commit solves the display issue by correctly accounting for
macros with optional arguments nested in the argument of another
macro, and circumvents the xargs package limitations causing errors
by enclosing in braces the macros with optional arguments appearing
in the argument of an outer macro when they are output. This means
that when loading an old document with such macros and saving it
again, the macro representation is updated and will have these
additional braces. However, as such braces are stripped by lyx on
loading, there is no risk that they accumulate.

See also this thread:
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg197828.html
2016-12-01 18:02:47 +01:00
Tommaso Cucinotta
cc653feb60 Bump up RC fileformat after [244de5d2/lyxgit] for the new 'needauth' options.
Addressing #10481.
2016-11-25 23:33:08 +01:00
Tommaso Cucinotta
c636ded2b9 Better explanations to the user for [244de5d2/lyxgit] and
[830eb234/lyxgit] addressing #10481, so as to provide better clues as
to why the action is being forbidden or user authorization is needed.
2016-11-24 01:06:20 +01:00
Guillaume Munch
c3e33b765e Match the font in MathMacro::metrics with the font in MathMacro::draw
This fixes the "bad keming" of math ERT (in fact wrong metrics) which recently
was worsened by InsetMathChar substitutions and their MathClass spacing.

Also fix a small inefficiency: always prefer:

  Changer dummy = (currentMode() == TEXT_MODE)
    ? pi.base.font.changeShape(UP_SHAPE) : Changer();

over:

  Changer dummy = pi.base.font.changeShape((currentMode() == TEXT_MODE)
    ? UP_SHAPE : pi.base.font.shape());

The former only records and restores a value when the condition is satisfied,
and does not cost anything otherwise.
2016-11-23 23:18:02 +01:00
Tommaso Cucinotta
830eb234be Let LyX remember what documents 'needauth' converters have been authorized to run over by the user.
This is done by moving Converters::auth_files_ into a new SessionSection
subclass, along with the same read/write paradigm, as per Enrico's hint.
2016-11-23 22:17:13 +01:00
Tommaso Cucinotta
309209e319 Fix missing space in string from [244de5d2/lyxgit]. 2016-11-23 21:46:06 +01:00
Guillaume Munch
465260c05e Fix header 2016-11-23 19:16:18 +01:00
Jean-Marc Lasgouttes
7971dc83ef Fix some warnings after 6c9207579 2016-11-23 17:44:22 +01:00
Enrico Forestieri
6c92075799 Amend fix for #10428
- Allow using logical values for icon sizes as the standard sizes may
  differ among different icon sets
- Do not allow setting sizes smaller than smallIconSize

When the logical sizes differ and the icon set is changed, the correct
sizes are established only after a restart.
2016-11-23 17:30:49 +01:00
Tommaso Cucinotta
244de5d2c1 Add 'needauth' option to converters that need explicit user authorization.
Addressing #10481.

This patch adds the new 'needauth' option for converters launching
external programs that are capable of running arbitrary code on behalf
of the user. These converters won't be run unless the user gives explicit
authorization, which is asked on-demand when the converter is about to
be run (question is not asked if the file is cached and calling the
converter is not needed).

The user prompt has a 3rd button so that he/she's not prompted again
for (any converter over) the same document (identified through
buffer->absFileName()).

Two preference options are added:

lyxrc.use_converter_needauth_forbidden disables any converter with
the 'needauth' option, which is meant to force user to an explicit
action via the preferences pane, before being able to use advanced
converters that can potentially bring security threats;

lyxrc.use_converter_needauth enables prompting the user for 'needauth'
converters, or bypasses the check if not enabled, falling back to the
previous behavior.

So, the first option is for maximum security, the second is for
maximum usability.
2016-11-22 23:54:58 +01:00
Kornel Benko
ff0c95aba6 Cmake build: Prepare for hardening use of external programs 2016-11-22 16:51:44 +01:00
Guillaume Munch
eadc55b8b3 InsetMath: match the screen display with the EnsureMath behaviour in output 2016-11-22 11:30:26 +01:00
Guillaume Munch
b5af229208 frac: Add line thickness to height 2016-11-22 11:30:26 +01:00
Guillaume Munch
d5f139e71b Correct on-screen kerning in math for non-mu units
The current math style should have no impact on \kern1mu. This is another
benefit of a9eb87a8.

Testcase:
\begin{align*}
 & \kern1em a\\
 & {\scriptscriptstyle \kern1em a}\\
 & \kern18mu a\\
 & {\scriptscriptstyle \kern18mu a}
\end{align*}
2016-11-22 11:30:26 +01:00
Daniel Ramöller
e91572a00b Add the icon-size to the toolbar menu
- Adds LFUNs for setting the icon size
- Adds icons sizes to the Toolbars menu
- Uses the Toolbars menu as application context menu
- The context menu can now be user defined in stdcontext.inc

Fixes ticket #10428.
2016-11-22 10:00:52 +01:00
Jean-Marc Lasgouttes
004fdf6aeb Clear temp cutstack before exiting LyX.
Otherwise it is done in the exit handler, which leads to crashes.
2016-11-21 17:03:50 +01:00
Guillaume Munch
34b6b474ea Amend b30f8d3c
Fix assertion. Thanks Scott for the bisect and the trace.
2016-11-21 12:09:48 +01:00
Guillaume Munch
cf45810e43 Fix display of nicefrac solidus 2016-11-21 00:08:12 +01:00
Guillaume Munch
fdd09d6f51 Let math mu skips scale with zoom 2016-11-21 00:08:12 +01:00
Guillaume Munch
a42c315e79 Amend ad7e2435cf
InsetMathKern is also used for non-mu lengths.

Generalise the fix by moving to Length::inPixels (thanks Jaan-Marc).
2016-11-21 00:08:11 +01:00
Guillaume Munch
eacac8bea2 mathedSymbolDim only needs a MathBase 2016-11-21 00:08:11 +01:00
Guillaume Munch
71ce34e821 Improve fractions bar
* The bar grows with the zoom according to MetricsBase::solidLineThickness()

* The spacing around the bar grows with the font size.
2016-11-21 00:08:11 +01:00
Guillaume Munch
ad0a0e3b3c Fix vertical alignment of fractions
Fractions and binoms are vartically aligned with -

Nicefracs are ascent-aligned with the surrounding text
2016-11-21 00:08:11 +01:00
Guillaume Munch
e449e70e38 Simplify Changers interface
In fact having an extra parameter "bool cond" is no longer useful because it can
now always be emulated with a ternary operator:
	Changers dummy = cond ? do_change() : Changer();
2016-11-21 00:08:11 +01:00
Guillaume Munch
ffb865d6e8 Clean up and fixes to fractions metrics and drawing
* Factor code for easier maintainance.

* Avoid computing metrics several times. This duplication explained the
  exponential blowup during the metrics phase for nested fractions (see
  b2b87330). This happened in particular when using lyxproofs which heavily uses
  nested \dfracs for on-screen drawing.

* Call MetricsBase::changeScript instead of MetricsBase::changeFrac for
  \nicefrac and \unitfrac.
2016-11-21 00:08:11 +01:00
Guillaume Munch
a9eb87a89d Correct computation of math font size
Move math style to FontInfo and compute the font sizes for scriptstyle and
scriptscriptstyle according to standard proportions: 0.73 and 0.55.

This is simpler and more accurate. It also fixes the font size of
${\scriptscriptstyle {\textstyle A}}A$ which exposed the limitations of the
previous approach.
2016-11-21 00:02:35 +01:00
Jean-Marc Lasgouttes
9a9a6a8c8f Skip drawing of markers in non-editable math data
There is no reason to reserve pixel space in macros replacement text,
which is not editable. This makes macros more compact and eases the
writing of lib/symbols.

* introduce new InsetMath::drawMarkers and friends that do nothing
  when nested inside a macro. This required to move macro_nesting
  inside MetricsBase, and to pass MetricsInfo & to metricsMarkers.

* keep track of nesting when drawing rows or macros.
2016-11-17 08:48:32 +01:00
Jean-Marc Lasgouttes
f3f9b083d1 Only display a blue rectangle for editable empty insets
Empty insets should use a minimal amount of space, especially when
they are part of a built-in macro in lib/symbols.

With this change, blue rectangles signal actually editable places.
Empty macros in editable data are shown as grey boxes, but they do not
appear when further nested.

This is done by adding a new type BOX of MathRow::Element object and a
MetricsInfo::macro_nesting that keeps track of macros (and is reset to
0 in editable macro arguments).
2016-11-16 18:33:02 +01:00
Jean-Marc Lasgouttes
0b5c2a8507 Add support for \mathbin and friends
All they do is change the class of the elements that they contain.
2016-11-16 15:21:53 +01:00
Jean-Marc Lasgouttes
bf56e2c8e1 Set correctly the spacing between atoms in MathData
* new MathRow class which contains the description of a MathData
  object in terms of math class and spacing

  + macros and their arguments used in the MathData object are
    linearized (replaced with their contents) so that all math insets
    are typeset as a string together. To this end, we introduce a
    method addToMathRow to InsetMath and MathData. This method allows
    to linearize recursively a MathData object.

  + It is then necessary to set manually the dimension and position of
    the macros and arguments.

  + the class class and spacing are computed using the MathClass helpers.

  The MathRow data is cached in the MathData object in a bufferview-dependent
  way (different dpi for different screens).

* delegate most of the work MathData::metrics/draw to MathRow metrics/draw.

  The case of draw is trickier, since many draw() methods rely on their
  metrics without any spacing added.
2016-11-16 15:21:52 +01:00
Jean-Marc Lasgouttes
f6df4e7985 Implement computation of spacing according to the TeXBook
This implements the relevant math typography rules described in the
Appendix G of the TeXbook. More precisely, for each atom

  + the class is computed by implementing rules 5 and 6 of Appendix G

  + the spacing is computed according to the table p. 170

This code is not used at this point.
2016-11-16 15:21:52 +01:00
Jean-Marc Lasgouttes
361bd53bc3 Introduce the notion of math class
This done according to the TeXbook. This class replaces the individual
isMathXXX() methods. The mathClass() method (currently unused) is
provided for the following insets:

 * InsetMathChar (with a revised list of affected characters)
 * InsetMathSymbol: the class is given by the `extra' field
   Operators defined in lib/symbols (e.g. \log) are MC_OP
 * InsetMathFrac is MC_INNER (except nicefrac and units)
 * InsetDelimiters is MC_INNER
 * InsetStackrel is MC_REL
 * The class of InsetScript is the class of the last element of its
   nucleus (yes, it is a hack, but doing it right is more work).

Remove the explicit spacing that was done in the different insets. The spacing
will be reintroduced properly in a forthcoming commit.
2016-11-16 15:21:52 +01:00
Guillaume Munch
be836909c5 Display properly math characters that behave like symbols
* set up a replacement of *, -, and : by the adequate symbols (#9893)

* fix the wrong character selection and operator spacing in \text mode

* hide some internal symbols from the auto-completion.
2016-11-13 20:06:35 +01:00
Guillaume Munch
ad7e2435cf Fix display of some math symbols
* Fix spacing in lib/symbols after recent commits about math spacing, as well as
  older spacing issues (e.g. \Join).

* InsetMathKern now uses the same em value as other math length commands.

What is nice is that the kerning amount now matches the ones found in the
packages definition (modulo 10mu that lyx currently adds between relations).

Testcase: $\CheckedBox\LEFTcircle\RIGHTcircle\photon\gluon\vcentcolon\dblcolon\Coloneqq\eqcolon\models\hookrightarrow\bowtie\hookleftarrow\Join\APLinv\neq$
2016-11-13 20:04:51 +01:00
Jean-Marc Lasgouttes
6dfbab3124 Handle properly unicode paragraph/line break
They are shown on screen by arrow or pilcrow symbol and cause a line break.

They are still not handled in LaTeX output, though.
2016-11-10 09:37:36 +01:00
Guillaume Munch
dc5d056dd5 Fix warning during runtime with qt4
Do not use "on_" as a prefix for functions unless the use of auto-connect is
intended.
2016-11-09 23:37:35 +01:00
Guillaume Munch
0220c58ef3 Add comment 2016-11-09 22:54:27 +01:00
Guillaume Munch
3233a822f3 Fix addition of new formats
Regression at cb0a4c66
2016-11-09 19:04:28 +01:00
Jean-Marc Lasgouttes
fb264663d8 Make insertInset use a temporary cut-and-paste area.
This is a long wanted feature, although it does not go all the way to
fix #6604 (private-cut/private-paste).

Additionally, it fixes a crash that can happen when using undefined
branches. This is done by making the action when pasting unknown
branches configurable.

Fixes bug #6570.
2016-11-09 15:28:11 +01:00
Guillaume Munch
50ccbd2eab Always prefer breaking at word boundaries
An overlong word containing a hyphen could be broken anywhere, instead of after
the hyphen.

Example: compare the line breaking of

   aaaaa-aaaaa-aaaaa-aaaaa

with

   aaa aaaaa-aaaaa-aaaaa-aaaaa

(with a very narrow window)

This also improves Chinese text in some situations (#10299)
2016-11-06 15:51:22 +01:00
Guillaume Munch
b30f8d3c4b On-screen justification: stretch in proportion with the em, up to a limit
1) Distinguish expanding characters from separators, to fit with Qt's notion of
expanding character which comes from the Unicode std.  CountExpanders() is moved
to FontMetrics to fix a discrepancy with the duplicate implementation from
598f7e4a.

2) Make these expanders stretch on-screen proportionally to the em of the font.
If a row mixes large and small text, LyX let us see which spaces are set in the
bigger font.

3) Now that the stretch is defined in ems, add a limit such that an expander
never stretches more than 1.5em to avoid weird and hard to read justified lines.

4) Add a return boolean to setSeparatorExtraWidth for future use.
2016-11-06 12:20:00 +01:00
Guillaume Munch
1c84d0ca82 Don't parse multicolumn if the grid does not support it
Fixes #10466 and visual/compilation bugs with InsetMathSplit, InsetMathDiagram,
InsetMathHull, InsetMathSubstack and InsetMathXYMatrix.
2016-11-05 18:36:39 +01:00
Juergen Spitzmueller
e7654d9aa2 Re-Fix #8471
The bug has partly been re-introduced with fb9a866a6
2016-11-05 13:12:47 +01:00
Enrico Forestieri
34ae9dc7f2 Avoid dataloss with \multicolumn
When \multicolumn{ncol}{align}{content} is parsed and the ncol
parameter is not a numeric value, this parameter is swallowed
and replaced with '1'. Hence, if the file is subsequently saved
a dataloss would occur. With this commit, \multicolumn is not
interpreted when ncol is not a numeric value and is left as is.

See also #10466
2016-11-05 10:15:37 +01:00
Jean-Marc Lasgouttes
75fce32556 Round values properly when drawing right margin selection
This fixes a compiler warning reported by Uwe.
2016-11-04 15:58:54 +01:00
Jean-Marc Lasgouttes
b099d9ae15 Fix height of cursor inside insets
It turns out that Cursor::getFont() does not return a fully realized
font in some cases. This patch uses real_current_font instead, which
seems better anyway.

I suspect that all uses of getFont() should be removed, but this is
not code that I know well.

Fixes bug #10478.
2016-11-04 12:01:43 +01:00
Jean-Marc Lasgouttes
d207e85cfd Clear background behind sublables when necessary.
This is analogous to what has been done to address #4889 and #10359.

Fixes bug #10475.
2016-11-04 11:35:22 +01:00
Jean-Marc Lasgouttes
5d85a42bf0 QString only uses UTF-16, not UCS-4
This means that, when a string contains high-plane Unicode characters,
the length of a docstring and the corresponding QString will be
different: Qt will encode these characters using several 16bit
characters.

We have additionally to take into account QTBUG-25536, which implies
that sometimes qstring_to_ucs4(toqstr(s)) !=s. It is not clear whether
this bug can be a problem in other places.

Fixes bug #10443.
2016-11-03 14:19:50 +01:00
Daniel Ramöller
f054721410 In Color Preferences "frame of button" should be "button frame"
Fixes #10135.
2016-11-03 08:57:35 +01:00
Scott Kostyshak
ad65f609b6 Do not recenter screen on spelling-continuously
If a user is scrolling and then toggles spellcheck, LyX used to
recenter the screen around the cursor. Now LyX does not recenter.
2016-11-02 21:34:01 -04:00
Juergen Spitzmueller
3374b8548b Fix usage of multiple varieties of the same polyglossia language.
1. We must always output all (diverging) options, including
   default options; if not, default options might get overwritten.

2. Do not output options in \setotherlanguage, since we might have
   multiple "other languages" varieties from the same language (such
   as naustrian, nswissgerman). And the options are output for the
   language switches anyway.

Hence, LaTeXFeatures::getPolyglossiaLanguages() does not have to record
varieties. This was not done correctly anyway, since the map allowed
for one entry per language only.
2016-11-02 17:07:49 +01:00
Juergen Spitzmueller
eca3015f30 Whitespace 2016-10-31 18:50:28 +01:00
Juergen Spitzmueller
0c296cd26f Use Buffer::validate() when previewing single paragraph
We used to use BufferParams::validate(), which does not validate the
paragraphs.
2016-10-31 18:50:28 +01:00
Enrico Forestieri
e3c3719643 Don't print useless messages while parsing math macros
Math macros can be displayed on screen by providing a different
representation than the one used for latex output. This representation
is actually used by lyx even while it is being updated. This leads to
printing useless error messages on the terminal. For example, a macro
parameter has to be entered as \#1 and, if the macro is already used in
a math inset, lyx prints on terminal the error message "Math parse error:
missing token after \\" as soon as one hits the \ key, followed by
"MathMacroArgument::MathMacroArgument: wrong Argument id: -48" as soon as
one hits the # key. So, this is not a useful information and simply
clutters the terminal output. On the other hand, the input is sanitized
even if one stops input after hitting either \ or #, so that no further
messages are issued. Hence, those error messages are simply pointless.
2016-10-31 15:23:20 +01:00
Tommaso Cucinotta
fcaec6166b Show symbol name and description in plaintext export of nomenclature entries.
This addresses one of the issues highlighted in #10459.
See http://www.lyx.org/trac/ticket/10459
2016-10-31 10:50:33 +01:00
Uwe Stöhr
41a5833920 tex2lyx test files: update them
- update the test files after the last 3 fileformat changes
- this is now possible thanks to the patch for bug #10440
2016-10-28 00:45:33 +02:00
Uwe Stöhr
87c00f3383 add support for Urdu and Syriac
- fileformat change
- I could not update the tex2lyx testfiles because of bug #10440 (there is now a probable fix)
2016-10-28 00:21:58 +02:00
Juergen Spitzmueller
0894a17e33 Typo. 2016-10-27 19:58:01 +02:00
Juergen Spitzmueller
07c82e9f84 Issue an error message if conflicting languages are used
Some languages are only supported by Babel, some only by Polyglossia.

If these are combined, we issue an error message now.

Fixes: #10456
2016-10-27 09:59:01 +02:00
Tommaso Cucinotta
9740c36e80 Remove assert on advanced find with knitr module (#10444). 2016-10-27 09:38:35 +02:00
Jean-Marc Lasgouttes
695b0cc33b Some tweaks to selection painting
1/ simplify logic that triggers margin selection painting

2/ fix logic for end of paragraph markers. They are now selected when
   there is an end row margin selection.

3/ avoid rounding problems due to int/double conversions.
2016-10-26 14:27:57 +02:00
Jean-Marc Lasgouttes
4159cf97c1 Fix compiler warnings spotted by Uwe 2016-10-26 10:52:55 +02:00
Jean-Marc Lasgouttes
2037cc5ef5 Fixup a700d657 : holes in right margin selection 2016-10-25 16:17:21 +02:00
Enrico Forestieri
3cf0cbb3c6 Show on screen font changes for text-in-math 2016-10-25 16:03:34 +02:00
Jean-Marc Lasgouttes
860accd01f When selecting special logos, set their color correctly
It is not nice when they are the only thinkg in the text that does not
change color.
2016-10-25 15:13:23 +02:00
Jean-Marc Lasgouttes
a700d657b3 Reimplement RowPainter::paintSelection() using row elements
The code is much simpler now and can be actually understood.

As a byproduct, fix bug #10424.
2016-10-25 10:01:37 +02:00
Enrico Forestieri
696ea82b21 Factor out common code used to underline/strike out math
Also use the exact amount of vertical space TeX adds after a
math display (instead of 1ex) for vertically shifting the box.
We have to use \belowdisplayshortskip here, instead of
\belowdisplayskip, because the math formula is typeset by alone
in a box, and thus there is no following line.
2016-10-25 00:49:26 +02:00
Jean-Marc Lasgouttes
e832d2e90f Work around issues with Qt5 and Arabic text
This fixes two particular problems

* with Qt5, it seems that QFontMetrics::width does not return the
  correct value for some Arabic text; this patch uses QTextLayout
  instead to compute a string width

* Likewise, the undocumented layout flags TextForceRightToLeft and
  TextForceLeftToRight do not work with Arabic text; this patch uses
  unicode override characters instead.

It might be that the two issues are related. In any case, they do not
happen with latin text where right-to-left direction is enforced. And
they do not happen with Qt4.

Additionally, remove some dead code in GuiFontMetrics::pos2x().

Fixes bug #10436.
2016-10-24 16:31:40 +02:00
Tommaso Cucinotta
8b5dc3c662 Fix bug in replacement of "$$s/" in converter commands, introduced in 8b66f9ce. 2016-10-24 15:08:06 +02:00
Enrico Forestieri
dea5ba16de Correctly track ulem commands with change tracking
LyX assumes that everything in \lyxdeleted is struck out by ulem
and increases the corresponding counter. However, deleted display
math material is struck out using tikz. As we also take into
account the deletion of underlined display math (in order to
properly position such material vertically), we have to take
care that the count is correct.
2016-10-23 18:23:41 +02:00
Enrico Forestieri
9ba76e6c40 On export, mark the start of the first paragraph
No newline is written after \begin{document}, such that
the afterParbreak method would return false. This misleads
the code that outputs a display math in an ulem command
to emit a newline command instead of \noindent, causing
latex errors. This occurs only if the math is at the very
start of a document, without anything before it.
2016-10-23 18:16:56 +02:00
Juergen Spitzmueller
e335c764b4 Revert "Fix Ticket #9741 misleading name for font-encoding setting "default"."
This reverts commit e37e4f537c.

The issue still needs discussion.
2016-10-23 17:20:58 +02:00
Jean-Marc Lasgouttes
6375a3cd65 Mark a signal invokation as such 2016-10-23 13:49:06 +02:00
Guillaume Munch
13eeb3b3c3 Fix compilation on cygwin & others 2016-10-23 00:25:05 +02:00
Guillaume Munch
67ddc246fd Improvement to the reverse-search algorithm 2016-10-22 23:24:01 +02:00
Guillaume Munch
68b034f51f TexRow: enable new RowEntry types 2016-10-22 23:24:01 +02:00
Guillaume Munch
148b3ae773 Move class definitions inside main class
Prepare for following commits.

This prevent's forward-declaration, but including the TexRow header should be
inexpensive.
2016-10-22 23:24:01 +02:00
Guillaume Munch
2e45bade7a Simplify and add debug message 2016-10-22 23:24:00 +02:00
Guillaume Munch
e1492a3ab1 Use the new infrastructure to select rows during error reporting 2016-10-22 23:24:00 +02:00
Guillaume Munch
dbe0c6991b Add safe line breaks to improve TexRow precision in subfloat & caption 2016-10-22 23:05:44 +02:00
Guillaume Munch
e798db5739 Safe line break to increase precision of error reporting in Listings caption 2016-10-22 22:39:33 +02:00
Uwe Stöhr
d9c52c7a3f support for Amharic, Asturian, Kannada and Khmer
- fileformat change
- I could not update the tex2lyx test files because of bug #10440
- maybe the lyx2lyx routine could be improved but since a document can also begin with another layout than "Standard" I could not use the lyx2lyx function put_cmd_in_ert
2016-10-22 15:33:59 +02:00
Juergen Spitzmueller
9235b09fd8 Fix LaTeX output of fixed-width cells with decimal separator
This follows Uwe's suggestions (and discharges my own).

The result is not ideal, but there is currently no ideal solution.

Fixes: #9568
2016-10-22 12:13:36 +02:00
Juergen Spitzmueller
e83e64c447 Do not output bidi direction macros in passthru context
Part of #10434.
2016-10-21 10:40:19 +02:00
Juergen Spitzmueller
fb9a866a66 Implement PassThru option to arguments. 2016-10-21 10:39:55 +02:00
Günter Milde
e37e4f537c Fix Ticket #9741 misleading name for font-encoding setting "default".
It would be nice, if the tooltip showed the value of
lyxrc.fontenc, but too complicated for my simple patch.
2016-10-21 09:10:46 +02:00
Richard Heck
c19794a013 These two routines are now redundant. 2016-10-20 23:07:13 -04:00
Richard Heck
7c9e9b4c90 We can now use the cached information instead of tracing the graph. 2016-10-20 23:07:13 -04:00
Richard Heck
014bc7805e Use a typedef for vector<Format const *>, which is what gets used
for lists of exportable and importable formats.
2016-10-20 23:07:13 -04:00
Richard Heck
e7f39ed377 There is no need now to cache format information in the SendTo
dialog.
2016-10-20 23:07:13 -04:00
Richard Heck
7fd1a14c1b Since we're now caching this, we can sort it once, rather than
lots of times.
2016-10-20 23:07:13 -04:00
Richard Heck
0b67e103e9 Simple cache for information on exportable formats, since we seem
to access this information a lot.
2016-10-20 23:07:13 -04:00
Enrico Forestieri
7cf12243b8 Fix indentation 2016-10-21 01:58:45 +02:00
Enrico Forestieri
8d5899aaf3 Fortify math insets against ulem commands
It should be now possible underlining or striking out any kind
of math inset containing any math construct indigestible to ulem.
While this was already possible for inline math insets, they could
have break if an aligned environment was used, for example.
This is now possible also for diplay math. Even if this can be
nonsensical and not visually perfect, at least no latex errors
should be generated if one tries to.
2016-10-21 01:35:39 +02:00
Uwe Stöhr
5adf949abb tex2lyx/Preamble.cpp: forgot this in r[f179173e/lyxgit]
- polyglossia supports Romansh, Piedmontese and Friulian
2016-10-21 00:20:27 +02:00
Uwe Stöhr
fe542e7989 tex2lyx/Preamble.cpp: sort alphabetically to keep overview
- also comment out the unsupported languages
2016-10-21 00:14:09 +02:00
Jean-Marc Lasgouttes
b162bd6d2b When breaking an empty paragraph reduces depth, set layout too
This requires an adaptation of the Separator inset insertion code,
which has been duly provided by Enrico.
2016-10-20 14:38:12 +02:00
Jean-Marc Lasgouttes
fbba865d28 Fix compiler warning from clang 3.9 2016-10-20 09:31:01 +02:00
Enrico Forestieri
ab3e1ddc34 Introduce the InsetMathHull::outerDisplay method and use it 2016-10-20 00:06:42 +02:00
Jean-Marc Lasgouttes
4065f596ad Remove unused methods in anononymous namespace
These have been flagged by gcc 6.
2016-10-19 17:51:32 +02:00
Juergen Spitzmueller
86517b120c Restore alphabetic order 2016-10-19 14:21:24 +02:00
Jean-Marc Lasgouttes
85bcf0d93f Fix indentation
Thanks to Juergen and gcc 6.2.
2016-10-19 14:10:47 +02:00
Jean-Marc Lasgouttes
6cb05ce8bb Do some caching of window title and related UI
This should avoid performance problems related to the window update machinery.
Moreover this fixes a crash introduced by 82808fea when closing a file.

Note that GuiWorkArea::Private already had a read_only_ member, but it
was unused.

Also rename LyXVC::vcname() to LyXVC::vcstatus() since it now contains
directly the UI string to be shown.
2016-10-19 11:59:47 +02:00
Jean-Marc Lasgouttes
a4e7114d98 Typo 2016-10-19 11:21:02 +02:00
Enrico Forestieri
d48bc4e4ae Remove a now unnecessary \mbox 2016-10-19 01:32:29 +02:00
Enrico Forestieri
6ae6198818 Avoid introducing a spurious space in \lyxmathsout 2016-10-18 04:35:02 +02:00
Enrico Forestieri
129459a71b Take into account font changes when striking out display math formulas
Font changes are brought inside the \lyxdeleted macro, just before
outputting the latex code for the math inset. The inset writes a
signature before itself and this is checked by \lyxsout for recognizing
a display math. So, the font changes confuse \lyxsout, which also
swallows the first macro at the very start of \lyxdeleted. The result
is that the font changing command is not seen by latex and \sout is also
used to further strike out the formula already striked out by tikz.
This commit makes sure that the expected signature actually appears
just after the opening brace of \lyxdeleted. It also accounts for a
paragraph break occurring just before the math inset, in order to not
introduce too much vertical space, which is noticeable when using
larger font sizes.
2016-10-18 03:29:53 +02:00
Guillaume Munch
9c0281126e Change tracking cue for InsetCaption 2016-10-18 01:06:03 +02:00
Guillaume Munch
0aab06c468 Some compilers are worried that a struct is not the same as a class 2016-10-18 00:54:37 +02:00
Enrico Forestieri
c1bfaa5c76 Fix latex error when change-tracked deleted display math starts a new paragraph
LaTeX refuses to break a line when it is empty. But we have to start
a new line here, otherwise the whole displayed equation would be
typeset as it were inline with previous content. The solution is to
put a zero-length space just before the line break. Moreover, this
is the right thing to do, as it simulates the extra space that is
normally added in this circumstance.
2016-10-17 19:35:04 +02:00
Enrico Forestieri
261e7ae9ce Strike out (in the output) deleted display math with track-changes
Showing deleted display math by enabling "Show Changes in Output" was
only possible with dvi (through dvipost). Although LyX strikes out
such formulas on screen, it was impossible obtaining an output
directly using pdflatex (or other engines producing pdf) because
ulem cannot cope with display math material and gives errors.
The solution is to strike out by ourselves such deleted formulas.
I took into account several options. One of them would produce
an output similar to dvipost (which strikes out each element), but
would have required much more changes in the output routines.
Eventually, I opted for using tikz, which gives a more clean
output (as it requires to simply adding a preamble and a postamble
to the latex code of any displayed math, instead of a mark up
tailored to each particular math construct). The look of the pdf
output is similar to the way LyX strikes out the equations on screen.
2016-10-17 03:25:35 +02:00
Guillaume Munch
e0e765f6a9 Get rid of dirty BufferView pointer
Now that there is a signal to inform the controller when the buffer view has
changed, it is no longer necessary to store a perishable pointer to a buffer
view in the dialog view. (Indeed, it was only really useful for checking whether
the new buffer view pointer was different from the old one.)

TODO: other dialogs should be audited for similar hazards.
2016-10-17 00:16:59 +02:00
Guillaume Munch
de19b8fc2d Take advantage of new bufferViewChanged signal 2016-10-17 00:16:59 +02:00
Guillaume Munch
c438d794ff Factor code after buffer change 2016-10-17 00:16:59 +02:00
Guillaume Munch
f4c390712e New virtual method frontend::Dialog::on_BufferViewChanged()
This is called anytime the buffer view attached to the GuiView changes.
2016-10-17 00:16:59 +02:00
Guillaume Munch
9b4926c6e6 Fit cursor and update screen after reverse-search 2016-10-17 00:16:59 +02:00
Guillaume Munch
a95e933f51 Fixes to reverse search
* In doubt, select up to the end of the paragraph

* Correct offset after artificial new lines
2016-10-17 00:16:59 +02:00
Guillaume Munch
01d6333db2 Implement reverse-search in the source panel
Double-clicking on a line in the source panel triggers the selection of the
corresponding line in the Buffer View.
2016-10-17 00:16:59 +02:00
Guillaume Munch
67805de7de New LFUN paragraph-goto id_start pos_start id_end pos_end
This selects from start to end.

id_end must be in the same buffer as id_start.
2016-10-17 00:16:59 +02:00
Guillaume Munch
f42379a7d6 Fix probable omission
Upon close inspection I do not think that this twist was necessary.
2016-10-17 00:16:59 +02:00
Guillaume Munch
1f6c451ee3 TexRow for InPreamble
This enables error reporting for the preamble, provided the preamble is written
using the new InPreamble layouts.

In the future, I find it preferable to deprecate the usual preamble in favour of
InPreamble layouts rather than implementing error reporting for the usual
preamble. This requires some improvements to code editing in the buffer view
first (line breaking behaviour, syntax highlighting).
2016-10-17 00:16:59 +02:00
Guillaume Munch
1b4f5970a4 Streamify a docstring
prepare ground for TexRow InPreamble
2016-10-17 00:16:59 +02:00
Guillaume Munch
1f945177b9 Docstringify getLongString in general and preamble snippets in particular
Prepare ground for TexRow InPreamble
2016-10-17 00:16:59 +02:00
Guillaume Munch
6edbc1da66 TexRow for InsetArgument 2016-10-17 00:16:59 +02:00
Guillaume Munch
676a0639c5 Use otexstringstream for the captions of InsetCaptionables
* Enable TexRow for InsetListings caption.

* Move getCaption* from InsetText to InsetCaptionable.

* Clean-up caption generation for InsetFloat.
2016-10-17 00:16:59 +02:00
Guillaume Munch
f3e099960a Gcc 4.6 compatibility :( 2016-10-17 00:16:59 +02:00
Guillaume Munch
f3256ee2cd texstring and otexstringstream
texstring is a pair of a docstring and a corresponding TexRow. The row count in
the TexRow has to match the number of lines in the docstring.

otexstringstream is an output string stream that can be used to create
texstrings (i.e. it's an odocstringstream that records the TexRow information
and let us extract a texstring from it).

texstrings can be passed around and output to otexstream and otexrowstream,
which produces an accurate TexRow information by concatenating TexRows.
2016-10-17 00:16:59 +02:00
Uwe Stöhr
f179173e42 support for the languages Bosnian, Friulian, Macedonian, Piedmontese and Romansh
- file format change
- note that I could not update the tex2lyx test files because of bug #10440
2016-10-16 15:33:23 +02:00
Juergen Spitzmueller
f089f60f4e Implement wrapping in next-change (#10388). 2016-10-15 16:34:16 +02:00
Juergen Spitzmueller
0eb651a2cf New layout tags for better counter handling
* ResumeCounter: allow to resume an (enumerate) counter
* StepMasterCounter: allow to increase a master counter
2016-10-14 20:08:12 +02:00
Jean-Marc Lasgouttes
84050268ee Remove useless #include
Including MathData.h in InsetMath.h is expensive and not required.
2016-10-14 11:08:04 +02:00
Scott Kostyshak
892593fbdc Change default working directory from ~/ to "."
Note that the lyxrc.document_path variable corresponds to what we
call the "Working directory" in the GUI preferences dialog.

Setting document_path to "." makes it so when LyX is started from a
directory, that directory is the default path for many of LyX's
operations, such as the following:

- new file, new from template
- adding a custom BibTeX file
- GUI compare dialog
- local layout button in document settings
- external material file browser
- graphics browser, include browser

The best guess for where the user wants to save or find files is the
directory the user started LyX from. Before, the default was always
the home directory. If desired, the old behavior can be restored by
changing the default path in Preferences > "Working directory".

This commit takes advantage of 9b64d7bd, which allows the use of a
relative path for path preferences.
2016-10-11 22:25:42 -04:00
Enrico Forestieri
ded8b1b3da Remove context help button hint from file dialogs
This removes the useless '?' button that appears in Windows builds
when using non-native dialogs. Complements cf26d53e.
2016-10-10 01:25:07 +02:00
Scott Kostyshak
f411040a33 Further amend 168d3557 to satisfy GCC 4.6
GCC 4.6 does not support non-static data member initializers.

As Guillaume points out, changing to static does not change the
intent.
2016-10-09 18:08:42 -04:00
Scott Kostyshak
5fd21db9d4 Amend 168d3557
I forgot to append an underscore for the private data member.
2016-10-09 17:22:22 -04:00
Scott Kostyshak
168d355721 Factor out magic zoom minimum to a const member
The limit of 10% is used in both getStatus() and dispatch() to set a
minimum zoom level. Having it centralized makes the code more
readable and makes changing the minimum less error-prone.
2016-10-09 17:18:07 -04:00
Scott Kostyshak
6a0e5571c5 Whitespace 2016-10-09 17:18:07 -04:00
Daniel Ramöller
cf26d53e03 Remove question marks from Windows dialogs 2016-10-09 19:50:34 +02:00
Guillaume Munch
071eed8664 Remove unused variable warning 2016-10-09 19:48:15 +02:00
Guillaume Munch
2717ef114c Add the customary 1-pixel gap before MathMacroTemplate to better see cursor 2016-10-06 01:35:29 +02:00
Guillaume Munch
5aa3164d21 Make the border of hullRegexp pixel perfect 2016-10-06 01:32:21 +02:00
Guillaume Munch
324e5571ca Fix borders of InsetMathGrid
* New virtual functions leftMargin() and rightMargin() to get rid of
  drawWithMargin()

* Factor and rewrite code for borders.

* Fix several offset calculations.

Known issues:

* Borders of multicols look too good and do not correspond to the pdf
  output. (non-regression)

* Bounding box for Hull (Regexp) not pixel-perfect.

* Bounding boxes of Diagram, XYmatrix, are too tight when there are
  borders. Also border should be disabled. (non-regression)
2016-10-06 01:11:49 +02:00
Enrico Forestieri
42a3035709 Amend ccc0e03f
Better adding the break, even if falling through would be Ok,
as LyX requires xcolor when both xcolor and color are requested.
2016-10-05 01:31:14 +02:00
Enrico Forestieri
ccc0e03fdc In mathed, require xcolor instead of color when appropriate
Fixes bug #10417.
2016-10-05 01:18:15 +02:00
Scott Kostyshak
3fefbf7917 Initialize a member variable before it is used
Valgrind spotted a conditional jump depending on an uninitialised
value.

Thanks to Pavel for the help. For more information, see:
https://www.mail-archive.com/search?l=mid&q=20160928204810.e5ylny3raa7jgmgw%40Opti1604
2016-09-30 23:27:13 -04:00
Enrico Forestieri
925f933a19 Force local language switch in IPA insets
Otherwise we get latex errors when using polyglossia.
2016-09-29 18:35:26 +02:00
Guillaume Munch
79a947c904 Work around dangling pointer
A better solution would be to entirely get rid of this borrowed pointer with
unclear lifetime, but this requires to introduce a new signal for when the
buffer view attached to the GuiView has changed.
2016-09-29 12:37:19 +02:00
Guillaume Munch
3d7ede6059 Clarify that the Dialog::lyxview_ pointer is in fact a reference 2016-09-29 12:37:19 +02:00
Guillaume Munch
c663c9ab3c Fix horizontal lines in math arrays
They must end at the end of the last column, not at the start of the last+1
column.
2016-09-29 12:37:19 +02:00
Enrico Forestieri
7e3494c293 Also track local language switches
Until now this was not done for essentially two reasons. The first
one is that local switches are used for short text insertions, so that
they are unlikely crossing environment boundaries. The second one
is that if we have to close a language at the end of an environment
we would be missing the right termination command. As this last
issue can be overcome by simply storing in the stack the current
nest level with a sign denoting the kind of switch, there is no
reason anymore not to track also local languages switches.
Also factor out some commonly used constructs in order to improve
readability.
2016-09-27 23:00:29 +02:00
Enrico Forestieri
e40fa86a97 Do not unnecessarily open the document language
If the document language is opened outside of any environement, we risk
not closing it if no other language switch occurs. Indeed, the stack is
emptied only at the end of an enviroment. We could of course also empty
it at the end of the document, but we would have an unnecessary language
switch.
2016-09-27 21:41:13 +02:00
Enrico Forestieri
f476d9c85a Shut up compiler warning 2016-09-27 21:32:40 +02:00
Enrico Forestieri
6642152e66 Do not rely on math macros being updated
Trying to spare a few cycles by avoiding computing metrics during
screen updates and export. See also 8f86ee74, 72cf7c8f, and e36a8903.
Guillaume will tell whether this also avoids crashing his documents ;)
2016-09-25 20:31:13 +02:00
Enrico Forestieri
3bc80220a7 Amend 6a3ced3c
ERT macros are also math insets, sigh...
2016-09-25 18:59:07 +02:00
Enrico Forestieri
4508a7f855 No need to clutter runparams... 2016-09-25 08:56:12 +02:00
Enrico Forestieri
8c14d9e041 Correctly track opened polyglossia languages
A language switch may also occur outside of output_latex.cpp, apparently.
2016-09-25 08:20:34 +02:00
Enrico Forestieri
6a3ced3cfb Do not confuse global commands with ERT macros 2016-09-25 02:00:55 +02:00
Enrico Forestieri
314e30d5fd Correctly classify macros
Some macros defined in the lib/symbols file are classified are texmode.
But the MathMacro class was missing a currentMode method for returning
this information.
2016-09-25 01:11:16 +02:00
Enrico Forestieri
3bc08a76c4 Sort the language nesting mess with polyglossia
When using polyglossia, lyx was making a real mess when changing
language inside nested insets. The \begin{language} and
\end{language} commands were not well paired such that they could
easily occur just before and after the start or end of an
environment. Of course this was causing latex errors such that
"\begin{otherlanguage} ended by \end{environment}".
There may still be some cases I did not take into account.
2016-09-24 03:15:02 +02:00
Guillaume Munch
b40184ce71 Fix compilation with MSVC 2015 2016-09-24 00:50:03 +02:00
Guillaume Munch
5fbbf0f281 Reverse search: select a whole row
TexRow now returns a range {start, end} when looking up a particular row.

Reverse-search now selects the whole range instead of simply moving the cursor.
2016-09-23 23:39:48 +02:00
Guillaume Munch
c9fc5bf1c6 Fix: shift-mouse selection doesn't work well across insets
(FIXME in the code, no corresponding ticket found even though it is pretty
annoying)
2016-09-23 23:39:48 +02:00
Guillaume Munch
c36ada6b96 Helpers to set selections to arbitrary DocIterators 2016-09-23 23:39:48 +02:00
Guillaume Munch
3fd2398a28 Remove option to disable texrow
I suspect that the gain was negligible, yet it made debugging and maintainance
harder.
2016-09-23 23:39:48 +02:00
Guillaume Munch
f0959cc292 explicit operator bool 2016-09-23 23:39:48 +02:00
Guillaume Munch
f1582a2acb Fix type of pos 2016-09-23 23:39:48 +02:00
Guillaume Munch
a4c17ac937 TexRow: clean up and simplify
In particular merge the current_row_ with the rowlist_, which simplifies the
logic.

Pass by value for small PODs.
2016-09-23 23:39:48 +02:00
Jean-Marc Lasgouttes
7cbc0c16a8 Simplify the code that sets the read-only emblem in status bar
Actually QIcon is able to handle transparently the svg icons.

Patch from Enrico.
2016-09-23 11:18:28 +02:00
Günter Milde
63f41711cb Fix #10394 Do not error on missing characters in "nullfont".
Add an exception to the conversion of "missing character" warnings into errors.

The PGF package deliberately uses the dummy font "nullfont" to suppress output.
Therefore, warnings about missing characters in "nullfont" are really only warnings.

Also updated the comment: "Missing character" warnigns are especially widespread
in XeTeX/LuaTeX but can also happen with "classical" 8-bit TeX.

Feel free to port this to branch.
2016-09-23 09:04:03 +02:00
Guillaume Munch
ca58674267 Better title for ViewSource
The title is changed to "LaTeX (pdflatex) Preview", etc. depending on the
format. The actual default format is computed.

The menu name "Source Pane" is replaced by "Code Preview Pane" to better reflect
its purpose.
2016-09-21 16:42:38 +02:00
Jean-Marc Lasgouttes
db12707655 Do not hardcode required packages for Note inset
This does not change the default behavior, but allows to customize it.
2016-09-21 16:11:53 +02:00
Jean-Marc Lasgouttes
bbe36ce6ce Do not use em dash in window title
It seems that only KDE does that. Gnome does not, Windows does not either.
I do not think that we can/want to detect a KDE environment at run-time.
2016-09-21 13:56:28 +02:00
Jean-Marc Lasgouttes
d12ebb00b9 Make *-lyxformat-* backup files use .lyx~ extension
At least now that look like real backup files
2016-09-21 13:11:20 +02:00
Juergen Spitzmueller
b941d93974 Amend 2c4673af58
Also consider xrefs in crossref'ed entries.
2016-09-20 11:34:17 +02:00
Juergen Spitzmueller
67da1431de Improve info display for biblatex databases, part III
When resolving biblatex's xdata references, consider that xdata fields
can contain a comma-separated list of keys, not just a single key like
crossref.
2016-09-19 19:09:42 +02:00
Guillaume Munch
8da87f9dbf amend 4d991120 2016-09-18 14:43:26 +01:00
Juergen Spitzmueller
1c725c913c Regex fix for endyear
As of biblatex 3.5, years and endyears can be negative (BCE).
2016-09-18 12:59:43 +02:00
Juergen Spitzmueller
2c4673af58 Improve info display for biblatex databases, part II
In addition to the classic crossref, biblatex introduces xdata
references in order to source-out common data of entries. Entries
that have "xdata = {somekey}" just inherit all fields from the
respective @xdata entry, if the field is not already defined in
the entry itself (just like crossref, with the exception that @xdata
entries themselves are _never_ output on their own). @xdata entries can
themselves inherit to other @xdata entries (ad infinitum). So you can,
for instance, setup an xdata entry for a book series with series name
that inherits an xdata entry with information of the publisher
(publisher, address). Any book of that series would just need to refer
to the series xdata and add the number.

BiblioInfo now checks, in addition to crossrefs, for such xdata
references and inherits missing fields.

Nte that biblatex also introduces an "xref" field as an alternative to
crossref. We must not care about that, since the point of xref is that
it does not inherit fields from the target (just cites that one if a
given number of refs to it exist)
2016-09-18 12:44:12 +02:00
Juergen Spitzmueller
ba17193067 Improve info display for biblatex databases
If an entry does not have a year field, check for a date field
(the common type in biblatex databases) and extract the year(s).

Candidate for branch.
2016-09-18 10:33:33 +02:00
Juergen Spitzmueller
7d4292918e Remove unnecessary directives and preset search on fly. 2016-09-18 09:10:24 +02:00
Juergen Spitzmueller
f1ae30919f Connect filter reset button and remove unnecessary directives. 2016-09-18 09:02:23 +02:00
Enrico Forestieri
ade098e289 Improve systemlyxdir handling
Do not assume that the /systemlyxdir path prefix in \origin refers
to the system directory of the running instance, but check through
some heuristics what the real system dir is. In this way, a document
in the system dir of any other LyX installation is correctly spotted
and the \origin tag properly updated. For example, one can use an
installed version of lyx to edit a document in the lib/doc dir of a
git repo and obtain the same result as when running lyx in place.
2016-09-17 22:38:27 +02:00
Juergen Spitzmueller
47ea77a8d7 Fix string 2016-09-17 13:06:41 +02:00
Juergen Spitzmueller
774becf693 Clean up the crossrefs dialog. 2016-09-17 13:03:33 +02:00
Juergen Spitzmueller
3294b16bf6 Keep citation style settings bot within and between sessions.
Fixes: #10256
2016-09-16 19:39:53 +02:00
Juergen Spitzmueller
0c1a023c70 Citation dialog: add & improve tooltips. 2016-09-16 13:47:26 +02:00
Juergen Spitzmueller
5225418d8a CitationUi: Fix small layout glitch 2016-09-16 10:35:06 +02:00
Juergen Spitzmueller
824e24ca60 Citation dialog redesign 2016-09-16 09:21:04 +02:00
Enrico Forestieri
c4aca5705b Correctly distinguish ERT macros from predefined ones such as \alpha 2016-09-16 02:15:52 +02:00
Enrico Forestieri
a26e75cd8a Correctly distinguish LyX macros from those defined in ERT
At this time the MacroData of a macro is still uninitialized,
so the macro() method always returns null.
2016-09-16 00:43:04 +02:00
Enrico Forestieri
364e8d6692 Avoid inserting spurious \text insets in mathed
This amends 5cdbaf51.
2016-09-16 00:37:04 +02:00
Enrico Forestieri
1b7dea5c2f Do not prematurely close \ensuremath or \lyxmathsym on export 2016-09-16 00:32:35 +02:00
Enrico Forestieri
e36a8903d7 Really fix the problem with not updated macros
Revert to the strategy used at 8f86ee74 but not using mathedWordList
because it may be still uninitialized at load time. Instead, use the
globalMacros method for getting the same info.
There was a thinko at 8ec91e80, because globalMacros always returns
null for user defined macros.
2016-09-15 02:39:30 +02:00
Jean-Marc Lasgouttes
9313f8565b Set window title before stting modified state
Fixes message "QWidget::setWindowModified: The window title does not
contain a '[*]' placeholder" when opening a non-existent file.
2016-09-14 22:37:06 +02:00
Juergen Spitzmueller
c0a425a319 Move wrap check for simple search/replace to lyxfind
This gets rid of some dirty dispatch tricks and fixes wrap-around
on replace and in the spellchecker

Fixes: #10378
2016-09-14 10:23:39 +02:00
Enrico Forestieri
72cf7c8f1f Partly revert the bits of 8f86ee74 that are not necessary anymore after 8ec91e80 2016-09-14 02:51:56 +02:00
Enrico Forestieri
8ec91e804a Make sure not to use a pointer that may be bogus
It may happen that mathedWordList is not still updated at load time,
so we would still be using a bogus pointer. Better fetching the
necessary info from the global macro table.
2016-09-14 02:27:18 +02:00
Günter Milde
f2a263e334 tex2lyx: Remove "textglobfall" hack.
tex2lyx tests for TIPA (test-inset-*) resulted in {End} in ERT after fixing lib/unicodesymbols.
Should be fine now.
2016-09-13 22:23:53 +02:00
Enrico Forestieri
8f86ee74cd Make sure that math macros are updated at export time.
The math macros system is quite complex. Macros are updated during
metrics calculation, so a missing update is very likely to cause a
crash. This commit tries to assure that they are updated at export
time, which also happens when the table of contents is updated.
Moreover, in order to circumvent a possible missing update, when
a math macro is detected we try to avoid using the sym_ member
of the MacroData class, as it may contain bogus values.
2016-09-13 08:02:02 +02:00
Günter Milde
99eeb29e58 tex2lyx test: make box-color-*.tex sample compilable
Load required package textcomp.
Replace call to non-existent packages textcyr and textgreek with the backup definition of the commands as done by LyX export.
Do not load marvosym (clash with pifont) (LyX does not load the package either).
Remove invalid command \\ascii.
2016-09-12 11:46:30 +02:00
Kornel Benko
e78e58a7de Cmake build: Shuffle code around. 2016-09-12 11:04:14 +02:00
Enrico Forestieri
a24033ff0e Ensure consistency
On export, a macro defined in ERT (or not defined at all) is left
in the same environment it is entered. So, don't explicitly insert
it in an ensuremath environment when it is entered in a textmode one.
2016-09-12 07:55:38 +02:00
Enrico Forestieri
615c733844 Make sure a pointer is valid before using it 2016-09-12 05:15:00 +02:00
Scott Kostyshak
d3c63f97c4 Update tex2lyx test reference after 754cb3d1
From Günter [1]:

  the difference is the textcommand for ETB which changed from
  {\ascii\ETB} to

  0x21a8 "\\ETB"                    "ascii" "force=utf8" # UP DOWN
  ARROW WITH BASE

  because the former resulted in

  l.513 \ascii
              \ETB{}
  ! Undefined control sequence.

[1]
https://www.mail-archive.com/search?l=mid&q=nr48qn%242gb%241%40blaine.gmane.org
2016-09-11 17:52:02 -04:00
Kornel Benko
050d817605 Cmake build: Add qt-svg-lib to be linked with lyx if used QT4.
Probably due to commit 82808fe, there were undefined references
such as e.g. QSvgRenderer::~QSvgRenderer().
2016-09-11 15:34:58 +02:00
Enrico Forestieri
2aa930bbe8 Fix display and export of some latex macros
Fixes #9742.
2016-09-10 18:32:44 +02:00
Enrico Forestieri
cb70946960 Fix bug #9616 2016-09-10 13:36:45 +02:00
Günter Milde
99310b7e3f Fix export of Unicode characters (Unicode blocks <=72)
Fix problems revealed by hand-compiling an examining the test samples in autotests/export/Unicode-characters/:

* new definitions
* fixed definitions
* "force=utf8" when required
* some IPA symbols fail without the "extraipa" package
* fix direction of "textcommaaboveright"
2016-09-10 12:35:51 +02:00
Juergen Spitzmueller
4c27c921f0 Minor amendment to b95262f487
Just for consistency.
2016-09-10 10:32:40 +02:00
Enrico Forestieri
5cdbaf51ee Avoid duplicating mode changing commands 2016-09-10 02:39:57 +02:00
Enrico Forestieri
324651899e Ensure proper mode in mathed
A math-mode command entered in a text-mode environment is wrapped
in an ensuremath inset, as well as a text-mode command entered in a
math-mode environment is wrapped in a text inset. Who doesn't like
the extra insets can always dissolve them and rely on the wrapping
performed on export.
2016-09-10 02:07:47 +02:00
Georg Baum
a6be519a81 Fix data loss with [ in first cell of aligned
If the first character in the first cell of an aligned math environment is
'[', and the environment does not use top or bottom vertical alignment,
then LyX did write the '[' unprotected so that it got misinterpreted as
optional argument, both when reading the .lyx file in LyX and when reading
the .tex file in LaTeX => data loss!
The fix is to output an empty optional argument in this case, which is
interpreted as default alignment both by LyX and LaTeX. It would also be
possible to output \[ in the first cell instead, but this would be more
difficult to implement.
2016-09-08 22:38:33 +02:00
Georg Baum
a931e84e8b Prepare for mutlicolumn lines
The \multicolumn command allows to set vertical lines for individual rows.
These are not yet displayed, but if they are supported one day, the code in
a27ff13663 needs to be adjusted. This change hints at the adjustment.
2016-09-08 22:01:22 +02:00
Jean-Marc Lasgouttes
a27ff13663 Set vertical lines in math arrays correctly on Y axis
This is a fixup to commit 39329935. The two fixes are
* add forgotten offset `y' when drawing the line
* in order to have a continuous vertical line, draw from the offset of
  the previous row.

Fixes bug #10363.
2016-09-08 16:30:25 +02:00
Jean-Marc Lasgouttes
82808fea04 Set window title according to platform UI
The window title is built from the current file name and its
mofidication state. We use our own code instead of the automatic title
bar provided when windowFileName() is set because

1/ Qt does not keep the full path name
2/ Qt does not yield a nice application name

The "read only" and "version control" status are shown in the status bar:

* for read only we use the tab read only emblem (with the right size)
* for version control, we show the name of the backend (using a new
  vcname() method of the backend).

The iconText() of the view is not updated anymore, since this is
deprecated in Qt5.
2016-09-08 15:59:44 +02:00
Juergen Spitzmueller
b95262f487 Sanitize Ref dialog validation.
Fixes: #10376
2016-09-08 15:04:58 +02:00
Georg Baum
646d47ae93 Fix filter filter regex
Now the external material file dialog shows the file types defined in the
template again. Before this fix it did only show "All files (*)".
I don't know what the old syntax was supposed to do or whether it ever worked
with boost::regex, but with std::regex the new one is correct.
2016-09-05 22:49:59 +02:00
Jean-Marc Lasgouttes
72837fec5c Amend commit e194c9ce27
As noted in the log, this commit was a bit radical and needs some
adjustments (which was expected, actually).

Let InsetText do their own background drawing.

Fixes bug #10359.
2016-09-05 11:06:01 +02:00
Juergen Spitzmueller
b5c0694856 Amend 97b9e81cee
\@ifundefined is an If-Then-ELSE construct.
2016-09-04 17:44:47 +02:00
Scott Kostyshak
1a374a931b Exit with error if child exits with error (#10188)
Before, it could have been the case that

  lyx -e pdf2 file.lyx

had exit code 0 even though file.lyx includes a file that exits with
error. If compiled in the GUI a warning was given, but from the
command line exit code it would seem there was no problem. The exit
code for this case is now non-zero and the word "Warning" is now
removed from the message because it should be treated as an error.

An exception is thrown from InsetInclude and is caught in
Buffer::makeLaTeXFile() and added to the error list.

The (similar) use case at #8840 is also fixed by this commit.
2016-09-02 18:24:14 -04:00
Jean-Marc Lasgouttes
da30e38400 Remove unused 'glue' parameter
It was probably useful at some time, but not now.
2016-08-30 17:21:18 +02:00
Jean-Marc Lasgouttes
78ae499355 Remove unused struct members
Interestingly, cppcheck detected that they were not initialized (see
8a047a41), but not that they were unused.
2016-08-30 17:08:49 +02:00
Scott Kostyshak
03684ae05e Improve status check of LFUN_BUFFER_ZOOM_{OUT,IN}
buffer-zoom-out can actually zoom in (by giving a positive number as
the argument), so it should only be disabled at the minimum zoom
level if it is indeed zooming out.

Similarly, buffer-zoom-in can zoom out, so it should be disabled if
the user is at the minimum zoom and it is called to zoom out.

This commit amends 8884c404.
2016-08-30 10:25:45 -04:00
Jean-Marc Lasgouttes
68d825fed8 Amend b583fb26e8
It failed in the case where a selection already existed (the anchor would be wrongly reset).
2016-08-29 12:03:33 +02:00
Guillaume Munch
4d99112056 Action.cpp: replace a reference with a shared_ptr
Replace the member reference to FuncRequest in Action.cpp with a
shared_ptr. Compared to copying the FuncRequest, the shared_ptr has two
advantages:

* Recreating the menu each time creates a lot of new actions, so we avoid a lot
  of copies.

* FuncRequest can remain forward-declared in Action.h.
2016-08-28 22:49:21 +01:00
Guillaume Munch
0779b3c36c Change "Format" into "Formats"
The plural form seems more appropriate and the tag [[output]] is added for
disambiguation (e.g. for the French translation).
2016-08-28 18:26:58 +01:00
Richard Heck
5018e1077b producesOutput() should not be redeclared as producesOutput(bool). 2016-08-28 00:04:02 -04:00
Guillaume Munch
76d0c6759f Trivial clean-up 2016-08-28 02:34:54 +01:00
Guillaume Munch
cb0a4c6639 Fix Unicode use in Format's prettyname
The field prettyname can accept Unicode and therefore must be parsed into a
docstring.

Little simplification of the code on the way.

* For other fields, either a validator should be set to prevent non-ascii input
  in the preferences, or they should be transformed into docstring too.
2016-08-28 01:30:53 +01:00
Guillaume Munch
efbec20320 Fix the compare_locale function by relying on Qt's (#9030) 2016-08-28 01:30:53 +01:00
Juergen Spitzmueller
40d9c6ec48 Implement proper dialog titles in InsetParamsDialogs
Fixes: #10329
2016-08-26 11:35:12 +02:00
Jean-Marc Lasgouttes
2ad52918da Do not set layout for no-op paragraph break
When breaking paragraph in an empty top-level paragraph, nothing
happens on screen but yet there is an undo step because the layout is
reset to what it already was.

Avoid this case.

Fixes bug #10089.
2016-08-24 15:29:17 +02:00
Jean-Marc Lasgouttes
07c7dae367 Move correctly the end of proof marker when row is large
This was a regression from 2.1.x in LtR mode, and it never worked correctly in RtL mode.

Fixes bug #10344.
2016-08-23 17:45:21 +02:00
Jean-Marc Lasgouttes
b583fb26e8 Reset anchor before selecting with S-button1 2016-08-23 12:22:35 +02:00
Jean-Marc Lasgouttes
65b0e84b54 Let M-x give focus to minibuffer when it is already open 2016-08-22 18:20:09 +02:00
Guillaume Munch
193cda6e48 Remove unused variable warning and remove preprocessor switch. 2016-08-22 00:04:30 +01:00
Enrico Forestieri
6adf079796 Quote filenames used for forward-search with SumatraPDF
Single quotes are special to our parser and must be either escaped or
quoted if they are part of a filename, otherwise they are stripped out.

See #10342.
2016-08-21 23:33:01 +02:00
Enrico Forestieri
589f49ff36 Use only one file for dummy implementations 2016-08-20 00:41:04 +02:00
Jean-Marc Lasgouttes
4ddad2f6cd Remove horizontal spacing around previews
This concerns the preview version of InsetPreview and InsetIPA.

Fixes bug #10304.
2016-08-19 15:01:18 +02:00
Jean-Marc Lasgouttes
e7a33cacf1 Simplify menus when there is only one caption type
This removes the submenu indirection in Insert and the type changer in
contextual menu. Interestingly, the code was there, but it did not
work at all.
2016-08-19 14:07:08 +02:00
Kornel Benko
3c9d5d3cda Cmake build: Add verbose variable to some dummy_functions.cpp 2016-08-19 11:15:10 +02:00
Scott Kostyshak
0b1cf1330d Warn in GUI when mixing Title and InTitle layouts
Since we process layouts sequentially, we export LaTeX code for the
title once we arrive to a layout that has InTitle false. If the
document then later has a layout with InTitle true, we do not
(currently) go back to add it to the title and just output it
in-place. We previously warned with LYXERR0, but since this can
cause missing or unexpected output we now warn in the GUI.

For more information, see the following lyx-devel thread:
https://www.mail-archive.com/search?l=mid&q=a65ae226-d3bd-8fc5-a93b-7bb23f1cda82%40lyx.org
2016-08-18 18:06:04 -04:00
Enrico Forestieri
fb46b3a1ee Fix exit code from runCommand on Windows
On Windows, runCommand has never returned the exit code of the
spawned process but the result of correctly closing the input handle.

Fixes #10327
2016-08-17 22:58:13 +02:00
Enrico Forestieri
2a371bb4b3 Add verbose option
Using the option -v (--verbose) all spawned commands are print
on the terminal. Note that this was done by default on previous
versions.
2016-08-17 22:32:14 +02:00
Jean-Marc Lasgouttes
6e88c0062c Use proper QPalette::NoRole enum value instead of our own 2016-08-17 12:10:25 +02:00
Jean-Marc Lasgouttes
e194c9ce27 A more radical approach to inset background painting
Now by default all insets paint their own background when needed. This
means that 63cf3297 and part of 9940acc5 can be reverted.

To avoid extra painting, background drawing is disabled for
InsetCommand and InsetCollapsable. These insets draw background as
part of their normal drawing activity.

This will avoid drawing artifacts with InsetNewpage, InsetVSpace and
probably some others.
2016-08-17 12:05:00 +02:00
Jean-Marc Lasgouttes
6f82f51cbe A PainterInfo variable should be named `pi'. 2016-08-16 14:31:20 +02:00
Guillaume Munch
5ded0d002d Assertions when doing Export As... (#10321)
Fix assertion with gcc 6: The comparison function must be a strict weak
orderings and not give x < x.

Fix assertion when a custom exportable document format is given a non-ASCII
name. Use qt_ to be consistent with the rest of the code.

Use Qt's locale-aware comparison for appropriate sorting.
2016-08-15 13:23:29 +01:00
Enrico Forestieri
f323a64fc3 Adapt code to comment 2016-08-15 03:22:01 +02:00
Enrico Forestieri
7113fb669d Correct comment
According to C++11 rules, static locals are thread safe for
the first-time initialization.

See also:
http://stackoverflow.com/questions/12302057/c11-safe-double-checked-locking-for-lazy-initialization-possible
2016-08-13 17:43:03 +02:00
Scott Kostyshak
c949268da7 Improve a layout LYXERR0 message
The name of the layout is now included in an error message about
layouts. This will help with finding the root issue of several
documents we have.
2016-08-08 23:44:27 -04:00
Richard Heck
20328c4a44 Update tex2lyx tests. 2016-08-08 16:47:33 -04:00
Enrico Forestieri
41e409f8f7 Use std::call_once only if it is actually available 2016-08-07 04:58:41 +02:00
Richard Heck
3be23d18b6 Fix XHTML export of German Additional Features manual.
There was an oddity in the manual that exposed a problem with the
test for the "special case" of an inset all by itself in a pargraph.
If a font change is applied to that inset, we still need to open the
paragraph.
2016-08-04 22:43:17 -04:00
Richard Heck
0c1dd609f3 Debugging code. 2016-08-04 22:00:24 -04:00
Richard Heck
0a603c5d0e We don't need to crash here, but can try to continue in release
mode.
2016-08-04 22:00:18 -04:00
Richard Heck
f15c4159aa Special characters should be output to the TOC. 2016-08-04 21:09:32 -04:00
Richard Heck
8d65a6d277 Fix bug #10320.
Layout::write needs to allow for the possility that the name of the
style may contain a space. It seems sufficient just always to quote it.
2016-08-04 17:45:40 -04:00
Jean-Marc Lasgouttes
63cf3297f8 Let InsetSpecialChar draw its background when necessary
This is the same fix as in 9940acc5 for auote inset and math macro template.
2016-08-04 23:21:33 +02:00
Guillaume Munch
0e672fed21 Partially revert "Replace static with thread_local when used for caching"
As noticed by Stephan, clang on Mac is nowhere near to support thread_local for
some reason:
http://stackoverflow.com/questions/28094794/why-does-apple-clang-disallow-c11-thread-local-when-official-clang-supports

It does not look realistic to me to provide a configure-based alternative. The
solution is to not use thread_local until it is reasonably supported on
Mac. According to sources, this means requiring Xcode >= 8.

This reverts commit 82d4f1a446 partially.
2016-08-04 13:39:27 +01:00
Juergen Spitzmueller
90f6eb01a4 Include all [scr]article styles in beamer article layouts.
File format change. On format reversion, we need to put some extra code
in the local layout that emulates the 2.3 behavior.
Simply Input'ing the respective layouts is unfortunately not enough,
due to the insertion order.

See #9977
2016-08-04 11:42:06 +02:00
Juergen Spitzmueller
b9b9ad3f9e Correct backends() allocation with japanese encoding
Fixes error introduced by ad9887da9c.
2016-08-04 10:01:06 +02:00
Scott Kostyshak
52ae8fb22b Activate LyX window after reverse search (#10196)
"lyxclient -g" now calls the just implemented lyx-activate (see
previous commit) after server-goto-file-row. This allows the PDF
viewer to switch to LyX after executing a reverse search.
2016-08-04 01:46:15 -04:00
Scott Kostyshak
60515b996b New LFUN lyx-activate to focus LyX window
On Linux and Mac OS, this action brings the LyX window into focus.
Such behavior is not allowed by Windows OS so instead the color of
the taskbar entry is changed to indicate that the window has changed
in some way.

The action is hidden in the shortcuts menu because it would make
sense to assign a shortcut to it. The only way to execute shortcut
would be if the LyX window is already activated.

lyx-activate will be used (see next commit) to allow the PDF viewer
to switch to LyX after executing a reverse search.
2016-08-04 01:46:13 -04:00
Guillaume Munch
096afc733b Fix embarrassing logic mistake
Thanks Richard for pointing at it.
2016-08-03 22:17:26 +01:00
Richard Heck
16d39b1f83 Fix problem noticed by Scott. 2016-08-02 18:54:31 -04:00
Richard Heck
f1b748e42b No need to display contents of the branch when it is open.
Thanks to Vincent for noticing.
2016-08-02 16:33:18 -04:00
Guillaume Munch
82d4f1a446 Replace static with thread_local when used for caching
thread_local is a per-thread static variable, so it is thread-safe and can be
used for caching purpose.

Remove the cache for parameter lists as discussed on the list
http://mid.gmane.org/6e871431-0e87-ed2a-3e31-b63356c2391e@lyx.org.

(requires gcc >= 4.8)
2016-08-01 23:44:16 +01:00
Guillaume Munch
0090af19d3 Fix aliasing logic for polylines 2016-08-01 20:50:46 +01:00
Guillaume Munch
a584c8176d Enable to specify the target format for converting the local layout
* New constant LYXFILE_LAYOUT_FORMAT in src/TextClass.cpp. This determines the
  layout format corresponding to the current lyx file format.

* The Local Layout pane is changed so that the "Convert" button does not convert
  to the internal layout format but to the current lyx file format, to make sure
  that the file does not become unreadable with a specified earlier version of
  LyX.

* If LYXFILE_LAYOUT_FORMAT == LAYOUT_FORMAT then LyX behaves as before. This is
  the value defined in master.
2016-07-31 18:34:33 +01:00
Guillaume Munch
0a8b7f6a57 Perf comments: getFormatFromFile slows LyX startup considerably
It is currently called on hundreds of files: settings, layouts, icons, cached
graphics files (incl. graphics from files that are not opened on startup).

According to callgrind, fixing the FIXME comments could speed up startup by more
than 30%.
2016-07-31 18:34:33 +01:00
Guillaume Munch
22d7ba6424 Use call_once to ensure something is only called once
This is thread-safe.
2016-07-31 18:34:33 +01:00
Guillaume Munch
46d8dfc6c2 Make static counters atomic
This ensures thread-safety

(requires: gcc >= 4.6, MSVC >= 2015)
2016-07-31 18:34:33 +01:00
Guillaume Munch
2fd2e65745 C++11 supports thread-safe initialization of statics
A static local variable is guaranteed to be initialized only once, and in time.

Lambda expressions can be used to perform complex initialization of those static
variables on the spot.

(starting from: gcc >= 4.8, msvc >= 2015)
2016-07-31 18:34:33 +01:00
Guillaume Munch
4d7b912ca1 Fix "scroll here" feature of scrollbar (#10311)
Prevent setRange() from causing a recursive call to scrollTo(). Reduces three
calls of scrollTo() to one call for all scrolling functions of the scroll bar
(e.g. clicking on the arrow, dragging, or clicking somewhere on the scrollbar).
2016-07-31 18:34:33 +01:00
Guillaume Munch
bc8eb059db Basic implementation of QSignalBlocker for qt4 2016-07-31 18:34:33 +01:00
Richard Heck
98feadd61e Fix output of floats, etc, inside environments.
Fixes bug #9094.
2016-07-31 03:18:32 -04:00
Richard Heck
9e5a42edbf Rename, for a little clarity. 2016-07-31 03:03:26 -04:00
Richard Heck
07dcb1c525 Add 'dir="auto"' to the body tag for XHTML export. This should take
care of much of what we need to do for RTL languages. It does not
take care of inline language changes, probably.
2016-07-31 02:52:30 -04:00
Richard Heck
6fe499509a Alignment 2016-07-31 02:49:38 -04:00
Richard Heck
ab3a49973f Fix display of code listings in XHTML.
Fixes bug #8362.
2016-07-31 01:47:30 -04:00
Richard Heck
daf7cd4c05 Activate export of external material for XHTML.
As of this commit, this is ineffective, since no changes have been
made to external_templates.
2016-07-31 01:26:15 -04:00
Richard Heck
6b97f2c075 Fix substitution for $$Contents.
The second argument here is the length of the string to replace,
not the position of the final character.
2016-07-31 00:15:48 -04:00
Richard Heck
93a612220e Fix preview of external material with plaintext and DocBook. 2016-07-30 23:48:27 -04:00
Richard Heck
47c52db13e Use scaling factor in XHTML output. 2016-07-30 21:57:52 -04:00
Richard Heck
e1f597e3da If we cannot find the input format for a graphic, we cannot convert it.
Also includes some minor code cleanup.
2016-07-30 21:51:25 -04:00
Richard Heck
e2fa3cb6ef Fix output of table borders for XHTML. Fixes bug #10154. 2016-07-30 20:15:12 -04:00
Richard Heck
eeb6b5b153 Revert most of dd7863b6.
I did not mean to commit the caption-related stuff.
2016-07-30 01:42:08 -04:00
Richard Heck
aad0802b53 Whitespace. 2016-07-30 01:35:22 -04:00
Richard Heck
dd7863b6ac Fix thinko from earlier commit.
We need to output the deferred material AFTER the paragraph is closed.
2016-07-30 01:29:06 -04:00
Richard Heck
60ce2b7570 Fix HTML display of math matrices. 2016-07-30 00:25:09 -04:00
Richard Heck
752c89ae13 Fix CSS for math cases.
Fixes bug #8755.
2016-07-30 00:15:47 -04:00
Richard Heck
50c1391950 Simplify CSS classes for floats.
Fixes bug #8605 and probably parts of #8755 and #9328.
2016-07-30 00:03:35 -04:00
Richard Heck
f1cd24243f Be more careful with braces, due to comments. 2016-07-29 23:59:24 -04:00
Richard Heck
76e6c77825 Simplify and unify code for special handling in argument insets. 2016-07-29 23:38:51 -04:00
Richard Heck
96a8156557 Fix display of colors in labels of arguments.
We need to handle this specially, just as we do the main font.
2016-07-29 23:36:48 -04:00
Richard Heck
cbbae06c9b Fix display of branch buttons and tooltips. 2016-07-29 22:58:03 -04:00
Scott Kostyshak
c659fd4f74 Remove the now unused lyx::support::expandPath()
The function is no longer used in LyX's sources (as of the previous
comit, 9b64d7bd) and is thus removed with this commit. Perhaps the
advantage this function had over other path functions we have has
disappeared over time (see e.g. 1a7b7f65).
2016-07-29 13:17:09 -04:00
Scott Kostyshak
9b64d7bd24 Rel. path in paths prefs preserved as rel. paths
Before this commit, in the paths preferences tab if you put a
relative path, LyX would convert it behind the scenes to an absolute
path by evaluating the relative path with respect to the working
directory of the LyX instance where the preference change is taking
place. This seems confusing because (1) it is done behind the scenes
(after the preferences dialog is closed) and (2) if the user chooses
to enter a relative path, the safest thing to do is to preserve it
as a relative path, instead of making the assumption that the user
intended for it to be expanded to an absolute path.

An explanation of how relative paths are handled is given at the
bottom of the paths tab. Note that the height/width of the
preferences window is not changed as a result of adding this
explanatory comment because the height of the preferences dialog is
already stretched by other tabs.

This commit improves consistency in the sense that the behavior of
LyX is now the same when a relative path is specified in the
preferences dialog as when it is manually specified in the
preferences file. Before, if the preferences file were manually
edited and a relative path were inserted, the next time the user
made a change to preferences with the GUI (even if the preference
change was a different preference, e.g. instant preview), the
relative path would be silently converted to an absolute path,
evaluated with respect to the working directory of that instance.

Beyond improving clarity and consistency (IMO), this commit allows
for a new feature to be implemented of using relative paths in the
paths preferences. For example, the user may now enter '.' as the
"Working directory" path and now whenever they start LyX from a
directory and create a new file, the default location of the file
will be the directory from which they started LyX, instead of the
user's home directory which is LyX's default and is less intuitive.

No prefs2prefs work is needed because if a relative path were
entered in the preferences dialog before this commit, it was
converted to an absolute path before being stored in preferences. If
a relative path were specified by manually editing the preferences
file, then (unless the path were already automatically converted to
an absolute path by a GUI preferences change, as described above)
the behavior will be the same (the path will be treated as a
relative path).

For related discussion, see the lyx-devel thread here:
https://www.mail-archive.com/search?l=mid&q=20160616003010.bnymtcouar7g55ti%40cotopaxi

This commit removes the last use of lyx::support::expandPath() in
LyX's sources.
2016-07-29 13:13:55 -04:00
Scott Kostyshak
60e8921349 Const a function parameter 2016-07-29 13:09:54 -04:00
Scott Kostyshak
badb0bb96c Improve implementation of TabWorkArea::posIsTab()
The Qt documentation states that tabAt() returns -1 if the position
is not over a tab. This behavior has been consistent since Qt 4.3
[1]. This commit's improvement likely makes the code faster in two
ways:

(1) we do not need to loop through potentially all tabs
(2) we only need to look up the tab index corresponding with one
position

posIsTab() is not currently used intensively so no practical gain in
speed is achieved, but it protects against future use.

[1] https://doc.qt.io/archives/4.3/qtabbar.html#tabAt
2016-07-29 13:09:48 -04:00
Scott Kostyshak
4803c7697b Close a tab on middle-click (#10288)
This is the default behavior of Chromium and Firefox. The main
appeal is that instead of having to precisely click on the 'x' to
close a tab, one can more easily middle-click anywhere in the tab.

The tab is closed if the middle button is pressed on a tab and is
relased on the same tab. After pressing, the user may move the mouse
over other tabs but as long as they move it back to the tab where
they initiated the press before they release, the close will
execute. This is how the feature works in Chromium and Firefox.

Nothing is done if the user middle-clicks on the blank part of the
tab bar. This is consistent with Chromium. Firefox, on the other
hand, opens a new tab. In LyX one can already double-click the blank
part to open a new tab, and in feedback from lyx-users [1] most
expected and desired that nothing be done in this case.

[1] https://www.mail-archive.com/search?l=mid&q=20160720063306.6fyarf3kywexbxvd%40steph
2016-07-21 22:31:29 -04:00
Scott Kostyshak
b236450e61 Factor out useful code into a function
This code will be shared by TabWorkArea::mouseReleaseEvent,
which will be implemented shortly.
2016-07-21 22:31:29 -04:00
Scott Kostyshak
07be240ebe Add comment that a code chunk is unnecessary
A chunk of code in an event handler seems to be unnecessary to me
because the event that the situation handles never makes it this far
in the event handling hierarchy. I'm not sure why this is, and thus
I'm not sure if this is true in all cases (e.g. Qt version) and if
it will be true in the future so I leave this code for now.
2016-07-21 22:31:29 -04:00
Jean-Marc Lasgouttes
71374b38c2 Recompute Paragraph::beginOfBody() earlier
In redoParagraph, this should be done before coping with the insets,
other wise some graphic gliches may occur. This is a better fix for

Fixes bug #10163.
2016-07-21 10:21:45 +02:00
Jean-Marc Lasgouttes
b9c7594167 Revert "Reset beginOfBody() when changing paragraph layout"
This reverts commit ef8e499821.
2016-07-21 10:15:39 +02:00
Jean-Marc Lasgouttes
ef8e499821 Reset beginOfBody() when changing paragraph layout
This looks like a trivial thing to do, and it avoids some drawing problems.

Fixes bug #10163.
2016-07-21 01:56:22 +02:00
Jean-Marc Lasgouttes
c73923c519 When painting only insets, paint also change and language marks
Fixes bug #8133.
2016-07-20 23:25:17 +02:00
Kornel Benko
64b2989020 Cmake build with Qt4: Link lyx executable also to X11 library
With the commit cb0c881 we reference XSendEvent in X11-lib
if qt uses X11.
For QT5, this library is pulled by Qt5X11Extras, but
for QT4 we have to add it too.

Spotted by Scott Kostyshak.
2016-07-20 02:10:23 +02:00
Jean-Marc Lasgouttes
9940acc506 Try to fix #4889 in the right way
For reference, the bug was that quote insets grew bolder because, when
painted over themselves, anti-aliasing made them darker.

It turned out that the fix there created others than were
painstakingly fixed: #7164, #7165, #7174, #7193... More recently, it
created other problems:
http://article.gmane.org/gmane.editors.lyx.devel/163471

We use the right fix here:
* draw background of quote inset when not doing full repaint
* draw background of math macro template when not doing full repaint
* remove hack that grew from #4889 fix.
2016-07-20 00:24:24 +02:00
Jean-Marc Lasgouttes
e35110eab7 Realize inset argument label font before using it 2016-07-19 22:29:57 +02:00
Scott Kostyshak
3826ff6434 Improve documentation of LFUN_BUFFER_ZOOM_{IN,OUT}
The default for ZOOM_OUT is -20 from a user perspective. That is,
the following are equivalent:

  buffer-zoom-out -20
  buffer-zoom-out

The reason for this is that the argument to ZOOM_OUT is treated the
exact same way as ZOOM_IN. The only way they differ is how the
default case is handled.

This commit also clarifies that (1) the argument may be positive or
negative and that (2) the argument is interpreted as percentage
points, not percent.
2016-07-19 02:11:27 -04:00
Richard Heck
b0963b1b60 Fix cut and paste error in last commit.
Also, we can just realize the font ourselves here.
2016-07-18 13:53:40 -04:00
Richard Heck
3203fb1c5f Do not crash is release mode if we stumble across an unrealized font. 2016-07-18 13:01:42 -04:00
Richard Heck
7575ad159b Revert "Do not crash is release mode if we stumble across an unrealized font."
This reverts commit c560e6b3a6.

I did not mean to comit the changes to the gmo files.
2016-07-18 12:59:32 -04:00
Richard Heck
c560e6b3a6 Do not crash is release mode if we stumble across an unrealized font. 2016-07-18 12:56:20 -04:00
Jean-Marc Lasgouttes
8884c4044d Add feedback in status bar when zooming
Moreover enforce better the lower limit of 10 and avoid overflow due
to unsigned int.

Fixes bug #10212.
2016-07-18 17:03:54 +02:00
Juergen Spitzmueller
858f6b6c7b Whitespace. 2016-07-18 16:28:12 +02:00
Jean-Marc Lasgouttes
d654c4782a Typo 2016-07-18 16:24:06 +02:00
Jean-Marc Lasgouttes
7e997c193e Remove obviously wrong documentation in Painter.h 2016-07-18 16:17:38 +02:00
Jean-Marc Lasgouttes
2306fca659 Some things did not need to be mutable after all 2016-07-18 14:34:08 +02:00
Jean-Marc Lasgouttes
097ab41c49 Remove mutable variable InsetTabular::offset_valign_
Introduce instead a function Tabular::offsetVAlignment() that does the
same thing.
2016-07-18 12:37:14 +02:00
Jean-Marc Lasgouttes
31120694d9 Get rid of InsetTabular::first_visible_cell_
The code that uses it has been commented out since 2004. It is time to
delete it.
2016-07-18 12:26:06 +02:00
Jean-Marc Lasgouttes
61188464b4 Simplify display of InsetQuote
The code that specializes for double elements in the display string
does not trigger anymore: displayString() returns a single unicode
value, plus some space for french guillemets.

Use a thin space for these french quotes instead of a plain space and
remove special case in metrics().
2016-07-18 12:17:01 +02:00
Richard Heck
fb84ccd9fb The way this was previously, it had to fail if the GUI language
was not English: We return the the abbreviated author "One and Two",
but translated to the GUI language; then we search that for " and "
in order to pull the authors apart again.

I've just replaced the distinct routines with a single one that handles
both cases, depending upon whether a Buffer is provided as one argument.
2016-07-17 22:50:17 -04:00
Richard Heck
d5633f17e5 Fix thinko that led 2-authors citations to be displayed with "et al." 2016-07-17 22:31:54 -04:00
Guillaume Munch
10f6eb2e7e LaTeX highlighter: make at a letter in the user preamble
Syntax highlighting now provides the appropriate cue that the user preamble is
inside \makeatletter…\makeatother.
2016-07-15 17:51:18 +01:00
Guillaume Munch
1f2d7f4db9 Better error message when try to bind a Hidden LFUN 2016-07-14 20:53:12 +01:00
Guillaume Munch
eb8c5905f6 Prioritize the shortcuts from the work areas
* Fix bug #10261 : KDE smartly adds conflicting accelerators.

* Prevent bugs like #9495 in the future.

Issues (non-regression):

* It does not appear possible to prevent Ubuntu's Unity from grabbing the
  accelerators for the menus. For instance Alt+A still opens _Affichage in the
  French localization.
2016-07-14 20:50:10 +01:00
Richard Heck
c4ef96c030 Citation commands do not absolutely have to start with "c". 2016-07-13 14:25:46 -04:00
José Matos
b41300d819 Fix typo 2016-07-13 16:46:52 +01:00
Guillaume Munch
3099248115 Branch-invert: Fix discrepancy with the outliner and document statistics 2016-07-12 14:28:12 +01:00
Guillaume Munch
0fba5c4e8b Branch-invert: Record undo and update Toc 2016-07-12 14:27:40 +01:00
Guillaume Munch
6f97684d56 Branch-invert: Add a check mark to the switch in the contextual menu. 2016-07-12 14:27:08 +01:00
Guillaume Munch
5d292fce2d UI for save_transient_properties
Add a new checkbox "Save transient properties" to the "Output" panel in the
document properties dialog (now renamed as "Format").

This provides the front-end for the change at 5c2d04999.
2016-07-12 11:27:11 +01:00
Richard Heck
e1ca7733c3 LFUN to toggle branch inversion status, now available from the
context menu.
2016-07-12 00:19:40 -04:00
Richard Heck
5df323a0dd Introduce "inverted" branch insets: These are branches whose content
is output when a branch is NOT activated. Fixes bug #7698.

At the moment, inversion is controlled through the branch settings
dialog. There is no provision for inserting inverted insets directly,
or for changing them from the context menu. Both of these could be
done, of course. The latter would need LFUN_BRANCH_TOGGLE_INVERTED.
2016-07-11 23:56:32 -04:00
Kornel Benko
59ac7ce660 Cmake build: Add needed libraries if using QT5_Extras
Commit cb0c881 does this already for automake.
2016-07-11 19:08:11 +02:00
Juergen Spitzmueller
ad9887da9c Simplify BufferParams::bufferFormat()
The differentiation of "xetex" and "platex" is not needed here,
is ambiguous and confusing (see #10013). The code that relies on
it can/should get its information otherwise.

Furthermore, polyglossia-exclusive languages now also work with
LuaTeX, since we support LuaTeX + polyglossia.
2016-07-11 11:18:55 +02:00
Enrico Forestieri
cb0c881b02 Fix paste of selection to (unfocused) external applications
With both Qt4 and Qt5, when using a click-to-focus policy, the first
attempt to paste a selection by middle mouse in an external application
which has no focus may fail. It is not clear why this succeeds for some
applications and fails for others, but refreshing the timestamp of the
selection request cures the issue. The cmake part is by Kornel.

See also this thread:
http://thread.gmane.org/gmane.editors.lyx.devel/162491
2016-07-10 19:31:32 +02:00
Juergen Spitzmueller
65173b26d5 Generate a proper error dialog title for XeTeX/LuaTeX
(see bug #10013)

Candidate for stable
2016-07-10 11:14:03 +02:00
Juergen Spitzmueller
6bcbd907a4 Clarify some comments wrt XeTeX/LuaTeX (see bug #10013) 2016-07-10 11:13:13 +02:00
Richard Heck
74809e53a7 Delete obsolete comment: We no longer support Qt < 4.4. 2016-07-10 01:43:56 -04:00
Richard Heck
2104d41f71 Simplify logic a bit. (This was meant to be part of a previous
commit.)
2016-07-10 01:43:19 -04:00
Richard Heck
d8aab4af9e Fix thinko in Buffer::preview. It is possible for this routine to
be called when we do not have a cloned Buffer, namely, if we do not
have EXPORT_in_THREAD defined.
2016-07-10 01:12:42 -04:00
Richard Heck
b3ab0190c1 Rename some variables and routines. 2016-07-10 00:00:03 -04:00
Richard Heck
31e25c8ec6 Fix problem with branch handling. The problem was that we were not
dealing properly with the paragraph separator tag.

We really need to use that tag as a kind of general marker for which
tags we're responsible for in a given paragraph and which tags we are
not. So the changes to InsetText.cpp use the tag as that kind of marker.

Note that, as of this commit, the User Guide again exports without any
kind of error. I haven't yet checked the other manuals.

This fixes bug #8022.
2016-07-09 23:58:34 -04:00
Richard Heck
2b87026bf9 Update XHTML debugging code a bit. 2016-07-09 23:54:44 -04:00
Richard Heck
db954caf8b Write magic paragraph label to main paragraph tag. 2016-07-09 23:54:44 -04:00
Juergen Spitzmueller
97b9e81cee Fix for recent luatex versions. 2016-07-09 16:45:27 +02:00
Guillaume Munch
3e6df97963 Accessibility of document class combo box (#10035)
* Access it with tab

* Access it with the accelerator from the title of the group
2016-07-08 13:27:06 +02:00
Jean-Marc Lasgouttes
5a3401c66e Revert "Skip all drawing with NoScreenUpdate strategy"
This reverts commit b874bdfd40.

It was commited by mistake and actually does not seem to improve
performance.
2016-07-07 14:22:08 +02:00
Jean-Marc Lasgouttes
b874bdfd40 Skip all drawing with NoScreenUpdate strategy
It seems that it was needed in 0b0c27ef, but nowadays the metrics are
not touched when we set this strategy.
2016-07-06 11:32:54 +02:00
Jean-Marc Lasgouttes
86c33c96a0 Record undo when deleting end of paragraph in change tracking mode
Fixes bug #10253.
2016-07-05 16:26:11 +02:00
Jean-Marc Lasgouttes
be1c3f5fe3 Poor man's profiler: add support for cache hit/miss
This is still very basic profiling, but it seems to get the work done.
2016-07-05 15:31:17 +02:00
Guillaume Munch
f6bd79745e Revert c6ce76c2 and fix 670efa8f
Thanks Stephan
2016-07-05 12:07:36 +02:00