Commit Graph

23154 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
aef78c821f Avoid narrow boxes when using \width as box width unit
When the box has a special width, one should not consider that as a fixed width. Otherwise, due to implementation quirks, the width will be set on screen as 1 inch.

A better solution would be to actually set the width by taking in account the contents width, height ans total height. This is not very difficult, but I do not know whether it would workout well in the work area.

Fixes bug #10048.
2016-05-28 17:43:01 -04:00
Jean-Marc Lasgouttes
72e038f03e When a counter is stepped, reset recursively all slaves
Fixes bug #10063.
2016-05-28 17:43:01 -04:00
Guillaume Munch
efbc297b95 Include config.h in LyXToolBox.cpp
Amend 367a7a6dd.
2016-05-28 17:43:01 -04:00
Guillaume Munch
7e9d0a938b Fix compilation with qt5
Amend 367a7a6d.
2016-05-28 17:42:32 -04:00
Guillaume Munch
4e50cd809b Amend a5db05ae
Restore tabstops. I was mistaken about what tabstops are and thought they were
useless in this context.
2016-05-28 17:42:32 -04:00
Guillaume Munch
26c12dba8f CitationUi.ui: Align "Selected citations" label to the left 2016-05-28 17:42:32 -04:00
Guillaume Munch
576cb5df77 LyXToolBox: a QToolBox with minimum size management
The purpose of this custom widget is to allow the use of a QToolBox in a limited
area. The stock QToolBox does not provide a minimum size hint that depends on
the size of the pages; it assumes that there is enough room.  This subclass sets
the minimal size of the QToolbox. Without this, the size of the QToolbox is only
determined by values in the ui file and therefore causes portability and
localisation issues. Note that the computation of the minimum size hint depends
on the minimum size hints of the page widgets. Therefore page widgets must have
a layout with layoutSizeContraint = SetMinimumSize or similar.
2016-05-28 17:42:32 -04:00
Guillaume Munch
70fe2c618e Correct strange FIXME 2016-05-28 17:42:31 -04:00
Guillaume Munch
7faafd037e 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-05-28 17:42:31 -04:00
Guillaume Munch
935588f2de 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-05-28 17:42:31 -04:00
Guillaume Munch
1840b5992c Correct col spacing in Cases environment 2016-05-28 17:42:31 -04:00
Guillaume Munch
d4b56646b4 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-05-28 17:42:31 -04:00
Guillaume Munch
f3b70fd2cd 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-05-28 17:42:31 -04:00
Guillaume Munch
3a4af5a3e1 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-05-28 17:42:31 -04:00
Guillaume Munch
77714e6db7 Raise the maxlastfiles cap
This only changes the maximum value that the user can choose in the UI, not the
default value.
2016-05-28 17:42:31 -04:00
Scott Kostyshak
594748374b Fix using system theme icons with Qt 5 (#10052)
With Qt 5, our code did not correctly detect when icons were
available and thus tried to use nonexistent icons.

QIcon::hasThemeIcon(theme_icon) returns true when theme_icon is
empty. We now rely on the behavior that QIcon::isNull() returns true
if the icon is empty.

The same code is used with Qt 4 and Qt 5.
2016-05-22 20:56:12 -04:00
Georg Baum
ff4668621b Fxy typo in XHTML output (bug #10124)
There was a simple typo that did ouput the slash before the closing tag
instead of inside the closing tag.
2016-05-22 17:32:04 +02:00
Stephan Witt
1719fa6c6a 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-05-21 22:17:03 -04:00
Guillaume Munch
9a1afbf3ff Do not float the outliner in OSX (#9825)
There are focus issues in qt5 when the outliner is floating.
2016-05-21 18:54:38 +01:00
Guillaume Munch
a70f053a62 Use bilinear filtering when resizing graphics
This is used when scaling graphics previews. It is also used on a rare occasion
to scale instant previews when the user's configuration mixes low-dpi and
high-dpi monitors (#10114).
2016-05-20 21:19:31 +01:00
Guillaume Munch
791ef98016 GuiDelimiter: Workaround symbols alignment problem #10118 2016-05-20 19:32:35 +01:00
Guillaume Munch
a645d7f4e5 ShortcutWidget: override shortcuts in the way they are meant to be (#10075)
I would say "by the books" but the documentation was not really clear.

Problems with the logic of the previous implementation were exposed in Qt 5.6 by
commit <https://codereview.qt-project.org/125142>.

<http://mid.gmane.org/20160510070413.wzjpk4w4turnx6pr@cotopaxi>

Note that ShortcutOverride events are used elsewhere in the code where they may
need to be corrected in the same way.
2016-05-20 19:14:35 +01:00
Guillaume Munch
df86a4b8f0 Allow inset-forall to match separators (#10090)
With this change, it becomes possible to run the following commands:
     inset-forall Separator:latexpar char-delete-forward
     inset-forall Separator:parbreak inset-modify separator plain

The first one deletes all latexpar separators. The second one turns parbreak
separators into plain separators. This is safe, flexible, and avoids adding a
new LFUN.
2016-05-17 00:48:26 +01:00
Guillaume Munch
1b4728b5e2 amend 660a43ec 2016-05-07 01:53:04 +01:00
Scott Kostyshak
262dfd3826 Move some unsigned validators to signed (#10095)
2.1.x allows some document settings to have negative values where
2.2.0rc1 does not (because of the bug fix at 9e166088). If a user of
2.2.0rc1 opens a document from 2.1.x that contains one such negative
value, it will appear as though no change to the document settings
can be saved because 2.2.0rc1 treats the document settings as
invalid immediately on opening the dialog. Further, unless the user
manually goes through each tab they will not see the red text next
to the input that is now considered invalid. This could lead to
confusion for users. One example of such confusion is [1].

The following settings now allow negative values, which is
consistent with 2.1.x. Negative values in these settings do not lead
to LaTeX errors:

  - Text Layout tab: the two line edits enabled with "Custom"
  - Page Margins tab: all eight line edits

The following settings are not changed by this commit, so they now
(with 2.2.0) do not allow negative values that 2.1.x allowed. This
change makes sense because negative values lead to LaTeX errors in
these cases:

  - Page Layout tab: the "Height" and "Width" line edits, which are
                     enabled when "Custom" is selected

[1] https://www.mail-archive.com/search?l=mid&q=CAGZ2pgXqf27UaAaQ%3De_wFz1fGTa6Yv0iFyS97qu1C7B5R59irg%40mail.gmail.com
2016-05-06 15:43:41 -04:00
Guillaume Munch
660a43ecf4 Clipboard: Retry on_dataChanged() after a delay on windows (#10109)
An undocumented behaviour of QClipboard::mimeData() is that it can fail on
windows due to the specificities of the windows API that allow a race condition.
In particular it seems that querying the clipboard as soon as the dataChanged()
signal is received favourises this race condition.

Thanks to Trac user bquistorff for the explanation and a proof of concept patch.
2016-05-04 19:20:56 +01:00
Guillaume Munch
8fd223146b Whitespace 2016-05-04 18:59:36 +01:00
Jean-Marc Lasgouttes
ff17b366a0 Resources.cpp is a built source, it should not be in SOURCEFILES
We want to avoid that Resources.cpp be distributed in the tar file.
2016-04-27 00:59:30 +02:00
Stephan Witt
21e4e939be Revert part of c053a9394d
This change introduced a regression and is not needed anymore.

(cherry picked from commit 1cbabdf8d51b26dd80677ddfeb64d13df91fefc0)
2016-04-25 20:59:25 +02:00
Georg Baum
dc38ae873a Fix bug 10074 (regression)
This was a regression of 8aa37c43. I did not take into account that end_pos
could be -1, so the code that checked whether a pair of braces needs to be
inserted between two hyphens did not work for that case. Now we check for
the length of text_, which should be done anyway, and only take end_pos into
account when it is not -1.
2016-04-24 20:12:43 +02:00
Guillaume Munch
86227b196d Citation dialog: Fix trouble with openbox, fluxbox
http://thread.gmane.org/gmane.editors.lyx.devel/161725

These wms have trouble with the fix at b5a2f1c7, probably more precisely with
the trick to force the calculation of the actual sizes before the display
(layout->invalidate() and the code around it).

This patch gets rid of the code that forces the calculation. As a consequence,
the minimum sizes are again incorrect the first time the window is shown. They
are only correct the second time the window is shown. Now here is the trick: LyX
remembers the sizes of windows between sessions. Therefore, as soon as the good
minimum size has been set, the good size is remembered for the next
session. Thus, in the following sessions, even though the minimum size is
incorrect the first time, the dialog still opens with the good size. So the user
does not see the problem in practice, apart from the very first time.

This is meant as a temporary workaround.
2016-04-24 14:05:54 +01:00
Guillaume Munch
744f6e3cd8 Compute the highlighting color from AlternateBase and Highlight roles (#10073) 2016-04-15 14:13:50 +01:00
Stephan Witt
87c85303c5 Improved fix for #9966
* provide GuiApplication::typewriterSystemFont() to get a fixed font consistently
* enlarge fixed font on Mac because of the too small default Qt system font
* use it in source pane, progress view, log view and document preamble editor
2016-04-15 11:49:04 +02:00
Guillaume Munch
f180e813fe Fix dataloss when flex inset is undefined.
Regression at cfeddb929. If a flex inset has no layout upon saving (e.g. if a
module has been deleted) then its name became lost. This checks whether the name
resolution, introduced with the ObsoletedBy tag, comes back empty-handed (which
it will if the layout is not defined). In this case, we do as was done before
cfeddb929.

In addition, the use of support::token to strip "Flex:" off the beginning of the
name introduces a regression if somebody used a name containing ":". This
replaces it with support::split.
2016-04-11 21:02:06 +01:00
Enrico Forestieri
d4ca8d7404 Introduce the latexpar separator.
This is the same as the parbreak separator and is represented on screen
as the old parbreak. Old parbreak separators are converted to latexpar
separators when they are used for introducing blank lines in the
latex output rather than for separating environments.
Instead, parbreak separators are now represented on screen by a
double line. In essence, latexpar and parbreak separators produce
the same output but are represented differently on screen.
The context menu does not account for latexpar separators and only
"true" separators can be turned each into the other one.
2016-04-06 05:25:27 +02:00
Guillaume Munch
b5a2f1c7e5 Fix broken layout of the citation dialog (#10019)
7b1107d7 introduced the following inconveniences which are regressions to 2.1:

* The citation dialog can open with vertical scroll bars in the options

* The citation dialog can open with horizontal scroll bars, especially if the
  translated text is longer than the original text (e.g. in FR)

* Resizing the dialog is inconvenient because it increases the gap between the
  options. This is unlike before when the dialog could let us see more of the
  reference list when enlarging.

This is because the QToolbox that the above commit introduced is not natively
aware of the sizes of its page sub-widgets. The widget is not conceived for this
use, where the space is scarce.

Geometry values provided in the ui file (automatically computed by qtcreator I
suppose) somehow gave the illusion that it worked, but relying on such values is
not portable : it does not take into account the specific theme, font sizes and
localization. This explains why it failed on my side and will probably fail in
other settings too.

Luckily, there is a simple way to make QToolbox suitable for the current use,
which is to add the "missing link" which computes its size based on the minimal
sizes of its pages. The result looks very nice and intuitive. It solves all the
aforementioned issues.
2016-04-04 17:58:16 +02:00
Peter Kümmel
a0a472c16e msvc2015: always incude strfwd.h first, to prevent crashes of our
typedefed streams.
2016-04-02 11:03:17 +02:00
Peter Kümmel
44c57bb9d8 msvc2015: _wgetmainargs is not available ony more 2016-04-02 11:00:42 +02:00
Jean-Marc Lasgouttes
fd1ee3b424 Rename Caption:LongTableNoNumber to Caption:Unnumbered
The term LongTable has been deprecated and moreover the renaming makes the interface easier to the eye.

File format updated to 507. (conversion based on jamatos patch)
Layout format updated to 60.
tex2ylx tests updated.
Document EmbeddedObjects.lyx has been updated.
2016-03-30 16:07:00 +02:00
Richard Heck
f7fdf49f64 Const. 2016-03-28 12:40:18 -04:00
Richard Heck
82c3a44337 More informative name for backups of files from older versions. 2016-03-27 19:40:02 -04:00
Richard Heck
23f6c1c962 Fix problem reported by Kornel in this thread:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg193248.html
The static InsetLayout could be initialized before its members were, as
JMarc realized here:
		https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg193293.html
2016-03-27 16:56:17 -04:00
Jean-Marc Lasgouttes
ba7e2113f3 Fix some display bugs related to end of paragraph markers
There are two regressions that are fixed here:

 * empty rows at the end of a paragraph (think after newline at end of
   paragraph or empty line in Verbatim) do not have an end-of-par
   marker. This is fixed by removing the early return in breakRow and
   letting the whole function be executed. This requires to relax an
   assertion in Paragraph::fontSpan. It makes sense here to query
   position at the end of the paragraph.

 * a newline at the end of a paragraph will be followed by and
   end-of-par marker. This is fixed by skipping the end-of-par marker
   when a new row has been requested.
2016-03-25 22:22:45 +01:00
Jean-Marc Lasgouttes
ecd7dee5ea Make thin lines exactly 1 pixel wide
The setting of 0 (minimal possible width) was too thin for Mac Retina displays.

Fixes bug #10031.
2016-03-25 16:53:37 +01:00
Jean-Marc Lasgouttes
0aaa930a5c Do not assert when cursor is deeper than anchor
This works around bug #9917 and might give us an occasion of obtaining a recipe for reproducing it.
2016-03-22 13:48:15 +01:00
Jean-Marc Lasgouttes
98883304e2 When handling mouse events, make the undo group a bit larger
notifyCursorLeave can delete empty insets in mathed.

Fixes bug #10022.
2016-03-16 18:33:39 +01:00
Jean-Marc Lasgouttes
be7e89a29b In mathed, only select current cell on double-click
Keep the behavior of split selection with triple click.

Fixes part of #9747. The remainder was fixed at f58d9f27, AFAICS.
2016-03-16 10:23:23 +01:00
Georg Baum
4bab2ab5f8 Fix regression of 359aef92f8
The context menu of newline insets was completely greyed out if one clicked
at the right of the inset. Thanks Scott for finding this. The fix is to undo
the cursor movement also for insets without settings, but with a context menu.
2016-03-15 21:35:50 +01:00
Guillaume Munch
0434f5676a Fix perf issue when displaying the symbols gui (#9968)
According to callgrind, the time taken to display the symbol dialog is spent in
updateSymbolsList. No longer translate strings for every symbol. This speeds
it up more or less by a factor two.
2016-03-13 07:19:13 +00:00
Enrico Forestieri
0430132aa0 Circumvent odd stmary font metrics (part of #9990).
The stmary font has an unusual large descent that was causing a large
gap between lines in the math delimiter dialog because of the \llbracket
and \rrbracket delimiters. The solution is to force Qt using the same
size for all elements of the QlistWidget widget instead of letting it
compute the size of each element.
2016-03-13 01:51:15 +01:00
Jean-Marc Lasgouttes
8d088df4df When using pixmap cache, add word spacing to signature
Fixes bug #9971.
2016-03-12 12:57:49 +01:00
Jean-Marc Lasgouttes
3b6919217b Do not set cursor to the right of newline with mouse
When a row is broken by for example a display math inset, it is
possible to put the cursor at the end of the previous line using the
boundary setting of cursor.

For newline insets and separator insets, we want to force the cursor
to be before this inset. Also, in the other cases, do not force
boundary property (effectively reverts part of f29e7803).
2016-03-12 12:49:00 +01:00
Jean-Marc Lasgouttes
e8e97d67d9 Fix Cursor::inCoordCache: the root inset is never in the cache
Fixes bug #10007.
2016-03-11 16:55:03 +01:00
Enrico Forestieri
bb6130eea1 Fix bug #9990: Oversized & Incorrect Glyphs in Math Delimiter Dialog
The TeX fonts ditributed with LyX are now used for displaying the
delimiters. This assures a uniform look and that no symbol is missing.
2016-03-11 11:37:15 +01:00
Guillaume Munch
b3bed2927e Fix perf issues and crash when showing 1'100'000 items (#9968) 2016-03-11 01:15:47 +00:00
Jean-Marc Lasgouttes
31eba79b09 Fix dist target when configured with monolithic build. 2016-03-10 14:53:26 +01:00
Jean-Marc Lasgouttes
5f9053d6d3 Reset right_boundary row property when row is shortened
Fixes bug #10003.
2016-03-09 09:57:14 +01:00
Jean-Marc Lasgouttes
ffc693c87f Better handling of different int sizes when computing row crc 2016-03-05 23:18:12 +01:00
Jean-Marc Lasgouttes
b4d85944a6 Set margins correctly for empty rows
Calling breakRow ensures that everything is set correctly.
2016-03-05 14:10:02 +01:00
Jean-Marc Lasgouttes
b87946c11d Revert "Better handling of different int sizes when computing row crc"
This reverts commit 7d163d4e78.
The commit got pushed by mistake and needs improvements anyway.
2016-03-04 00:14:56 +01:00
Jean-Marc Lasgouttes
8009edd3d4 Avoid endless loop when the window is too narrow
* breakRow: remove wrong condition that would silently eat the contents of the
   paragraph when the window is narrower than left margin

 * breakRow: make sure that there is at least one element in each row

 * breakAt: when force-breaking a row element, make sure it is not empty. Doing
   so may create empty rows and therefore a endless loop.

Fixes bugs #9962 and #10001.
2016-03-03 18:08:11 +01:00
Jean-Marc Lasgouttes
7d163d4e78 Better handling of different int sizes when computing row crc 2016-02-29 13:12:16 +01:00
Guillaume Munch
bd56ed38e8 Delete .out files after compilation errors (#9963)
This treats the symptom, not the bug.
2016-02-28 19:09:21 +00:00
Jean-Marc Lasgouttes
b01d7b2262 Do not merge consecutive hyphens in LyX-Code
The existing code already avoids merging with typewriter font, but it does not work with LyX-Code, where the typewriter family is inherited. Therefore it is Cursor::real_current_font that must be tested.

Fixes bug #9987.
2016-02-26 12:02:37 +01:00
Uwe Stöhr
229d7fafd5 ErrorListUi.ui: make 2 strings compilable
fixes bug #9988
2016-02-26 02:04:49 +01:00
Guillaume Munch
20a9c7a381 Fix SIGSEGV when introducing a new shortcut (#9869)
removeShortcut() restores default settings, therefore was used incorrectly. I
introduce deactivateShortcuts() which only removes assignments.

Clean up a bit the lack of view / model distinction (getting rid of the crashing
code at the same time).

Repair inconsistency of the selection in the "modify" case. (regression at
717d19d3c)

Make the test for existing bindings a bit more robust. (Not perfect yet.)

Focus on the item that has just been added/modified. (cosmetic)
2016-02-23 22:08:25 +00:00
Richard Heck
efd1af6789 Whoops on the last commit. This is the right patch. 2016-02-20 22:19:03 -05:00
Richard Heck
c498adf4db Fix bug reported on the list by Philip Pirrip. It is possible that
paramsToDialog is called when we do not have a BufferView and so do
not have a Buffer.
2016-02-20 22:16:36 -05:00
Stephan Witt
89985bebf9 #9940 VCS now toggles buffer read-only state if locking is not active and it is enabled by VC backend 2016-02-20 07:32:56 +01:00
Stephan Witt
63e982191e correct whitespace 2016-02-20 06:39:32 +01:00
Guillaume Munch
0c3643ada9 Set the preamble in fixed-width font and without line breaks (#9966) 2016-02-18 17:19:38 +00:00
Georg Baum
c0ce79452f Introduce proper integer rounding function
This fixes a failing unit test with 32bit gcc 4.9.3 and -O2 optimization:
It computed 9953 instead of 9954 for Length::inPixels() of value 2342.
The reason for this is probably different rounding behaviour caused by storing
the unrounded value in a processor register (uses 80bit accuracy) vs. writing
it back to memory (uses 64bit accuracy). The unrounded value is very close to
9953.5 (which is not representable as an exact IEEE floating point value).

Apart from that, having a proper function for rounding makes the code more
readable, and has the nice side effect to make Length::inPB() work for
negative lengths as well.
2016-02-17 21:42:37 +01:00
Guillaume Munch
e56820bea4 Do not save \origin when \save_transient_properties is false (#9958)
\origin is a transient property in the sense that in a collaborative context
each co-author is going to have a different value for it. Moreover, \save_origin
is a global (lyxrc) setting that cannot yet be deactivated for a single file,
but one author's setting is going to impact other authors, even those who have
set save_origin=false.

There is only one location where lyxrc.save_origin produces an effect, modified
by this patch. With this patch, everything happens as if lyxrc.save_origin was
false whenever save_transient_properties=false.

This is not a file format change. When a file has
save_transient_properties=false but an origin is set (for instance a file
produced before this patch) then the origin produces its effect before the file
is saved. This produces the same effect as if the user decided to disable
save_origin between two sessions.
2016-02-09 17:48:16 +00:00
Jean-Marc Lasgouttes
2804011957 Get rid of use_preview_ in various insets
This concerns InsetPreview, InsetIPA and InsetMathHull.

Caching such a value is bad when opening the same buffer in two views.
In this case, it is not necessary to remember use_preview_ at all,
actually.

Also remove private member dim_ which is not used and remove some trailing whitespace.

Fixes bugs #9085 abd #9957.
2016-02-09 09:54:14 +01:00
Jean-Marc Lasgouttes
a3b19c60a7 Do not record undo in the tabularFeatures helper
Since the low-level version of tabular features is only called by the high-level one, it does not make sense to record undo there. It is much better to do it once in the high-level handler, rather than 37 times (yes!) at lower level when the tabular GUI calls tabular-feature with all the settings at once.

With large tables, this avoids to keep 37 copies of the table in Undo stack.

As an added bonus, this fixes bug #9960.
2016-02-09 09:18:56 +01:00
Uwe Stöhr
28e6174be7 InsetBox.cpp: fix bug #8712 2016-02-05 00:49:17 +01:00
Jean-Marc Lasgouttes
31471496fd Allow breaking a row element at a leading/trailing space
When an inset is separated from the adjacent string by a space, it is
reasonable to be able to break the string after the space.
Unfortunately, QTextLayout does not do that.

This patch reverts the workaround inserted in 71378268 and replaces it
with a different trick: the string is enlosed between a pair of
zero-width non breaking space characters, so that the leading/trailing
spaces are now normal spaces, where QTextLayout will agree to break
the string.

    Fixes bug #9921 for good.
2016-02-04 08:45:27 +01:00
Jean-Marc Lasgouttes
169cf7c24d When selecting whole row, reset properly the pit()
Since different cells in a row can have different number of paragraph, take care of setting cur.pit() when selecting a row/column.

Fixes bug #9955
2016-02-03 09:48:29 +01:00
Guillaume Munch
bcfa3547be minor cleanup 2016-01-31 16:02:18 +00:00
Georg Baum
de3e5280f6 Open tex2lyx input files with correct encoding
We open the input file now twice: The first time in latin1 encoding to read
the document encoding from the preamble. This does always work, since
traditional TeX does not allow non-ASCII contents without an encoding changing
command (except for comments, but we do not need them, and using latin1 rather
than utf8 ensures that they do not produce an iconv exception, but are simply
recored with wrong characters), and we do detect the utf8 based TeX engines
XeTeX and LuaTeX as well. The second time we open the file directly with the
document encoding.

This fixes a few tex2lyx tests on OS X, since changing the encoding of an
open file steam does not work with clang on OS X. Files using more than one
encoding are still broken, but all single-encoding files are fixed now.
2016-01-31 12:54:59 +01:00
Georg Baum
92d0835e14 Avoid encoding changes of open streams if possible
Changing the codecvt_facet of a file stream after the file has been opened
does not work with clang on OS X. Therefore we avoid it if possible (i. e. the
new encoding is the same as the old one).
2016-01-31 12:49:17 +01:00
Georg Baum
250b058192 Do not use static objects in Preamble
This does not make any difference currently, since the only instance of the
Preamble class is a global one, but it is cleaner and will be needed for
parsing the encoding with a second Preamble instance.
2016-01-31 12:37:22 +01:00
Uwe Stöhr
4dce8d4da4 tex2lyx testfiles: update fileformat 2016-01-30 02:17:45 +01:00
Georg Baum
5727cb2d43 Use consistent iconv encoding names
We should stick to the names used in lib/encodings. iconv has many aliases,
but fi we ever compare names it is better to use only one variant.
2016-01-29 20:38:40 +01:00
Jean-Marc Lasgouttes
8d091cfe78 Avoid making tabular too large when using a caption in longtable mode
This is a fixup to commit cdb9f043, which fixed bug #9757.

It is necessary to make a special case for inserting an InsetCaption
in a tabular cell, because this commonly happens in longtable mode.

Fixes bug #9945.
2016-01-29 10:05:48 +01:00
Enrico Forestieri
9edbeef7b7 Make sure the cursor is in texted 2016-01-28 14:13:17 +01:00
Guillaume Munch
2c08848700 Let tabular-feature commands fall through non-table math insets. (#4189) 2016-01-27 18:36:07 +01:00
Guillaume Munch
f58638c704 New LFUN tabular-feature: convert "inset-modify tabular" in LyX files
* Increase LyX format

* New function convert_info_insets in lyx2lyx_tools.py
  Use this function in the future for future updates of info insets

* Convert "inset-modify tabular" to "tabular-feature" in info insets

* Remove icon naming hack regarding "inset-modify tabular"
2016-01-27 18:33:09 +01:00
Guillaume Munch
366b319e42 New LFUN tabular-feature: update prefs2prefs.py 2016-01-27 18:20:53 +01:00
Guillaume Munch
c9f7ce0a7a New LFUN tabular-feature (#9794)
The tabular-features LFUN was merged with "inset-modify tabular" when
simplifying the tabular dialog at b5049e7. This choice later indirectly caused a
few regressions (#7308, #9794).

I reintroduce tabular-feature to allow more flexibility for user
commands, whereas "inset-modify tabular" is now reserved for the tabular
dialog. In particular, inset-modify tabular is no longer caught by math grid
insets. The name tabular-feature is kept to avoid renaming icons.

Known issues:

* After successfully applying a tabular command, the cursor is truncated to the
  table.

* Note that the tabular dialog still has similar issues that are inherited from
  the achitecture of the dialog menu. For instance the pref change can be
  mis-dispatched to an inset inside a cell and cause an error, for instance:

    Lexer.cpp (934): Missing 'Note'-tag in InsetNote::string2params. Got
    tabular instead. Line: 0

  Maybe the inset-modify LFUN should be modified to treat commands coming from
  the wrong dialog (by checking the type) as unknown and undispatched so that
  the parent can get it. In that case a non AtPoint variant of inset-modify
  could be reintroduced in order to generalise tabular-feature. See:
  http://mid.gmane.org/n4rdk1$efj$1@ger.gmane.org
2016-01-27 18:20:37 +01:00
Uwe Stöhr
c1e0b24304 acmsiggraph.layout: update layout for ACM siggraph 0.92
fileformat change: update fileformat for all files
2016-01-27 01:58:13 +01:00
Georg Baum
8171272d1f Fix file locking problem on windows (bug 9925)
External processes cannot access files which are open in LyX. Therefore the
temp files created by the external inset need to be closed right after
creation. The symptom was that the date inset did not produce any outout on
windows (bug 9925). This change reverts a small part of f09a9fe2.
Although the date inset is unimportant and will probably be removed, this
change is important for all external insets that make use of temp files.
2016-01-26 21:49:08 +01:00
Georg Baum
4ab1d77577 Fix regression of 0bf8b8a1 (bug 9884)
Unfortunately the footmisc package does not work together with hyperref:
Before 0bf8b8a1, a footnote in a section title was created as a link in pdf
outpout, after 0bf8b8a1 ist was no link anymore. For now we revert to the old
code, and wait until the footmisc and hyperref packages are made compatible.
2016-01-26 21:33:46 +01:00
Uwe Stöhr
854ec56419 PrefOutputUi.ui: the official program name is "dvips"
(We used this also in LyX 2.1.x so there is no need to rename it to DVI-PS.)
2016-01-25 02:06:10 +01:00
Scott Kostyshak
58730c73d4 Ammend 20addbbf
These two signals were not QProcess::error().
2016-01-24 13:05:51 -05:00
Scott Kostyshak
20addbbf36 Qt 5.6 renames signal QProcesss::error()
QProcesss::error() was renamed to QProcesss::errorOccurred().

The renaming was done to avoid confusion from overloading (see the
documentation for the signal before the renaming [1]).

For more details, see this Qt bug report [2].

[1] http://doc.qt.io/qt-5/qprocess.html#error-1
[2] https://codereview.qt-project.org/#/c/114451/
2016-01-24 12:07:52 -05:00
Georg Baum
dc8c4f3eab Fix date inset except on windows (bug 9925)
The important thing is actually not the date inset, but the converter
machinery, which did convert the time stamps of two unused freshly created
temp files, which does not make sense, and did work before f09a9fe2 only by
accident.
This fixes the date inset on linuy, but not on windows, probably due to
different file locking semantics.
2016-01-24 17:11:31 +01:00
Stephan Witt
3d00aef3ac use QStandardPaths::GenericDataLocation instead of QStandardPaths::DataLocation to get common user_support_dir path for all LyX binaries (LyX, tex2lyx and lyxclient) 2016-01-24 15:19:54 +01:00
Enrico Forestieri
80e2c85474 Change the shape of the parbreak separator
As per request, this makes it better distinguishable from the
neline inset. For posterity, see this thread:
http://thread.gmane.org/gmane.editors.lyx.devel/159267
2016-01-24 12:49:02 +01:00
Stephan Witt
1440ae2e13 pass values for @executable_path and @loader_path to instruct the dyld where to find the Qt frameworks 2016-01-23 07:16:09 +01:00