Commit Graph

20588 Commits

Author SHA1 Message Date
Juergen Spitzmueller
2dd84b3417 Remove lyxrc \default_language which has been dropped from the GUI some time ago
The default language of new documents is set via the template
2012-08-07 08:29:46 +02:00
Juergen Spitzmueller
6d2ed04800 Decouple lyxrc-default_language from useLanguagePackage() 2012-08-07 08:00:42 +02:00
Richard Heck
166deba79b Wow, that last commit was dumb. So let's fix #8278 properly. 2012-08-05 17:31:00 -04:00
Richard Heck
2375982f7e Fix bug #8278, as suggested there by Ronen. 2012-08-04 17:33:47 -04:00
Stephan Witt
a9de2597ed Merge branch 'master' of git.lyx.org:lyx 2012-07-30 14:34:12 +02:00
Stephan Witt
430cf3ee5e Fix the wrong cursor move when forward flag is false:
The forward flag is used to place the cursor behind the replaced text if it's true.
But it's not correct to move the cursor if it's false. The cursor is in front of the
replacement already after the replaceSelectionWithString() was done.
2012-07-30 14:32:29 +02:00
Kornel Benko
ea76d6de95 Roundtrip tex2lyx, cmake-build:
1.) test.ltx, test.lyx.tex in build-dir (missed this one in previous commit)
2.) Added dependency to "lyx" to work on clean build dir too
2012-07-30 10:04:45 +02:00
Kornel Benko
6fa12b0971 Adapt tex2lyx roundtrip to cmake build.
Use build tree only.
2012-07-30 09:30:16 +02:00
Stephan Witt
44b3278006 Fix bug #8238: correct the forward argument of replace2string() in on_replacePB_clicked(). 2012-07-27 00:34:17 +02:00
Juergen Spitzmueller
b55a6454d9 Whitespace 2012-07-23 14:59:45 +02:00
Juergen Spitzmueller
0b5c20fc0f Fix direction of brackets in Hebrew when using Polyglossia (bug #8251) 2012-07-23 14:56:00 +02:00
Juergen Spitzmueller
6c1326cdeb Rework language package detection
This puts the diverse use[LangPack] function into one (less error-prone) function and differentiates the custom package from the babel case
2012-07-23 14:34:24 +02:00
Juergen Spitzmueller
508dd27e44 Fix thinko 2012-07-23 11:39:41 +02:00
Juergen Spitzmueller
566a5f2b75 Fixes to the language package call
* Assure that really no language package is called when none is selected.
* Only call global custom package if global is desired.
This is a candidate for branch as well.
2012-07-23 11:36:55 +02:00
Juergen Spitzmueller
a1e2e12ba4 Suppress babel RTL commands when using polyglossia (part of #8251) 2012-07-23 08:40:37 +02:00
Juergen Spitzmueller
f30d6acb04 Compile fix
Richard, please check.
2012-07-22 11:45:39 +02:00
Richard Heck
394e559ffc Add a FIXME about when the appendix should be enabled. 2012-07-21 14:19:10 -04:00
Richard Heck
894569e601 Fix a long-standing FIXME by resetting only the counter for top-level
sectioning when we see an appendix. This fixes bug #8271, whose root
cause was the fact that we were resetting all the counters inside ERT.
2012-07-21 14:19:10 -04:00
Jean-Marc Lasgouttes
6774176aab Implement new LFUN buffer-forall [<BUFFER-TYPE>] <LFUN-COMMAND>
This is a patch from Scott Kostyshak. See the thread here for some
background info:
http://thread.gmane.org/gmane.editors.lyx.devel/142300/focus=142362
2012-07-20 10:50:29 +02:00
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
Uwe Stöhr
a6e42e5079 removed unused includes
these files don't use the debug.h and also don't contain commented out debug code
2012-06-26 22:41:53 +02:00
Vincent van Ravesteijn
dfb8dc91c1 Update the button text of InsetInclude insets
The button text of InsetInclude insets shows whether the child document is
included or excluded from compilation. Changing this for a child document
in the document settings does not get reflected on screen. This patch
updates the button text on the updateBuffer() call.
2012-06-26 20:41:25 +02:00
Uwe Stöhr
2e8ed3b3b5 tex2lyx: support fontspec scale option
Preamble.cpp:
 - support the font scaling
 - improve coding style

text.cpp: - improve logic/coding style

XeTeX-polyglossia.tex:
 - add scaling
 - change document so that it is compilable using the Libertine font
2012-06-26 00:46:02 +02:00
Uwe Stöhr
d3bcdb24cc tex2lyx/text.cpp: fix bug #8223
LyX does not yet support \framebox without an option we therefore cannot use our parse_outer_box routine (this is only for supported boxes)
2012-06-25 22:58:21 +02:00
Vincent van Ravesteijn
8941e980b9 BufferParams: Remove superfluous '\n'
This extra '\n' seems to have been an unintended side-effect of d7eaaba9 (Juergen Spitzmueller, "support for CJK font argument"; Jun 5 2008).
2012-06-25 11:28:38 +02:00
Vincent van Ravesteijn
e20238e21f tex2lyx: Remove superfluous '\n'
Instead of adding the extra '\n' to tex2lyx, we should remove it from
BufferParams.cpp because it was introduced there unintendedly in d7eaaba9
(Juergen Spitzmueller; "support for CJK font argument"; Jun 5 2008).

This partly reverts commit c2810f922665c591a7c32d4c679e58e55132505a.
2012-06-25 11:26:20 +02:00
Jean-Marc Lasgouttes
2a13b02a94 Fix bug #8220: tex2lyx crashes on single-character commands
Fix commit [aa9fed93/lyxgit]: it is never a good idea to call substr(4) on a string without checking its length. Moreover, it is even better in this case to check that the first letters are "text" as the reminder of the code assumes...
2012-06-25 11:04:56 +02:00
Uwe Stöhr
66e3ac003f fix bug #8210
we need to store the document language from the beginning of the document in the context to be able to handle all kinds of language switch commands
2012-06-24 18:24:28 +02:00
Uwe Stöhr
8e7b5eebf0 update tex2lyx todo list
- Japanese is now supported as well as CJK
- also all XeTeX issues are now ironed out
- the support for ArmTeX has been dropped meanwhile
2012-06-24 18:20:19 +02:00
Uwe Stöhr
5ad84b9fbd support non-CJK Japanese for tex2lyx
We cannot know the exact encoding and thus con only assume one (the one that Koji uses for the docs) and output a not at the beginning
2012-06-24 18:10:36 +02:00
Uwe Stöhr
adb0d7f63f support synctex in tex2lyx.cpp
- tex2lyx/Preamble.cpp/h: handle \synctex and package srcltx
- tex2lyx/test/test-structure.tex: add \synctex
2012-06-24 16:59:21 +02:00
Uwe Stöhr
5d79cd531d tex2lyx/Preamble.cpp: fix a typo 2012-06-24 15:37:51 +02:00
Uwe Stöhr
e1b181ddd4 update tex2lyx header format really to fileformat 433
- tex2lyx/Preamble.cpp/h: not all new header definitions since fileformat 413 have yet been added to texl2yx, so do it now; also change some new default values
2012-06-24 15:29:32 +02:00
Juergen Spitzmueller
4c2ae219e1 whitespace 2012-06-24 15:15:31 +02:00
Uwe Stöhr
47f7d44747 fix bug #8215
Font.cpp: CJK parts must not have a closing brace because they are within an environment
2012-06-24 14:42:23 +02:00
Uwe Stöhr
e7d1e5b0c9 tex2lyx comment corrections
tex2lyx/Preamble.cpp, tex2lyx/text.cpp: add info about CJK languages
2012-06-24 14:39:57 +02:00
Juergen Spitzmueller
dac9ec0c13 Merge branch 'master' of git.lyx.org:lyx 2012-06-24 10:57:02 +02:00
Juergen Spitzmueller
5b374e0c29 do not output empty language switch commands (bug #8216) 2012-06-24 10:56:08 +02:00
Uwe Stöhr
a3f4f2d1e3 CJK support for tex2lyx
- support as best as possible; setting a document language is however not possible
- fixes bug #4377
2012-06-24 06:38:33 +02:00
Uwe Stöhr
3943b887a8 tex2lyx/Parser.cpp: fix bug #4468: single '\' are allowed in the special case of '+' as comment argument delimiter 2012-06-23 20:00:49 +02:00
Uwe Stöhr
d37bb54e7b - language: Kurmanji is since 2009 also supported by babel; no fileformat change necessary because Kurmanji is already covered by fileformat 432
- tex2lyx/Preamble.cpp: babel support for Kurmanji and remove comment residues of ArmTeX whose support was removed by fileformat 433
2012-06-23 18:56:10 +02:00
Uwe Stöhr
7a103ba6d7 tex2lyx/Preamble.cpp: remove a FIXME, the problem was only in trunk (bug #8211) and is now fixed 2012-06-23 16:57:22 +02:00
Juergen Spitzmueller
ca16190006 fix bug #8208: missing \end for polyglossia-only languages at buffer end 2012-06-23 15:44:25 +02:00
Juergen Spitzmueller
20d7e088fa less opaque bool naming and consistent use 2012-06-23 15:41:05 +02:00
Juergen Spitzmueller
f42c9e50df fix bug #8211: \setotherlanguage not set for non-babel languages 2012-06-23 13:50:40 +02:00
Uwe Stöhr
89b8f380cc tex2lyx/text.cpp: 2 typos 2012-06-23 05:20:39 +02:00
Uwe Stöhr
e31981a414 Merge branch 'master' of git.lyx.org:lyx 2012-06-23 04:29:16 +02:00
Uwe Stöhr
828f7171e8 - tex2lyx: support for the polyglossia language variants
- XeTeX-polyglossia.tex: simplifications, added some more testcases
2012-06-23 04:28:52 +02:00
Pavel Sanda
369e697352 Add hint for backward search (cf #8054) 2012-06-23 04:12:08 +02:00
Uwe Stöhr
f1f63fcad0 tex2lyx/text.cpp: whitespace fix 2012-06-23 00:53:35 +02:00
Uwe Stöhr
73f0f4dd6c - Preamble.cpp: handle \setxxxlanguage with options
- text.cpp: handle the commands \textxxx with options
- XeTeX-polyglossia.tex: add 2 more testcases
2012-06-22 17:19:46 +02:00