Commit Graph

296 Commits

Author SHA1 Message Date
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