Commit Graph

35597 Commits

Author SHA1 Message Date
Richard Heck
8731689d41 Fix bug #10153: There's a mechanism in XHTML output that defers the
output of tags until we know they're needed. In the case of HTML
tables, empty cells should of course be output, so we need to force
the tags to be output.

(cherry picked from commit 35d449c5da)
2016-06-20 10:26:40 -04:00
Richard Heck
bfcd8a3991 Fix typo, and also check, if string is null. 2016-06-18 18:34:30 -04:00
Richard Heck
c503804eeb Be a bit more careful about setting and restoring the last reference
when we go to and return from labels.

(cherry picked from commit 68b60ec529)
2016-06-18 18:28:48 -04:00
Richard Heck
fb97294229 Status for previous commit. 2016-06-18 13:02:29 -04:00
Richard Heck
b593ba5b48 Fix bug #10218, in a way less invasive than it has been fixed in
master. Patch due to Enrico.
2016-06-18 12:59:02 -04:00
Guillaume Munch
0ba875add1 TocWidget: fix an erroneous collapse and optimise updates based on profiling
TocModels::reset() in GuiView::structureChanged() collapses the TocWidget, and
therefore requires an update right after, which was missing.

In fact, profiling TocWidget::updateView() shows that delaying the update is
good only for fast keypresses (essentially movement). It costs 5% of a
char-forward operation in a document with approx. 100 table of contents
items. The update optimisation has been rewritten to take this data into
account.

This also fixes #9826: Outline disclosure of subsection content disappears one
second after doubleclicking content item.
2016-06-15 22:32:53 +01:00
Richard Heck
adcdf22042 Restore last selected label when using the "go to label" feature
of the reference dialog.

(cherry picked from commit 9d5ffa8e75)
2016-06-15 22:32:53 +01:00
Richard Heck
8dabe43995 Fix version number. 2016-06-15 22:32:53 +01:00
Jean-Marc Lasgouttes
3c7c63376f Take inset dimension into account in row signature
In some cases, the insets may change height or width without changing
the other apsects of the row.

Fixes bug #6991 and #10182.

