Commit Graph

296 Commits

Author SHA1 Message Date
Georg Baum
9ebc325be3 Work around MSVC warning
The statement
	if (pos < from + lyxrc.completion_minlength)
triggers a signed vs. unsigned warning. I don't know why this happens, it
could be a MSVC bug, or related to LLP64 (windows) vs. LP64 (unix)
programming model, or the C++ standard might be ambigous in the section
defining the "usual arithmetic conversions". However, using a temporary
variable is safe and works on all compilers.
2015-01-09 11:54:05 +01:00
Uwe Stöhr
7cdd083a73 fr.po: translation updates from Jean-Pierre 2015-01-07 02:33:49 +01:00
Enrico Forestieri
383334c1fe Fix bug #9342: LaTeX build get stuck for unconventional path name
The reason being that the TEXINPUTS path list was not quoted on Windows.
This was no problem with spaces but some special characters are
interpreted by the shell and can cause problems. In this particular
case, the '&' character was being interpreted as a command separator.
2015-01-06 22:06:46 +01:00
Enrico Forestieri
855f24e063 Fix bug #9319: Problems with space inside math and textrm. 2015-01-06 21:50:58 +01:00
Enrico Forestieri
69179c08e7 Fix bug #7970: space disappears from equation when reopening LyX file. 2015-01-06 19:57:54 +01:00
Jean-Marc Lasgouttes
1997e8b817 Reimplement inset-select-all in a generic way
There are 3 possible actions (in order)
* select current cell
* select all calls of inset
* select the inset from outside (in the containing inset)

C-a is now bound to inset-select-all

C-M-a is bound to the global "select all". The
reason for this change is that selecting an inset
is a more common operation that selecting an entire
document.

