Commit Graph

93 Commits

Author SHA1 Message Date
Uwe Stöhr
515a4f0fee LaTeXFeatures.cpp: fix bug #9266 also for branch
mhchem loads amsmath and needs therefore be loaded after it but before packages that redefine commands of amsmath. We already take care of esint but not of wasysym
2014-10-26 13:44:42 +01:00
Richard Heck
bdb6abf9b7 Fix bug #9296. The key may be multiple keys.
(cherry picked from commit 080a4d84e2)
2014-10-16 16:38:18 -04:00
Juergen Spitzmueller
a0e0e3c170 typo 2014-10-10 18:27:35 +02:00
Juergen Spitzmueller
4db6ffe7d8 Document fix 2014-10-10 18:26:01 +02:00
Enrico Forestieri
a291c70658 Fix export of xfig external insets (bug #9244).
The check for a latex format is very fragile. Both libmagic and our
guessing from contents cannot distinguish the pstex and pdftex formats
used by the xfig external inset. Moreover, it may also happen that
lyx files are mistaken as latex ones. Thus, when the guessed format
is latex, the only solution is to give precedence to the format
determined by the file extension.
2014-09-28 21:28:16 +02:00
Juergen Spitzmueller
56e2f6c75c Support for conference posters
The following poster classes are now supported:

* a0poster
* beamerposter
* sciposter
2014-09-27 10:05:23 +02:00
Juergen Spitzmueller
e627bf3ba6 Add support for the pdfcomment package.
Fixes: #6975.
2014-09-27 09:55:25 +02:00
Juergen Spitzmueller
2eeed6cf13 Fix bug with wrong baseline calculation in last paragraph (2nd attempt)
This time, we consider the cases where a \par is not wanted (single-par insets, tabular cells).

Fixes: #9231
2014-09-27 09:42:48 +02:00
Juergen Spitzmueller
959ad0b250 Fix some convert_TeX_brace_to_Argument glitches
Fixes: #9273
2014-09-27 09:37:54 +02:00
Scott Kostyshak
2cc0de8b8b Fix alignment rendering of multirow in LyX (#8976)
Multirow cells now have the same alignment rendering in LyX
as in the output. The alignment of a multirow can change as
long as the column is not of fixed width. If the column is
of fixed width, the multirow is left-aligned.

When setting a multirow, the alignment is copied from
the last cell in the selection.
2014-09-26 22:38:13 -04:00
Scott Kostyshak
427d0ef390 Reset status file after 2.1.2 release 2014-09-26 22:34:38 -04:00
Richard Heck
2d92af02c3 Updates to status file. 2014-09-10 16:30:07 -04:00
Juergen Spitzmueller
15957d003a Revert fix for #9231
This is more complicated than I thought.
2014-08-28 08:22:47 +02:00
Enrico Forestieri
43c669fb13 Fix the -geometry command line argument for Windows.
The command line argument -geometry WIDTHxHEIGHT±XOFF±YOFF
specifies a preferred size and location for the main window.
Currently, this is semi-broken on Windows. Indeed, only
specifying WIDTH and HEIGHT places the main window such that
the left and top borders are invisible such that the window cannot
be moved. Moreover, the XOFF and YOFF parts (when present) are
used to specify the distance of the window from the left and top
or right and bottom edges of the screen, when using '+' or '-',
respectively. However, -geometry 800x600-20-20, instead of placing
the window such that its bottom and right edges are at a distance
of 20 pixels from the corresponding screen edges, places the
window such that its left and top borders are out of the screen.
This is corrected by this commit.
2014-08-25 20:55:03 +02:00
Richard Heck
f52d5ae614 Minor updates to status file. 2014-08-15 10:53:38 -04:00
Richard Heck
8302d1bab1 Possible fix for the mystery crash, which is bug #9049.
Investigation of bug #9236 showed that crash to be due to a Paragraph's
holding a dangling pointer to an old and deleted Layout after the
DocumentClass was reset. Since the backtraces look almost identical, it
seems likely that we have the same problem here.

Since this crash seems almost always to involve tables, I looked at the
code in switchBetweenClasses() and found that the Paragraphs that belong
to "hidden" table cells are not seen by the initial recursion using a
ParIterator: It skips right over them. This was confirmed by test code
suggested by Enrico, with results reported in Trac.

The present patch attempts to deal with this problem in the second
recursion, over Insets. When we see an InsetTabular, we call a new
routine that recurses through the cells, looking for hidden ones. If it
finds a hidden one, it then resets the Layout for the cell's Paragraphs
(there should be only one, but we do not make any assumptions) to the
PlainLayout that belongs to the new DocumentClass. This is good enough,
since such cells never have content.

There is extensive discussion of the patch here:
  https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg185095.html
Additional testing by Enrico and me confirmed the existence of the
dangling pointer.

(cherry picked from commit 54c2ab2732)
2014-08-15 10:46:56 -04:00
Richard Heck
090bd44740 Fix bug #9236: After we recreate the DocumentClass, we have to apply
it to the document.

(cherry picked from commit c2fdbbe01a)
2014-08-07 15:16:16 -04:00
Enrico Forestieri
e2d834e8d0 Fix bug #9146 (Graphics conversion problem).
If LyX does not know about a given file format, it may easily
happen that the format is recognized as "latex" and this causes
bug #9146. This patch limits the check for a latex format to
non-binary files. The strategy for deciding that a file has
binary content is the same as that adopted by the "less" program.
This is a stripped down backport of the more complex fix in master.
2014-08-04 18:52:20 +02:00
Enrico Forestieri
a8b7e0a18b Add some postscript and pdf viewers for Unix and Windows.
For Windows: AcroRd32, SumatraPDF and gsview (both 32 and 64 bit versions).
For Unix: qpdfview.

Qpdfview is a nice alternative to Okular for KDE users and a superior
alternative to Evince for Gnome users, due to its complete synctex
support. It only depends on Qt libraries for the graphical interface.
2014-08-03 19:26:34 +02:00
Enrico Forestieri
64cc8a1c1e Use getent instead of grepping /etc/passwd.
Forthcoming versions of cygwin will use a different mechanism for
obtaining passwd/group information based on /etc/nsswitch.conf.
Thus, it will not be guaranteed that the files /etc/passwd and
/etc/group even exist. The recommended way for obtaining those
info is by using the getent command, which already works in
current versions.
2014-08-03 18:59:54 +02:00
Enrico Forestieri
47e263fa7f Fix compatibility issue with 64-bit cygwin. 2014-08-03 18:53:33 +02:00
Enrico Forestieri
154cd41119 Fix import of latex documents with scaled fonts. 2014-08-03 18:42:04 +02:00
Juergen Spitzmueller
d8b88a78a4 Fix bug with wrong baseline calculation in last paragraph
Fixes: #9231
2014-08-03 17:43:18 +02:00
Juergen Spitzmueller
03d6040904 Do not break documents with complex beamer block ERT usage we cannot handle
Fixes: #9144
2014-08-03 17:38:46 +02:00
Enrico Forestieri
2a0b22ba9e Fix bug #9151 (Wrong reverse search for images and tables).
If the reverse position corresponds to an inset, its paragraph id
does not follow the main text numbering. Typically, an inset has
only a few paragraphs, so that we would jump near the beginning of
the document. Now the cursor in LyX jumps to the right spot.
2014-08-03 16:47:22 +02:00
Juergen Spitzmueller
c31cb9fd98 Improve parsing of ERT arguments in beamer block titles.
Fixes: #9225
2014-08-01 16:06:42 +02:00
Enrico Forestieri
5f7948e5a5 Fix bugs 9190 and 9193.
The conversion from floating point to string performed by
boost:lexical_cast does not allow specifying a precision and,
for example, values such as 0.9 are returned as 0.899999976.
The standard C++ way for performing the conversion is using
std::ostringstream which is exempt from this problem, even if
less efficient. For the sake of accuracy, boost::lexical_cast
is ditched in favor of the ostrinsgstream implementation.
In C++11 another option would be using std::to_string, but I
think it is not as efficient as the boost way and not worth
implementing through #ifdef's.
2014-07-28 00:33:13 +02:00
Juergen Spitzmueller
edddfb99fc Fix beamer block conversion when arguments are in multiple ERTS.
Fixes second part of #9208.
2014-07-27 18:06:08 +02:00
Juergen Spitzmueller
a8ba869d73 Add beamer-resenumerate (from our wiki) to the list of safe modules for argument conversion, since it is safe.
Fixes part of #9208.
2014-07-27 18:02:35 +02:00
Juergen Spitzmueller
5210cfa5f9 Whitespace 2014-07-27 12:26:37 +02:00
Juergen Spitzmueller
8d8880d83b Fix typos in InsetListingsParams validator 2014-07-27 09:08:30 +02:00
Scott Kostyshak
63f980bc04 Backport 'select word on double click at boundary'
Now when double clicking on a boundary of a word, the
word is selected. This also causes single-letter words
to now be selected (fixes #9159).

Backported from bcbc162.
2014-07-26 17:30:56 -04:00
Jean-Marc Lasgouttes
3e60f58a92 Do not forget last word of paragraph in completion
With the old code, the last word of a paragraph would not be added in
the completion list. The key difference is to pass `from' instead of `pos'
to FontList::fontiterator.

Slight cleanup of the code.
2014-07-20 00:07:23 +02:00
Jean-Marc Lasgouttes
fa67a6ae89 Fix error spotted by cppcheck 2014-07-20 00:04:45 +02:00
Georg Baum
275c6dabe6 Fix bug #9162: Missing \use_indices
The lyx2lyx conversion for format 352 was incomplete: It should have been
added the \use_indices setting, but it relied on the fact that the default in
LyX for missing \use_indices is the same as the old format without that
setting used. However, the default might change in the future, and later
lyx2lyx conversions rely on that setting as well.
2014-07-09 20:58:44 +02:00
Georg Baum
f5cf3705d5 Make theWordList() thread safe.
Without this, you get crashes in a few second when you set the autosave
interval to one second and edit quickly (typing new words etc). The reason
is that the cloned buffer wants to insert words into the word list and
remove them again, but it lives in a different thread.
2014-07-06 18:12:57 +02:00
Georg Baum
e64954e7d3 Reset after 2.1.1 release 2014-07-06 18:02:56 +02:00
Uwe Stöhr
d13650974b sv.po: translations for LyX 2.1.1 from Jim 2014-06-26 00:19:50 +02:00
Uwe Stöhr
34f6289ac2 es.po: translations from Ignacio 2014-06-21 01:40:07 +02:00
Uwe Stöhr
f1fa30ab83 fr.po: updates from Jean-Pierre 2014-06-21 01:24:51 +02:00
Richard Heck
e49f4124c7 Backup the existing LyX file before attempting to write the new one.
This avoids dataloss in case we are unable to write the new one after
all.

A more sophisticated approach, due to Georg, is in master, but it needs
more testing that it will be able to get before the release of 2.1.1.
That should be committed to 2.1.x when it is ready and this patch backed
out again.
2014-06-14 17:42:27 -04:00
Richard Heck
a72e68dd09 Revert "Use a different naming scheme, per Enrico's suggestion."
This reverts commit fff454fa4b.

Revert "Per a suggestion of JMarc's, first write the saved file to a"
This reverts commit 094129f804.
2014-06-14 17:42:26 -04:00
Uwe Stöhr
a8dcda1e6c ia.po: updates for 2.1.1 from Giovanni 2014-06-13 00:42:18 +02:00
Enrico Forestieri
32e42f2f81 Set the default locale at startup.
On startup, the default locale is "C", meaning that all system
functions assume an ascii codeset. The environment's locale
settings should be selected by calling setlocale(LC_ALL,"").
This is done by Qt during the QCoreApplication initialization
but this inizialization is never performed for batch processing
and, as a result, LyX is not able to process files whose names
contain non-ascii characters. This is not an issue on Windows,
where the file names are always stored as UTF-16, so the call is
only performed for unix-like platforms (this also includes cygwin,
due to its own filenames management that allows using characters
which are forbidden to native programs).
2014-06-11 19:08:44 +02:00
Enrico Forestieri
970da7c5e2 Fix bug #9153 (Using mathpanel to insert matrix creates extra space on top)
The code was setting the current index before filling the
combo box items.
2014-06-08 23:59:59 +02:00
Jean-Marc Lasgouttes
3544ce4a4e Fix crash when accepting change
The problem is the use of cursor movement methods to update cursor.
Cursor::forwardPos() steps into insets, which is not always what we
want. The problem here is that there is a math inset just after the
accepted change, and that the cursor steps into it for some reason.

This code is a nightmare anyway.

Fixes: bug #9145
2014-06-05 12:51:40 +02:00
Richard Heck
b9db0c1321 Flush stream more often to help figure out where the mystery crash
originates.
(cherry picked from commit 5536b0c7fe)
2014-06-04 09:22:21 -04:00
Jean-Marc Lasgouttes
d4faf127d7 Make TextMetrics::editXY more robust
This fixes a crash in examples/fa/splash.lyx when selecting text
representing menu entries. This happens because menu names are in LTR
English, while the inset itself is in RTL.

The problem is that the current code relies on the fact that
 1. getColumnNearX and checkInsetHit share the same idea about cursor
    position.
 2. pos and pos + 1 are in general consecutive on screen.

It seems that 1. is wrong here (for reasons I did not try to
understand); the second assumption is definitely false with
bi-directional text. This makes editXY very fragile.

The new code should be more robust in this respect. The logic is:
 * if checkInsetHit finds an inset, use its position,
 * otherwise, ask getColumnNearX for the cursor position.

Fixes: #9142
2014-06-04 12:17:01 +02:00
Uwe Stöhr
aa6a4c818d fr.po: updates for 2.1.1 from Jean-Pierre 2014-06-04 02:52:44 +02:00
Richard Heck
094129f804 Per a suggestion of JMarc's, first write the saved file to a
temporary name, then move it to its real location if we succeed.
This prevents our over-writing the existing file with a corrupt
one.
(cherry picked from commit 10364082c8)
2014-06-03 11:48:49 -04:00