(cherry picked from commit 508518ad95)
2016-06-15 22:32:53 +01:00
Jean-Marc Lasgouttes
aa522e7071 Fix drawing of buttonText (enforce same left/right spacing)
The computation of the width of the button was wrong. If <--> stands
for TEXT_TO_INSET_OFFSET/2 spacing, and if `[]' marks the button's
limits, then the intent is
  <-->[<-->button text<-->]<-->

Therefore the physical grey rectangle width is
   width - Inset::TEXT_TO_INSET_OFFSET

With this change, the spacing on the right of the button is not larger
than the left one.

Fixes bug #10147.
(cherry picked from commit 516d5d29dc)
2016-06-15 22:32:53 +01:00
Jean-Marc Lasgouttes
cba0b073aa Remove extra spacing around InsetCommand buttons
There is already a spacing of 2 pixels on each side of a button (e.g.
collapsed inset). There is no need to add one extra pixel for command
insets.

Fixes part of bug #10149.
(cherry picked from commit 68149e380d)
2016-06-15 22:32:53 +01:00
Juergen Spitzmueller
2d6f1e6551 Add forgotten fix to status 2016-06-15 22:32:53 +01:00
Juergen Spitzmueller
8318473227 Implement some forgotten context menu items for arguments
* Dissolve context menu
* Label toggle (for conglomerate-styled arguments)

Fixes: #10150
2016-06-15 22:32:53 +01:00
Jean-Marc Lasgouttes
b6552d017b \\pagebreak is a fragile command in general
As such, it shall be protected in moving arguments, such as sections.

Fixes bug #10092.
(cherry picked from commit 86ee2699c30b63e5b4de3ad725519756d17aec2c)
2016-06-15 22:32:53 +01:00
Jean-Marc Lasgouttes
dbd83603b0 Fix getStatus for math-mutate and math-display
Those two functions used two different hackish and buggy
implementation to know when the function is disabled. Replace that by
asking the containing inset whether it accepts inserting display math
inset.

Fixes bug #10033.
(cherry picked from commit de5630a1562054cb969b106e35f84bfe1e99002a)
2016-06-15 22:32:53 +01:00
Jean-Marc Lasgouttes
f012b73e78 Do not use 'u' flag for ar
The Reproducible Builds effort (https://wiki.debian.org/ReproducibleBuilds) in Debian (at least) means that 'ar' is built in deterministic mode as default: all timestamps are set to 0.

This is not compatible with the use of the 'u' flag, and therefore ARFLAGS has to be changed from 'cru' to 'cr'.

This gets rid of the harmless but annoying warning
  ar: `u' modifier ignored since `D' is the default (see `U')
(cherry picked from commit 987fc1d15d017c192a566fc922e3967d9d280668)
2016-06-15 22:32:53 +01:00
Jean-Marc Lasgouttes
c25ba48f0a Disable LFUN_INSET_DISSOLVE in tabulars
When in a tabular cell, "this" is just a lone InsetText, while cur.inset() is the whole tabular. This makes a big difference, especially when one wants to count cells.

Fixes bug #9954.

(cherry picked from commit 4caf167dbd24722421ae8d94a2c103bf41a7667d)
2016-06-15 22:32:53 +01:00
Jean-Marc Lasgouttes
9a4309b104 Rename InsetMathHull::isTable to allowsTabularFeatures
The old name conflicted with the newly introduced Inset::isTable.

Now the meaning is as follows.
* Inset::isTable() is true when the inset is composed of lines and columns
* InsetMathHull::allowsTabularFeatures is true when the current type of hull allows for tabular-like functions.

(cherry picked from commit db39dc7ccd4c2dd14ef20547e6e3c056ba030d83)
2016-06-15 22:32:53 +01:00
Jean-Marc Lasgouttes
f3cb98c784 Make inset-select-all select all cells only in tables
inset-select-all has 3 levels
1. select current cell
2. select all cells
3. select inset from outside.

The second level makes sense for tables (text and math), but not for things like a math fraction.

Introduce a new method Inset::isTable() that allows to detect this case properly and skip level 2.

(cherry picked from commit 5de28b9ac6736c791146a1a3ebe7f4826c22a9b7)
2016-06-15 22:32:53 +01:00
Guillaume Munch
108cb35b64 Show review toolbar when outputting changes
"Output changes" alters the preamble even in the absence of tracked
changes. Therefore, not being able to notice when it is activated can possibly
yield hard-to-debug compilation failures.
2016-06-15 22:32:53 +01:00
Guillaume Munch
5e6de175fa status.22x 2016-06-15 22:32:53 +01:00
Guillaume Munch
05e38d1366 Disable certain change tracking commands when there are no changes
Fix TODO
2016-06-15 22:32:53 +01:00
Guillaume Munch
73dd3f4ecb GuiChanges: provide feedback when there are no more changes
Remove FIXMEs: date and time localisation
2016-06-15 22:32:53 +01:00
Guillaume Munch
c137ae4c43 Automatically show the review toolbar if the document has tracked changes
(#8738)

For efficiency, we add a new flag to the buffer indicating when changes are
present. This flag is updated at each buffer update, and also when explicitly
requested via a dispatch result flag.
2016-06-15 22:32:53 +01:00
Guillaume Munch
5486beac29 getInnerText() 2016-06-15 22:32:53 +01:00
Guillaume Munch
b90435ac72 TocWidget: clean-up the timer logic
The timer logic introduced to solve bug #7138 was not entirely reliable; in
particular it resulted in spurious updates (noticeable by the treeview
collapsing just after one opens a branch, in particular).

This commit cleans up the timer logic. I followed the original design decision
of having an immediate update followed by a delayed update. Now the updates are
appropriately compressed and done after a delay of 2s (as can be noticed with
the treeview still collapsing, unfortunately, but after a more predictable
delay...).
2016-06-15 22:32:53 +01:00
Guillaume Munch
009dc75fef TocWidget: Fix perf regression
4d1ad336 fixed #9754 but caused perf issues by cancelling the gains of having a
timer (introduced after #7138). This introduces in GuiToc::enableView() a
lightweight check of whether the widget should be updated. The logic is inspired
from GuiViewSource::enableView().
2016-06-15 22:32:53 +01:00
Guillaume Munch
8149d4fc0b Whitespace 2016-06-15 22:32:52 +01:00
Jean-Marc Lasgouttes
e359124a86 Let getPosNearX take horizontal scrolling into account
If we do not do that, it is not possible to position the cursor after
a long inset with the mouse.

To do this, it is necessary to add the pit information to the Row
object. This is a good idea in any case, and will allow to simplify
some code later on.

Fixes bug #10094.
(cherry picked from commit 8851645799ef67015e49fd75b9dfeed65d685e85)
2016-06-15 22:32:52 +01:00
Jean-Marc Lasgouttes
76c06e3535 Add missing entry in status.22x
This was forgotten in fe5e1170.
2016-06-15 22:32:52 +01:00
Guillaume Munch
12a45060cc status.22x 2016-06-15 22:32:52 +01:00
Jean-Marc Lasgouttes
f53c17145a Fix cursor position after redo
When document settings are modified, a command
  inset-forall Branch inset-toggle asign
is run to open as needed all branches. At the end of the said loop,
the cursor is reset to where it was. However, the cur_after undo
element member is not set because it already had a value.

To make this work as expected, it is necessary in LFUN_INSET_FORALL to
reset the cursor before ending the undo group and to insert a dummy
recordUndo call.

Fixes bug #10097.

(cherry picked from commit 0036762f30def16ab8b2216f721f9e552893bc85)
2016-06-15 22:32:52 +01:00
Guillaume Munch
3b1068af62 Improvements to the shortcuts preference dialog (#9174)
Ask the user for removing bindings when using the "restore" button (#9174).

Fix the already-bound-key detection logic.

Don't forget to trigger the search when initializing the search LineEdit with
its former value.
2016-06-15 22:32:52 +01:00
Jean-Marc Lasgouttes
1fd39e2974 Fix horizontal scrolling in full-width collapsable insets
While a one paragraph large collapsable inset (containing for example a tabular) could be very wide and trigger horizontal scrolling, the code that makes collapsable insets wide when they contain several paragraphs would actually make them narrower in this case.

Typical example is a wide tabular and a caption in a table float, where horizontal scrolling would not trigger.

(cherry picked from commit 8c7ace4b on 2.3.0-staging)
2016-06-15 22:32:52 +01:00
Richard Heck
fe96d33229 Updates to splitting of consecutive environments.
From Enrico.

(cherry picked from commit ee82dd604010d4c1bf250640a3df6d790ea08380)
2016-06-15 22:32:52 +01:00
Stephan Witt
429bd8cdf4 Handle activateWindow in LFUN_BUFFER_SWITCH like in saveBufferIfNeeded() and doShowDialog() methods.
This is a requirement on Mac to get the current buffer view topmost after buffer switch.
2016-06-15 22:32:52 +01:00
Jean-Marc Lasgouttes
0ea92e677a Change mouse cursor on tabular selection zones
This is done by implementing the clickable method. It is not possible yet to have the usual left and down arrows, because Qt does not implement them as far as I can see.

Factor the code that triggers row/column selection and fix the logic. Now it is possible to select also at the right of the tabular inset.
2016-06-15 22:32:52 +01:00
Jean-Marc Lasgouttes
cd27ae65a2 Fix display of InsetCollapsable with split views
When several bufferviews exist for the same inset, the data that depends on the view width have to be BufferView-dependent. While this is the case for several mutable members of InsetCollapsable, some were missing.

This commit makes button_dim_ (renamed from button_dim) and openinlined_ bv-dependent.

Get rid of the hitButton function.

Remove the bv-independent geometry() method and implement editable() explicitely instead.

Fixes bug #9756.
2016-06-15 22:32:52 +01:00
Jean-Marc Lasgouttes
e495dfb5f7 whitespace only 2016-06-15 22:32:52 +01:00
Jean-Marc Lasgouttes
815e6c9f2f Pass a BufferView to Inset::clickable 2016-06-15 22:32:52 +01:00
Jean-Marc Lasgouttes
9fc27f6bb7 Make monolithic build code portable to Mac OS
"echo -e" is definitely not portable. Use a plain loop instead.

Also use the automake silent rule mechanism to make the generation of monolithic source files visible.
2016-06-15 22:32:52 +01:00
Guillaume Munch
a81b030aee status.22x 2016-06-15 22:32:52 +01:00
Guillaume Munch
8e1e55c9e6 Sanitize InsetMathHull and add a check for mutability in LFUN_MATH_MUTATE
Remove in particular all comparisons < and >= involving HullType.

Add a guard to make sure that mutate() only operates on types it has been
designed for. Then I figured I could use this new knowledge to give feedback
when math-mutate is not implemented via getStatus(). (To test this, insert a
regexp in Advanced Search & Replace and try to change it into a standard
equation via the contextual menu.)
2016-06-15 22:32:52 +01:00
Guillaume Munch
6d8863ad60 Correct col spacing in Cases environment 2016-06-15 22:32:52 +01:00
Guillaume Munch
7069b90f92 Fix the display of column spacing in AMS environments
AMS align environment should have some spacing between odd and even columns.

Add a new virtual method displayColSpace() to InsetMathGrid, InsetMathHull and
InsetMathSplit.
2016-06-15 22:32:52 +01:00
Guillaume Munch
665ad80313 Display the correct horizontal alignment in AMS environments
A longstanding problem... (related: #1861)

The columns in AMS math environments have a fixed alignment (colAlign() in
InsetMathGrid.cpp). We set this alignment for display (Georg's
displayColAlign()) in InsetMathHull and InsetMathSplit. This is done according
to tests and documentation for the various environments.

There is also some mechanical code factoring via colAlign().

Finally, I disable setting the horizontal alignment in InsetMathSplit, which has
no impact on the LaTeX output, and has no longer any impact on the screen. (As
for vertical alignment I discovered that it was in fact customisable for
\aligned & friends! I hope that the more faithful interface will let other
users discover that too.)
2016-06-15 22:32:52 +01:00
Guillaume Munch
ce0053f7f3 status.22x 2016-06-15 22:32:52 +01:00
Guillaume Munch
78dde8edc6 Raise the maxlastfiles cap
This only changes the maximum value that the user can choose in the UI, not the
default value.
2016-06-15 22:32:11 +01:00
Guillaume Munch
6b17cbafac Do not omit the starting space when copying (#9995)
The offending code appears to have been introduced a long time ago. My
understanding is that it is no longer relevant. Notably, it only appears on copy
and not on cut, which tells us that: 1) it should be safe to remove it, 2) we
should remove it for consistency.
2016-06-15 22:32:11 +01:00
Guillaume Munch
122c66cbc7 status.22x 2016-06-15 20:26:14 +01:00