This patch is the result of discussion on #7727.
2015-01-06 11:05:49 +01:00
Georg Baum
f067babf6e Fix multithreading crash (bug #9366)
This minimal fix makes the crash go away on my machine. A much more complete
fix is in master (and will be futher extended), but for 2.1.x we'll do only
minimal changes.
2015-01-05 21:44:37 +01:00
Juergen Spitzmueller
450288b130 Fix aspectratio UI
Fixes: #9357
2015-01-04 18:07:05 +01:00
Georg Baum
7aab315c81 Fix parsing of verbatim options (bug #9113)
Parser::verbatimOption() did swallow backslashes previously. The similar code
in Parser::verbatim_item() was already correct.
2015-01-03 20:51:02 +01:00
Georg Baum
151abe293e Parse post command argument insets (bug #8473)
This is now very easy with the new InsetArgument infrastructure.
2015-01-03 18:14:20 +01:00
Georg Baum
8b75ce5830 Fix misparsing of \textgreek without polyglossia
\textgreek was interpreted as the polyglossia version even if polyglossia
was not used. Now the symbols defined in unicodesymbols are detected correctly
and converted to unicode, while others are converted to ERT (bug #8553).
2015-01-03 17:27:22 +01:00
Georg Baum
202e848a0e Parse tikzpicture env. correctly (bug #9011) 2015-01-03 17:21:14 +01:00
Georg Baum
9c54ee6f0d Handle unknown table column specifiers (bug #9311)
Previously tex2lyx did ignore table columns if the column specifier was
unknown. This can lead to data loss, and now it does not ignore these columns,
but assumes that the column specifiers use only once character. This can still
lead to data loss, but less often.
2015-01-03 17:06:39 +01:00
Georg Baum
dbbc4239a6 Fix HTML output of \gg, \ll and \ne (bug #9372)
The fix consists of three parts: The fix for \ll and \gg, the needed
infrastructure to assign HTML entities to global math macros, and the actual
fix for \ne and \neq.
2014-12-30 13:39:52 +01:00
Juergen Spitzmueller
0be08dde6d Do not warn about changed modules when changing modules.
Part of #9356
Also fixes #9365
2014-12-25 10:50:21 +01:00
Juergen Spitzmueller
b215e58ed1 Output package options before loading any package.
Fixes: #9355
2014-12-22 09:21:28 +01:00
Juergen Spitzmueller
c213243600 When switching classes, warn user about all unapplied document changes
Currently, this is limited to modules.

Part of #9356.
2014-12-21 17:45:39 +01:00
Uwe Stöhr
f6c520d4e7 ar.po: updates from Hatim 2014-12-15 02:05:49 +01:00
Jean-Marc Lasgouttes
1ae74b2dd7 \\subfloat captions are moving arguments
Therefore insets should be protected in these captions.

Fixes bug: #9346.
2014-12-08 17:39:56 +01:00
Juergen Spitzmueller
c52b99d989 Update the spec file template
Patch by user aluchko in #9349

Fixes: #9349
2014-12-08 16:47:47 +01:00
Jean-Marc Lasgouttes
849f1ddf58 Missing status entry for commit 53436891f7 2014-12-08 15:07:13 +01:00
Juergen Spitzmueller
0093d84f10 Add forgotten status entry 2014-12-08 10:48:33 +01:00
Jean-Marc Lasgouttes
565cb2a3f0 Fix a couple of compiler warnings 2014-12-08 09:47:45 +01:00
Uwe Stöhr
b56ecec869 status.21x: fix a typo 2014-12-04 01:15:18 +01:00
Uwe Stöhr
aad32862c3 status.21x: a writing style fix 2014-12-04 00:50:27 +01:00
Uwe Stöhr
cdeb542fc0 tex2lyx: backport support for relative sizes and glue lengths 2014-12-04 00:48:27 +01:00
Uwe Stöhr
515e70a7da tex2lyx/Preamble.cpp: add support for all \defskip lengths
backports commit c2e0f223
2014-12-04 00:41:51 +01:00
Uwe Stöhr
6d8cb0055e tex2lyx: support for the Libertine fonts 2014-12-04 00:18:32 +01:00
Uwe Stöhr
44682af7d9 mathed: infoize some messages
- fixes bug #1908
2014-12-04 00:11:57 +01:00
Uwe Stöhr
01c5c497c2 IEEEtran templates: fix language package settings
according to the IEEE writing guidelines one must not use babel otherwise one would violate the caption formatting rule; fixes bug #9350
2014-12-04 00:05:37 +01:00
Jean-Marc Lasgouttes
3040adf765 Fix reverting of chunks insets to 2.0 format
When the chunk inset did not have an optional argument, the prefix of the chunk was omitted.

Fixes bug: #9343
2014-12-01 10:38:10 +01:00
Juergen Spitzmueller
560a421e58 Fix and simplify par params parsing in get_containing_layout.
The previous version did not catch \align <alignment>.
2014-11-30 09:40:45 +01:00
Juergen Spitzmueller
42c51e7169 Fix conversion of beamer block titles when the language is switched at the beginning of the title 2014-11-25 19:18:22 +01:00
Georg Baum
e32147a1fe Fix memory error detected by valgrind
The assignment name = sub.str(1) reads from the first argument given to
regex_match(), but previously this was a temporary object which was already
out of scope. This did probably not matter much in practice, but invoked
undefined behaviour, and as we all know this is allowed ton format your hard
disk or kill to your cat, so better fix this.
2014-11-19 20:42:04 +01:00
Georg Baum
3cc5283940 Fix recursive math macro crash (bug #9140)
This is different from bug #8999, since in this case a new macro instance is
created. You still get a TeX capacity exceeded error if you try to typeset the
exported document, but this is the same as for bug #8999 and better than a
crash.
2014-11-16 09:37:29 +01:00
Uwe Stöhr
085d3937c6 tex2lyx: support for \item with opt arg in itemize environment 2014-11-15 21:22:21 +01:00
Georg Baum
acc771b212 Fix bug #7954 (now really)
Thanks to maciejr we know now what the remaining problem was with bug 7954:
My unicode symbol fallback works fine, the problem was that a font named
"Symbol" is available on OS X, but it does not use the font-specific encoding
we expect: Almost all glyphs are at their unicode code point.
Therefore the bug is fixed by re-enabling the unicode workaround and blocking
the Symbol font on OS X.
2014-11-14 19:09:34 +01:00
Stephan Witt
12ee18278e #9317 add status entry 2014-11-13 19:36:52 +01:00
Georg Baum
24426cc614 Fix memory errors found by Alfredo with valgrind
BufferParams::setDocumentClass() deletes the old document class of the buffer
and creates a copy of the new one. Therefore, the stored layout pointers in
the paragraphs (actually only one paragraph exists) are dangling afterwards.
Resetting them before setting the document class helps here.
In the long term we need to get rid of BufferParams::setDocumentClass()
completely, this is very ugly.
2014-11-12 20:31:32 +01:00
Uwe Stöhr
bf8ed77c15 status.21x: style fixes 2014-11-10 03:38:38 +01:00
Uwe Stöhr
53aa2267df remerge po-files
- requested merge by Richard to merge big the Portugal translation update
- also update the de.po and the status.21x file
2014-11-10 03:18:13 +01:00
Uwe Stöhr
7b20cc5258 tex2lyx: backport new features from master
- support for bibtopic, \nameref and 2 math fonts
2014-11-10 02:23:05 +01:00
Enrico Forestieri
b16b1ddb58 Fix CAS computation of a selected subformula.
Invoking a computer algebra system program for computing a selected
subformula has never worked (checked with all LyX versions back to 1.3)
and, moreover, in the presence of a selection things go awry.
This commit allows this computation by replacing the selected
subformula with the result of the computation.
2014-11-10 00:47:50 +01:00
Enrico Forestieri
5644470576 Fix issue with CAS.
See http://thread.gmane.org/gmane.editors.lyx.devel/153516
This regression was due to a thinko in [43f6b167/lyxgit].
2014-11-09 21:33:53 +01:00
Uwe Stöhr
aa82c1cc19 InsetFootlike.cpp: disallow to use listings in foot-like insets
- fixes bug #9321 also for branch
2014-11-06 00:31:42 +01:00
Uwe Stöhr
6cefd29d41 PDF-comment.lyx: new example file
- backport from master, fixes #9310
2014-11-06 00:19:22 +01:00
Jean-Marc Lasgouttes
02a2241727 Fix wrong test: boolean variable is never negative
This has been spotted by clang++.
2014-11-05 18:23:32 +01:00
Richard Heck
8f40d784c0 Fix bug 9300. We need manually to convert newlines to paragraph breaks. 2014-11-04 09:54:45 -05:00
Juergen Spitzmueller
6f3fbc9cd3 lyx2lyx: fix convert_chunks for empty chunk layouts
Fixes: #9298
2014-11-03 16:46:20 +01:00
Richard Heck
3ca8502ae9 Do not truncate references in outline pane (bug 9312).
(cherry picked from commit 1f45e6527a)
2014-10-30 18:43:25 -04:00
Richard Heck
bd2c17f9fb Sort debug options in the message pane by string. This makes it
much easier to find what you need, especially when we're trying
to help users. Previously, they were sorted by their enum values.

(cherry picked from commit de3daf040b)
2014-10-26 18:00:29 -04:00
Uwe Stöhr
da6cce3b62 status.21x: document recent change and correct a bug number 2014-10-26 17:25:12 +01:00
Uwe Stöhr
03d3f8b5f3 revtex4-1.layout: remove unnecessary preamble code
- \lovname was already added to REVTeX 4.1 in 2010
- REVTeX does purposely not allow to color text, see the discussion in bug #4625
2014-10-26 14:21:11 +01:00
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
Georg Baum
76417c7326 Do not corrupt documents without newline at EOF
trim_eol() assumes that a line always ends either with \n, \r, or \r\n.
This assumption is always valid except for the last line of a document, since it
may miss the trailing newline. LyX does not create such documents, bu they may
result from automatic creation tools, and LyX can read them, so lyx2lyx should
be able to read them as well.
(cherry picked from commit c75c6e446a)

Fix the fix

MAC-style (pre-OS X) line ends were not recognized anymore
(cherry picked from commit 55af9cb006)
2014-05-29 11:28:04 -04:00
Richard Heck
b128f3de14 Fix bug #9131 for stable branch. The real problem lies
elsewhere, but it will require major surgery and, more
importantly, a file format change.
2014-05-23 11:01:07 -04:00
Juergen Spitzmueller
994155b2a6 Output arguments required by arguments with default or preset arg
Fixes: #9128
2014-05-21 15:53:53 +02:00
Juergen Spitzmueller
ad723c41b6 Fix nesting in some beamer reversion methods.
Patch by Enrico
2014-05-21 15:44:30 +02:00
Georg Baum
c9fdf37678 Ugly fix for bug #9102
The real problem is the encoding of latex_language: It is hardcoded to latin1,
but InsetListig uses the currently active encoding. Therefore, we cannot tell
whether any given character wil be encodable or not, and we should not prevent
non-ACII characters.
In the future, we need to make the encoding of latex_language dynamic, so that
it always represents the currently active encoding. Then, we could do the
correct check both for listings and ERT. For now, I simply disabled the
encoding check for listings, which also means that bug 9012 might occur in
other cases for listings, but this is less important than bug 9102.
2014-05-19 21:50:34 +02:00
Juergen Spitzmueller
1379c381c3 Fix crash when right-clicking into an inset with more paragraphs than the main text.
Fixes: #9123.
2014-05-18 18:08:43 +02:00
Richard Heck
ccd8cd89ad Add limits to searches in convert_TeX_brace_to_Argument.
(cherry picked from commit eb26d85dc9)
2014-05-18 11:26:34 -04:00
Enrico Forestieri
1fa06296b6 Adapt output to the on-screen representation.
LyX assumes that a standard paragraph following a layout with
NextNoIndent==false has to be indented on screen, so output the
necessary blank line to make it so also in the output.
2014-05-17 22:05:07 +02:00
Enrico Forestieri
f5a246b185 Fix an on-screen representation glitch.
If a layout has NextNoIndent set to true, the following paragraph
is not indented on screen. LyX checks the previous layout for that
style parameter to decide whether to indent or not. Of course,
what matters is the latex output and the on-screen representation
should match this output. Now, when a layout has NextNoIndent==true,
the latex output is correctly not indented, while the on-screen
representation may fail to match this output. This can occur when,
for example, a standard paragraph is nested in the previous layout,
because LyX would check the property of the nested layout instead
of the container layout. Thus, LyX should check the property of a
previous layout at the same depth for correctly deciding whether
a paragraph has to be indented or not.
See also http://www.lyx.org/trac/ticket/9055#comment:12 for an
example document where the previous scenario actually occurs.
2014-05-16 21:58:21 +02:00
Richard Heck
b17802ba81 Fix bug #9112: There is a test here that seems intended to catch the
case where there are unbalanced braces, but it comes too late. In that
case, we try to check cmd[docstring::npos] and crash.
(cherry picked from commit 6b0a8fbc96)
2014-05-10 10:40:30 -04:00
Juergen Spitzmueller
ede754039d Beamer block conversion: consider ERT arguments with leading/trailing blanks
Should also go to branch.
2014-05-08 19:52:01 +02:00
Enrico Forestieri
2c2ba981fb Fix problem with drawing of math backround with selections.
(cherry picked from commit 3e681bea4f)
2014-05-07 14:23:53 -04:00
Juergen Spitzmueller
5160fa1043 Stabilize mouse selection in mathed
Fixes: #9074
2014-05-06 17:10:11 +02:00
Jean-Marc Lasgouttes
bd206ff5f5 Turn an error message into a Debug::LOCALE warning 2014-05-06 16:41:26 +02:00
Juergen Spitzmueller
b14e5925a9 Fix View Source size
Fixes: #9084.
2014-05-02 11:03:32 +02:00
Georg Baum
90a16b3ec1 Forgot status 2014-05-01 13:53:17 +02:00
Juergen Spitzmueller
932b81c175 Status update 2014-04-30 16:06:27 +02:00
Uwe Stöhr
ff507c1a33 status.21x: move an entry to the correct position 2014-04-29 22:27:51 +02:00
Uwe Stöhr
f5fb48cdb5 Merge branch '2.1.x' of git.lyx.org:lyx into 2.1.x 2014-04-28 22:27:19 +02:00
Uwe Stöhr
e7e5bfc8b6 zh_CN.po: updates from Min Ding 2014-04-28 22:26:59 +02:00
Georg Baum
b73a59932e Fix lyx2lyx math package defaults (bug #9069)
lyx2lyx sets all new math packages to off when converting from old formats.
This is correct if any command which would cause an automatic package loading
exists in the document. However, it is wrong if no command exists: This leads
to problems if later a command is added (bug #9069), which is especially
annoying for templates.
The fix consists of two parts:
1) convert_use_package() considers now the used commands like
   revert_use_package(), and uses them to decide whether to set the package to
   auto or off.
2) convert_undertilde() and revert_undertilde() use a slightly adjusted copy of
   convert_use_package() and revert_use_package(), so that the bug is also
   fixed for undertilde. We cannot use the latter functions directly, because
   of "\usepackage undertilde" vs. "\use_undertilde".
2014-04-27 18:09:29 +02:00
Georg Baum
d47a556b46 Fix math package conversion to 2.0 format
When doing the lyx2lyx round trip of the 2.0.8 user guide from format
413 -> 474 -> 413 you get an invalid document, because the math packages
mhchem and undertilde are incorrectly converted.
It turned out that the old reversion code did only work for particular
package oderings. The new one works for abitrary sorted packages.
2014-04-27 18:08:24 +02:00
Georg Baum
28bde98d76 Fix data loss in user guide conversion to 2.0.x
When doing the lyx2lyx round trip of the 2.0.8 user guide from format
413 -> 474 -> 413 you do not get a zero diff. The most important problem is
caused by the conversion of the argument insets to the old syntax: This
conversion adds an additional empty line (harmless), and it destroys the
document structure if the first inset in e.g. a subsection is not an argument
inset, but e.g. an index or label inset.
The fix is quite easy: Ensure that the paragraph begin is set to the first
argument inset.
2014-04-27 18:06:34 +02:00
Georg Baum
e754d00faa Fix warning in lyx2lyx 2.0<->2.1 round trip
revert_justification() issues a warning if the \justification parameter does
not exist, and LyX itself always writes it unconditionally as well, so add it
also in lyx2lyx when converting old documents.
Currently this does not have any user visible effect, but it decouples the
default value of BufferParams::justification from the conversion of old
documents: Now it is possible to set the default to false in LyX, and old
documents will still be converted correctly.
2014-04-27 18:05:22 +02:00
Juergen Spitzmueller
8b7d5276b8 Fix conversion of beamer block titles that end with a non-ERT inset. 2014-04-27 09:44:43 +02:00
Richard Heck
dd44f71cf9 Fix failure to detect quoted flex insets in conversion to layout
48. Also, simplify this code.
(cherry picked from commit 7e1541dd49)
2014-04-25 17:21:32 -04:00
Scott Kostyshak
2cea5b08dc Typo 2014-04-22 14:36:14 -04:00
Scott Kostyshak
06c926e699 Do not spellcheck "code" in logical markup module 2014-04-22 14:35:18 -04:00
Juergen Spitzmueller
8f5af7c453 Bibtopic requires styles files to be passed via argument
Fixes: #9060
2014-04-22 09:32:48 +02:00
Jean-Marc Lasgouttes
6bce9abfee Respect group integrity when removing stuff from the Undo stack.
Fixes: #9079
2014-04-20 22:54:31 +02:00
Juergen Spitzmueller
3501e41e81 Do not substract cursors pos from two different cells (fix assertion while doing adv search)
Fixes: #7944.(cherry picked from commit f6138ed02f47b8bbe65d3245f9e92686dc24296c)
2014-04-18 10:52:48 -04:00
Jean-Marc Lasgouttes
bd86ce71d8 Fix oversight in autotools packaging selection
The only consequence of this thinko is that the lyx.desktop and the svg icons were installed on Mac OS and Windows platform, whereas they are useless.
2014-04-18 10:52:48 -04:00
Jean-Marc Lasgouttes
a556652f6e Do not store Languages objects in completion words lists
In the current code each paragraph contains a map<Language,
WordList*>, which means that it contains a full copy of the language
object. Since these objects contain translation tables nowadays, this
is a very bad idea.

This patch simply replaces the Language key by a string.

When loading the Userguide on linux/x86_64, the total memory
consumption decreases from 36.27MB to 31.50MB.
2014-04-18 10:52:48 -04:00
Juergen Spitzmueller
8b60088eaa In Paragraph::changeCase, correctly track the font of the changed characters (fix crash)
Fixes: #7943
2014-04-18 10:52:47 -04:00
Juergen Spitzmueller
892da302d6 Do not allow the manual insertion of a directory (without filename) into the import dialog and thus prevent an assertion.
Fixes: #7437(cherry picked from commit afd897029917a083fbeb84cccd4e6cb0a21db7ed)
2014-04-18 10:52:47 -04:00
Benjamin Piwowarski
a0cc99ff6a Fix problem with python and change of PATH
- waits that lyxrc has been read before finding python
- when the PATH changes, resets the value
- updated status.21x
2014-04-18 10:52:47 -04:00
Juergen Spitzmueller
0fd4db5c9a style 2014-04-18 10:52:47 -04:00
Juergen Spitzmueller
90ce24a38d Do not crash when entering math in ct mode with merge dialog open.
Fixes: #7685.
2014-04-18 10:52:47 -04:00
Juergen Spitzmueller
4398a7b02f \lyxdeleted uses an ulem command.
Therefore we need to put \cite and \ref into \mboxes, as in our native ulem commands.

Fixes: #8806.
2014-04-18 10:52:47 -04:00
Juergen Spitzmueller
dfa07c1424 Fix selection drawing after mouse-double/triple in mathed
Fixes: #8829
2014-04-18 10:52:46 -04:00
Juergen Spitzmueller
e6da35a60b InsetListings: Rewrite C-ism in C++ and fix terminator bug.
The rewriting is completely done by JMarc. The terminator bug fix has been added to that by me.

Fixes: #8985
2014-04-18 10:52:46 -04:00
Scott Kostyshak
2a6d135e55 Focus on buffer after section select in Outliner 2014-04-18 10:52:46 -04:00
Richard Heck
1c649ce376 New status file. 2014-03-22 17:55:33 -04:00