Commit Graph

20519 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
ed1515ef69 Read list of translated languages from a file
The previous scheme of loading all possible translations and checking whether the work
is a bit too much "brute force" and causes problems on Mac OS X (documents loaded
with the wrong language).

In the new scheme, autotools install a file lib/installed_translations that contains a list of installed languages (the .gmo files that got installed). This file is read
in Languages::readInstalledTranslations and allows to set the translated() property
of each language.
2012-07-19 00:21:28 +02:00
Jean-Marc Lasgouttes
c999e35e54 Make sure that undo is recorded when magic tricks are played with InsetBibitem.
Fixes bug #7111: Assertion with undo and InsetBibitem

  * add Paragraph::brokenBiblio(), with tells whether there is something to fix.
  * rename Paragraph::checkBiblio to fixBiblio; simplify it greatly by using
    InsetList methods
  * In TextMetrics::redoParagraph, call recordUndo before fixBiblio (only when
    there is something to fix obviously)

Special care is taken to update cursor only when it makes sense. Note
that there are cases where undo information is not recorded (current
cursor not in the slice where action happens)
2012-07-18 15:36:58 +02:00
Juergen Spitzmueller
4d5bef1bdc Add \makeat switches to babel settings if necessary.
Babel settings might contain @ characters. Check for this and wrap the settings into \makeatletter ... \makeatother switches if necessary (see discussion at #8265).
2012-07-18 12:41:53 +02:00
Jean-Marc Lasgouttes
467422f9df Do not kill the undo stack when doing a Save As...
The code does a reload on the buffer to avoid loose pointers if the
file changes directory. This commit adds a bool parameter to
Buffer::reload to allow for keeping the undo stack intact. This is of
couse only wanted in this case, not when reloading an earlier version
of the file.
2012-07-18 10:31:47 +02:00
Jean-Marc Lasgouttes
6ec1683aee Fix crash introduced in my previous commit f6b1c24b
Cursor::fixIfBroken does not do what I thought it did. Lift some code
from StableDocIterator::asDocIterator instead.
2012-07-17 22:26:44 +02:00
Jean-Marc Lasgouttes
e2b42b1726 Fix bug #8242: undo fails for longest label width
In the existing code for setting layout of pragraph parameters,
Text::undoSpan is used to "guess" which paragraphs should be saved in Undo.
With this patch the approach is more precise: before every explicit change
to a paragraph, a Cursor::recordUndo call is inserted. This is much more robust than trying to guess.

In particular, we do not look at depth changes at all, since they are now
handled in updateBuffer since #8159 has been fixed.
2012-07-16 23:39:24 +02:00
Jean-Marc Lasgouttes
02ce050fb8 Make the toolbar code less noisy when the session file is not found 2012-07-16 23:11:26 +02:00
Jean-Marc Lasgouttes
2e1c618824 Typo introduced in commit 16fd47ad. 2012-07-16 00:30:28 +02:00
Pavel Sanda
7b1b9823ff Add comment in lstrings.h 2012-07-15 23:25:58 +02:00
Jean-Marc Lasgouttes
16fd47ad8f Fix bug #7741: incorrect locale when starting R from LyX?
The goal here is to get rid of the old code that modified variables
LANGUAGE and LC_ALL, therefore creating the problems mentionned
in the ticket.

In the new system, there is no explicit "GUI" message handler, that
needs to be reset at each language change. Instead, getGuiMessages
calls getMessages with the correct parameter. This allows to simplify
greatly the code and to remove a lot of old cruft.
2012-07-15 22:22:10 +02:00
Jean-Marc Lasgouttes
f6b1c24b99 Fix bug #5204: Undo removes text selection
This commit does a bit more than fix selection, since it saves the full cursor state
in the undo stack. This means that undo now restores:
* the selection
* the current font
* transient mark (shall we keep this one?), logical position...

In order to do that, it introduces an intermediate class between Cursor and DotIterator: CursorData.
The new inheritance diagram is thus
  DocIteraator -> CursorData -> Cursor

CursorData contains all the members of Cursor that define the current position, but not the stuff
related to current view of dispatch mechanism. It may make sense in the future to move members
between CursorData and Cursor and to move some member functions to CursorData.

Now UndoElement uses CursorData for cur_before and cur_after, but not for the cell. The undo API uses
also CursorData instead of DocIterator.
2012-07-15 18:16:09 +02:00
Richard Heck
a0afcdb391 LFUN_CLOSE_TAB_GROUP does exactly the same thing as
LFUN_BUFFER_CLOSE_ALL if there's only one tab group open, so there's
no need to enable it in that case.
2012-07-14 22:13:40 -04:00
Richard Heck
5400ae0720 Fix bug #8160 by updating the dtd for MathML. 2012-07-10 18:07:07 -04:00
Richard Heck
17c5791454 Fix stupid typo. 2012-07-10 17:11:58 -04:00
Georg Baum
af322ba9b4 Make CJK.lyx exportable.
If there was an encoding set by the inputenc package, it must not be ignored.
Now all tex2lyx test cases can be exported to .tex again by LyX (although
there are still some differences in the .lyx output).
2012-07-08 22:35:22 +02:00
Georg Baum
c3731b25da Fix tex2lyx -roundtrip for XeTeX documents 2012-07-08 21:35:40 +02:00
Uwe Stöhr
f0335cef1e tex2lyx: fix a regression
Preamble.cpp: - partly revert [e1b181dd/lyxgit] because the math packages cannot by default be loaded as the user might have defined special commands
2012-07-08 21:32:26 +02:00
Georg Baum
840f6fda51 Don't stop testing after first error.
This was the reason why I forgot to update the last test file in the last
commit.
2012-07-08 20:52:26 +02:00
Georg Baum
45fd75fe96 Manually update test results to current format.
Now you can see the regressions without differences caused by real
fixes or file format updates.
2012-07-08 20:09:02 +02:00
Georg Baum
1c0bd0132c Add very simple tex2lyx regression test suite.
It is invoked by 'make check' (automake only, it would be nice if someone
could add it to cmake as well), or by calling

python src/tex2lyx/test/runtests.py <path to tex2lyx binary>

by hand. Currently, it does not compare the output (this comes later).
The added .lyx files are from tex2lyx around mid of april, so that you
can see the regressions of the current version if you run the test
yourself (simply run git diff afterwards).

The home made test runner is quite stupid, but better than nothing.
Feel free to improve it or replace it with something better, as long
as running it stays as simple as now.
2012-07-08 19:28:19 +02:00
Georg Baum
57a8ea32c0 Include the recently added test files in package 2012-07-08 18:12:26 +02:00
Uwe Stöhr
4e69b9bac5 tex2lyx/text.cpp: fix typos 2012-07-07 13:40:07 +02:00
Uwe Stöhr
fe5a4c8c81 tex2lyx: improve CJK handling
- tex2lyx/text.cpp:
 - fix bug that swallowed valid braces
 - the encoding is "Bg5" not "BIG5"
 - add and update comments

- CJK.tex: add an example for the Bg5 encoding
2012-07-07 13:37:26 +02:00
Uwe Stöhr
d8611f25f2 tex2lyx: remove some superfluous code
text.cpp: besides that eat_whitespace does nothing these calls would be wrong as whitespace is allowed as argument of the box commands
2012-07-06 23:35:33 +02:00
Uwe Stöhr
02b6586ad7 update a tex2lyx test file
box-color-size-space-align.tex:
 - add all possible math spaces
 - remove 2 invalid non-math spaces
2012-07-06 23:33:28 +02:00
Uwe Stöhr
487c8b5bd3 tex2lyx: update a command
Parser.cpp: improve a command as discussed
2012-07-03 00:39:41 +02:00
Juergen Spitzmueller
555ae019b8 update tex2lyx TODO 2012-07-01 14:48:20 +02:00
Juergen Spitzmueller
11f7efe2eb Set the appropriate quote style when switching the main language 2012-07-01 11:27:42 +02:00
Juergen Spitzmueller
837869452a Add quote style information to languages 2012-07-01 11:25:52 +02:00
Juergen Spitzmueller
507302b444 Whitespace 2012-07-01 08:38:54 +02:00
Uwe Stöhr
56f0e0c4fc tex2lyx/Parser.cpp: refine \verb handling 2012-07-01 02:12:56 +02:00
Uwe Stöhr
d10063fd20 polyglossia tex2lyx coding style improvement
- Preamble.cpp/:
 - move list definition out of anon namespace
 - declare lists and a function in the class

- text.cpp: remove the now already defined list
2012-07-01 01:47:39 +02:00
Uwe Stöhr
85c479f4e7 test-structure.tex: add checks for \verb 2012-06-30 15:29:53 +02:00
Juergen Spitzmueller
e903d0158e Whitespace
If someone can tell me how I can tell QtCreator to actually use tabs, not spaces, I would be most grateful (yes, I have set Tab Policy to Tabs Only in Prefs)
2012-06-30 13:45:58 +02:00
Juergen Spitzmueller
5eb9ece39e Properly escape splitindex shortcut and try to encode splitindex name properly (part of bug #8227) 2012-06-30 13:34:49 +02:00
Juergen Spitzmueller
51d591d168 Factor out method to get a properly encoded latex string 2012-06-30 13:30:48 +02:00
Uwe Stöhr
708979fb0e tex2lyx: whitespace only 2012-06-30 03:38:02 +02:00
Uwe Stöhr
80884330d1 tex2lyx: fix handling of \verb
- Parser.cpp: \verb can have any character as delimiter (except of ASCII letters) not only '+', therefore partly revert [3943b887/lyxgit] and fix it for all cases
2012-06-30 03:25:19 +02:00
Uwe Stöhr
85ef627eac fix mistake in tex2lyx testfile
- XeTeX-polyglossia.tex: Hebrew is used in the file and so it must be declared
2012-06-30 02:21:15 +02:00
Juergen Spitzmueller
0062538a54 Add some more characters that need to be escaped in labels etc. 2012-06-30 01:24:40 +02:00
Jean-Marc Lasgouttes
bbbc2b6541 Fix to #8159: Undo doesn't restore environment depth correctly
The idea is to record undo at the place where the document is modified:

1/ in Buffer::updateBuffer, add a recordUndo, with the caveat that a
   const_cast has to be used (because updateBuffer is const but
   modifies the document, go figure).

2/ in GuiApplication::dispatch, add an extra undo group that
   encompasses the updateBuffer call. Some other undo groups may be
   redundant now, but it is not a problem since they do not cost
   anything.
2012-06-29 15:25:47 +02:00
Jean-Marc Lasgouttes
c22334eb3b Revert "Tentative fix to #8159: Undo doesn't restore environment depth correctly"
This reverts commit e3854bb59b.
2012-06-29 15:22:24 +02:00
Pavel Sanda
e43f9d3bbd Revert a6e42e5079.
Removing debug.h makes debugging via lyxerr<< twice as hard.
2012-06-28 20:52:20 +02:00
Juergen Spitzmueller
6de47fa873 fix bug #8209: polyglossia commands ignored partial source preview 2012-06-28 18:15:43 +02:00
Uwe Stöhr
2c9310d935 tex2lyx: fix a typo
tex2lyx/text.cpp: the encoding must be _set_ here
2012-06-27 23:58:16 +02:00
Uwe Stöhr
8f7195a251 tex2lyx: fix a logic mistake
Preamble.cpp: set missing begin position for the search; thanks Vincent for spotting
2012-06-27 23:18:02 +02:00
Uwe Stöhr
d1800d4d5a tex2lyx: reprivatize another variable 2012-06-27 22:48:22 +02:00
Uwe Stöhr
b6192b7c7f texlyx: re-privatize a variable as suggested 2012-06-27 22:32:36 +02:00
Uwe Stöhr
62db3d535d tex2lyx: fix some issues spotted by Vincent 2012-06-27 02:52:09 +02:00
Uwe Stöhr
4ab764c845 BoxUi.ui: revert unintended commit [a6e42e50/lyxgit] 2012-06-26 22:46:06 +02:00