Commit Graph

357 Commits

Author SHA1 Message Date
Scott Kostyshak
c949268da7 Improve a layout LYXERR0 message
The name of the layout is now included in an error message about
layouts. This will help with finding the root issue of several
documents we have.
2016-08-08 23:44:27 -04:00
Guillaume Munch
670efa8f64 Rationalise includes
Modifying TexRow.h or texstream.h no longer triggers the recompilation of the
complete source tree.
2016-07-04 02:42:17 +02:00
Stephan Witt
7e72c1d0d3 Call lyx::next and lyx::prev explicitely. In case libc++ provides
std::next even when not in C++11 mode this is necessary. E.g. with
clang from Xcode7 on Mac OS X.
2016-01-10 18:06:15 +01:00
Günter Milde
0eb9477be7 Fix 480937a103708a651/lyxgit, second attempt.
Prevent encoding changes whenever the TeX engine is XeTeX or LuaTeX,
as XeTeX/LuaTeX use only one encoding per document:

* with useNonTeXFonts: "utf8plain",
* with XeTeX and TeX fonts: "ascii" (inputenc fails),
* with LuaTeX and TeX fonts: only one encoding accepted by luainputenc.

+1 no needless encoding switches
+1 runparams.encoding matches the correct encoding at any time
+1 less complicated code.

-1 there may still be problems with CJK (possibly impossible to
   solve for Xe/LuaTeX with TeX fonts).

For LuaTeX & TeX fonts, the complete document uses the encoding
of the global document language.

See also #9740.
2015-11-12 16:55:04 +01:00
Günter Milde
9894e0be23 Fix 480937a103708a651/lyxgit. See also #9740.
Actually, the changed tests were used to prevent overwriting the encoding
changed in Buffer::writeLaTeX with a language-default encoding.
This is still required for XeTeX with TeX-fonts unless a proper solution is found.

Documents with more than one encoding and TeX-fonts fail with LuaTeX,
as "luainputenc" can only handle one encoding.
2015-11-11 00:11:06 +01:00
Günter Milde
480937a103 Reset encoding after insets and environments also for LuaTeX with TeX fonts.
With inputenc == "auto" or "default", the encoding changes with
the language and must be reset after an eventual language switch in insets
or environments (see #6216).

However, whether we need to do this does not depend on 8-bit TeX vs. LuaTeX
but on the possible use of more than one encoding for the document.
With "nonTeXFonts", the encoding is utf8,
LuaTeX with TeX fonts requires encoding handling similar to 8-bit TeX.

(Additionally, the value of "params.inputenc" could be tested: if it is
not "auto" or "default", we have just one common encoding and could skip
the reset as well.) Not sure how much time this saves, though.
2015-11-09 12:42:48 +01:00
Georg Baum
1eaa2366bf Make language nesting code more readable
This is a tiny simplification that makes understanding the code more easy and
will help in fixing the remaining regressions. The logic remains the same, no
export test result is changed.
2015-10-27 22:36:52 +01:00
Günter Milde
1523fc6023 Partial fix for #9740 "XeTeX/LuaTeX with TeX fonts problems".
Fixes output for 3 of the 4 test lyx-files.

Includes "FIXME"s at places where further action is required to get the XeTeX
export right but I don't know how.
2015-10-20 19:16:25 +02:00
Georg Baum
be3e470068 Fix language nesting regression
b1c68dccf8 and 46aed6d2b9 fixed some language nesting issues, but introduced
a regression for the case that there is a standard paragraph in a foreign
language, followed by a list (e.g. itemize) in the same language, followed
by the end of the document, as e.g. in lib/doc/de/Additional.lyx. The reason
for this was that not all language ending commands did reset
state->open_polyglossia_lang_ correctly.
I am sure that one can still construct broken corner cases, and I am also sure
that this was already possible before b1c68dccf8 and 46aed6d2b9. However,
this fix seems to fix the most important issues, and to get nesting completely
correct we would probably need some stack-like structure, for languages and
encodings, also for the CJK part (which is not touched at all by this commit).
2015-10-19 21:08:01 +02:00
Georg Baum
86325e50d0 Fix language end command
The code that sets open_polyglossia_lang_ is not only executed for polyglossia,
but also for babel, so we have to use the correct language end command.
2015-10-18 20:57:21 +02:00
Guillaume Munch
afed7d06fa Improvements to cursor highlighting in the source panel
* TexRow now computes rows from a DocIterator. In practice, the cursor
  highlighting is now correct inside insets, it is no longer restricted to the
  topmost level. It certainly also makes forward-search more precise.

* Added the option to disable a texrow when not needed, for perf.

* Fixed a bug where the last paragraph was not properly highlighted.

Limitations:

* TexRow still does not handle: math (e.g. multi-cell), sub-captions, inset
  arguments.
2015-10-01 21:51:08 +01:00
Georg Baum
b24664b0ac Remove unused variables found by cppcheck
There are still a few warnings of the kind
(style) Variable 'x' is assigned a value that is never used.
since I did not touch code where I was not sure whether there might be a real
bug, and I kept some for symmetry reasons as well.
2015-09-20 21:39:59 +02:00
Juergen Spitzmueller
46aed6d2b9 Refine lang nesting fix 2015-06-19 19:03:11 +02:00
Juergen Spitzmueller
b1c68dccf8 Fix language nesting problem with polyglossia
Part (?) of #9633
2015-06-19 09:25:11 +02:00
Juergen Spitzmueller
4feec2ef4b Properly fix bug #9598
Do not output \\par at the end of environments with size change if the
environment cosinsts of only one par.
2015-06-09 08:18:19 +02:00
Juergen Spitzmueller
8e671a5cdc Revert "No \\par after greyedout notes (bug #9598)"
This reverts commit f929f21228.

It is not as easy as this. See ticket.
2015-06-09 07:57:19 +02:00
Juergen Spitzmueller
f929f21228 No \\par after greyedout notes (bug #9598) 2015-06-09 07:44:03 +02:00
Georg Baum
b596330093 Fix compilation with boost 1.58
Newer boost versions use complicated type traits for boost::next and
boost::prior, which do not work with the RandomAccessList iterators.
The long term solution is to use std::next and std::prev, for now supply
simple replacements for compilers that do not support C++11 yet.
2015-05-16 00:05:23 +02:00
Juergen Spitzmueller
b9573096f7 Factor out polyglossia language begin command construction and apply forcelocalfontswitch to polyglossia as well. 2015-05-03 16:08:14 +02:00
Juergen Spitzmueller
efb4a26512 Make ParBreakIsNewline work in inset layout without PassThru
Fixes: #9513
2015-04-21 19:43:41 +02:00
Juergen Spitzmueller
8c1a484cd2 Use local babel language switch in fixed width cells in order to prevent unwanted whitespace
Fixes: #9455
2015-04-04 11:59:01 +02:00
Juergen Spitzmueller
d9b87d651a 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-01 09:14:26 +02:00
Juergen Spitzmueller
9c05f221f9 Revert "Fix bug with wrong baseline calculation in last paragraph"
This reverts commit b555f31a34.
2014-08-28 08:38:27 +02:00
Richard Heck
b9fe1dd10b Use a const ref here. Guess it was a thinko when I did it. 2014-08-12 12:32:58 -04:00
Juergen Spitzmueller
b555f31a34 Fix bug with wrong baseline calculation in last paragraph
Fixes: #9231
2014-08-03 11:26:16 +02:00
Georg Baum
5a8b8ba8e1 Make LaTeX export threadsafe.
This is one of the more important threadsafety issues because of export in
thread and simultanous view source. The solution is ugly, but a better one
(see FIXME) would require major rework. These static variables should not
have been used in the first place IMHO.
2014-07-05 14:23:43 +02:00
Enrico Forestieri
c85dbfea98 Fix indentation of paragraphs after an environment.
When deciding whether a paragraph should be indented or not, LyX
only takes into account default layouts. This is wrong, because
an environment could be nested into another one and thus a following
paragraph would not be "default". With this patch all paragraphs
after an environment are correctly indented, independently of
whether their layouts are "default" or not.
The latex output (which was modeled following the previous wrong
assumption) is also correspondingly adapted.
2014-05-28 01:07:47 +02:00
Enrico Forestieri
27e0bf54f5 Add a required paragraph break.
This is necessary, for example, if a standard paragraph is nested
in an environment and the environment does not end immediately after.
To be strictly correct, the layout of the following paragraph should
be compared to the layout of the nesting environment, otherwise, if
they are not the same, an empty line is nevertheless output. However,
this is harmless because an "\end{layout}" tag immediately follows.
2014-05-21 21:08:11 +02:00
Juergen Spitzmueller
58db7c34f9 Output arguments required by arguments with default or preset arg
Fixes: #9128
2014-05-21 13:12:14 +02:00
Enrico Forestieri
8d8d8e9df6 Small reorganization.
I am not sure I fully understand the pending_newline/unskip_newline
logic (which seems mainly related to rtl writing), so I prefer to
leave it alone, in the sense that now things go again as in 2.1
until the point where those booleans are used for producing output.
If it turns out that a spurious (and unwanted) empty line comes
from the previous code, it can be easily corrected later.

I am also reintroducing the check about a separator inset at the end
of the paragraph, because that is necessary for the plain version.
2014-05-21 00:59:36 +02:00
Enrico Forestieri
7145863466 Generalize control on double blank lines.
We can now tell whether a blank line was just output and so can
avoid outputting another one.
2014-05-20 21:52:29 +02:00
Juergen Spitzmueller
8226453684 Fix crash due to invalid pos 2014-05-20 11:14:13 +02:00
Enrico Forestieri
936773c4f7 Adapt output to the on-screen representation.
LyX assumes that a standard paragraph following an aligned one or
a layout with NextNoIndent==false has to be indented on screen.
This means that in the latex output a blank line has to follow.
In this case there should be no problem as regards extra vertical
space and it simpler and more elegant to simply uncheck "Indent
Paragraph" in the Paragraph settings pane rather than changing
the current logic and allowing to insert a parbreak separator.
2014-05-16 15:39:33 +02:00
Enrico Forestieri
7d5b1fb840 Output a parbreak after a command.
This is what LyX was previously doing. It has no effect on vertical
spacing but, for example, sectioning commands stand out on the output.
The parbreak is not output if an environment follows or the alignment
of the current or next paragraph is changed.
Also remove some superfluous code.
2014-05-14 22:25:15 +02:00
Enrico Forestieri
c668ebf611 Fix bugs #8546 and #9055, and introduce new separator inset.
The algorithm used for breaking a paragraph in LaTeX export is changed
for avoiding spurious blank lines causing too much vertical space.
This change is tied to the introduction of a new inset (with two
different specializations) helping in either outputing LaTeX paragraph
breaks or separating environments in LyX. Both of the above goals were
previously achieved by the ---Separator--- layout and can now be
accomplished by the new inset in a more natural way. As an example,
after leaving an environment by hitting the Return key for two times,
a third return automatically inserts a parbreak inset, which is
equivalent to the old separator layout, i.e., it also introduces a
blank line in the output. If this blank line is not wanted, the
parbreak separator can be changed to a plain separator by a right
click of the mouse. Of course, an environment can still be separated
by the following one by using the Alt+P+Return shortcut (or the
corresponding menu key), but now the plain separator inset is used
instead of the old separator layout, such that no blank line occurs in
the LaTeX output.

Old documents are converted such that the LaTeX output remains unchanged.
As a result of this conversion, the old separator layout is replaced by
the new parbreak inset, which may also appear in places where the old
algorithm was introducing blank lines while the new one is not.
Note that not all blank lines were actually affecting the LaTeX output,
because a blank line is simply ignored by the TeX engine when it occurs
in the so called "vertical mode" (e.g., after an alignment environment).
The old ---Separator--- layout is now gone and old layout files using it
are also automatically converted.

Round trip conversions between old and new format should leave a document
unchanged. This means that the new behavior about paragraph breaking is
not "carried back" to the old format. Indeed, this would need introducing
special LaTeX commands in ERT that would accumulate in roundtrip
conversions, horribly cluttering the document. So, when converting a
modified document to old formats, the LaTeX output may slightly differ in
vertical spacing if the document is processed by an old version of LyX.
In other words, forward compatibility is guaranteed, but not backwards.
2014-05-10 23:25:11 +02:00
Richard Heck
fdbe775b9f This is the result of an audit of all static variables, looking
for possible thread conflicts, of the sort Georg resolved at
6a30211f. I have made static variables const where possible,
and marked cases that looked potentially problematic with the
comment:
	// FIXME THREAD
Many of these definitely are vulnerable to concurrent access, such
as the static variables declared at the start of output_latex.cpp.
Suppose, e.g., we were outputting latex and also displaying the
source of a different document.

I'd appreciate it if others could grep for "FIXME THREAD" and see
if some of these are harmless, or what.
2014-04-21 11:51:57 -04:00
Juergen Spitzmueller
7c1fc6ea75 Include child's own authors when using BufferParams from master. 2014-03-13 06:43:38 +01:00
Juergen Spitzmueller
50bcd6ed7b Use the master buffer's param when compiling as a child (#8893) 2013-11-18 08:46:50 +01:00
Juergen Spitzmueller
a8a2bd463c Force encoding switch when switching from/to CJK, even if we use a customized encoding (#8558) 2013-05-20 13:40:40 +02:00
Juergen Spitzmueller
a78bed06eb revert parts of 53002538 which set wrong local_font 2013-05-20 12:31:46 +02:00
Richard Heck
1b1f8dd235 Audit all the LASSERT calls, and try to do something sensible at
each failure.

There are several places I was not sure what to do. These are marked
by comments beginning "LASSERT:" so they can be found easily. At the
moment, they are at:

Author.cpp:105: // LASSERT: What should we do here?
Author.cpp:121: // LASSERT: What should we do here?
Buffer.cpp:4525:        // LASSERT: Is it safe to continue here, or should we just return?
Cursor.cpp:345:         // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:403:         // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:1143:                // LASSERT: There have been several bugs around this code, that seem
CursorSlice.cpp:83:     // LASSERT: This should only ever be called from an InsetMath.
CursorSlice.cpp:92:     // LASSERT: This should only ever be called from an InsetMath.
LayoutFile.cpp:303:                     // LASSERT: Why would this fail?
Text.cpp:995:           // LASSERT: Is it safe to continue here?
2013-04-25 17:27:10 -04:00
Juergen Spitzmueller
41060c9723 Allow to specify default argument for layout/inset argments
This default argument is inserted iff no inset argument is present. This is useful particularly for mandatory arguments that need to have a sensible default value.
2013-02-24 11:29:21 +01:00
Jean-Marc Lasgouttes
dc5d63ae24 Fix bug #8049: extra empty line at the end of verbatim environment 2013-01-25 12:18:40 +01:00
Georg Baum
de5e348727 Fix bug #8468: Wrong import of UTF8 CJK.
Actually, the test case showed several problems:
- ERT insets did use layout "Standard", not "Plain Layout"
- The font scale was read correctly, but tex2lyx claimed that it did ignore
  the option "scaled=0.95"
- If a third argument of the CJK environment was given, it caused the whole
  environment to be put in ERT with a broken encoding. This is now fixed for
  the bug test case by using the \font_cjk header variable, but the encoding
  problem still exists for unsupported encodings. I'll file a separate bug
  for that.
- The CJKutf8 package was not handled in the preamble parsing. Therefore the
  chinese comment in the preamble was read with a wrong encoding, and guessing
  the document language did not work.
The new file CJKutf8.tex was created by copying and modifying CJK.tex, but
unfortunately it is impossible to tell git to inherit the history of CJK.tex
for the new file (search the web for git svn copy if you want to know details).
2012-12-30 20:52:49 +01:00
Juergen Spitzmueller
37f41fd4b5 Support for command argument placement after the workarea argument 2012-12-28 11:21:24 +01:00
Juergen Spitzmueller
7af6a7b910 fix latexArgInsets for sequences qith nested paragraphs 2012-12-24 13:02:24 +01:00
Juergen Spitzmueller
3934f4a36f In multi-par sequences, check for arguments in all pars 2012-12-23 17:37:50 +01:00
Juergen Spitzmueller
c3aa718151 Make the \item command in lists customizable 2012-12-19 16:55:22 +01:00
Juergen Spitzmueller
e93f4d470d Possibility to specify a preset argument
This will be needed for beamer plain and fragile frame support.
2012-12-10 14:09:51 +01:00
Juergen Spitzmueller
1500e44cba Support for \item arguments 2012-11-29 15:34:20 +01:00
Juergen Spitzmueller
a7f8fb8c5f Provide option to force a local language switch where a global is not allowed (fixes #8033) 2012-11-28 20:55:21 +01:00
Juergen Spitzmueller
53002538fa Pass local font to arguments and assure pass_thru is inherited 2012-11-28 19:02:07 +01:00
Juergen Spitzmueller
4d1b495139 LaTeXParam and Argument do not necessarily exclude each other 2012-11-26 13:09:54 +01:00
Richard Heck
1252c22fd3 Some minor cleanup of new InsetArguments stuff that I did while
reading the patch....
2012-11-23 20:40:38 -05:00
Juergen Spitzmueller
2e69c66195 InsetArgument revision, first working version 2012-11-19 14:21:02 +01:00
Lars Gullik Bjønnes
6b2232a29c src/*.cpp: reformatting to increase consistency 2012-10-28 17:42:07 +01:00
Juergen Spitzmueller
5b374e0c29 do not output empty language switch commands (bug #8216) 2012-06-24 10:56:08 +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
Jean-Marc Lasgouttes
a756403301 "Performance" fixes suggested by cppcheck
While cppcheck did not turn out any suspicious error messages, using
the "performance" flag highlighted several nitpicks in three categories
 * do not use it++ for iterators, ++it is better
 * do not use size() to test for emptyness, empty() is here
 * do not use "const T" as a function parameter, "const & T" is better

I doubt that any of these is a real performance problem, but the code is cleaner anyway.
2012-05-28 22:42:44 +02:00
Georg Baum
8e8c214bef Fix some bugs related to spaces in math:
- Interpret argument of LFUN_SPACE_INSERT correctly
- Use InsetMathSpace instead of InsetMathSpecialChar for "\ " (bug # 7728)
- Use InsetMathSpace instead of InsetMathChar for ~ (bug # 7728).
  This fixes also the display in LyX (previously a literal ~ was displayed).
Using InsetMathSpace enables also the "Insert Formatting" menu entries.
No file format change is needed, since the LaTeX export is unchanged.
Note that there are still some bugs related to spaces in math:
#7746, #7747, #7749, #7842


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39947 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-23 20:19:49 +00:00
Jürgen Spitzmüller
5118d369e1 finally commit the fix for #7607.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39696 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-17 15:25:14 +00:00
Richard Heck
f76d28c118 Just a bit of cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38933 a592a061-630c-0410-9148-cb99ea01b6c8
2011-06-02 19:55:08 +00:00
Richard Heck
7305ddb6bf Fix some typos.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38932 a592a061-630c-0410-9148-cb99ea01b6c8
2011-06-02 19:39:44 +00:00
Enrico Forestieri
d866717ef7 Integrate texrow with otexstream in order to perform automatic line
counting when exporting to latex. This is done for the code comprised
between \begin{document} and \end{document}, while the preamble code
still needs manual calls to TexRow::newline() for registering new lines.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37584 a592a061-630c-0410-9148-cb99ea01b6c8
2011-02-10 20:02:48 +00:00
Enrico Forestieri
1ef605f625 Introduce a wrapper class for odocstream to help ensuring that no
blank lines may be inadvertently output. This is achieved by using two
special iomanip-like variables (breakln and safebreakln) in the lyx::
namespace. When they are inserted in the stream, a newline is output
only if not already at the beginning of a line. The difference between
breakln and safebreakln is that, if needed, the former outputs '\n'
and the latter "%\n".
In future, the new class will also be used for counting the number of
newlines issued. Even if the infractrure for doing that is already in
place, the counting is essentially still done the old way.
There are still places in the code where the functionality of the
class could be used, most probably. ATM, it is used for InsetTabular,
InsetListings, InsetFloat, and InsetText.
The Comment and GreyedOut insets required a special treatment and a
new InsetLayout parameter (Display) has been introduced. The default
for Display is "true", meaning that the corresponding latex
environment is of "display" type, i.e., it stands on its own, whereas
"false" means that the contents appear inline with the text. The
latter is the case for both Comment and GreyedOut insets.
Mostly, the only visible effects on latex exports should be the
disappearing of some redundant % chars and the appearing/disappearing
of null {} latex groups after a comment or lyxgreyedout environments
(they are related to the presence or absence of a space immediately
after those environments), as well as the fact that math environments
are now started on their own lines.
As a last thing, only the latex code between \begin{document} and
\end{document} goes through the new class, the preamble being directly
output through odocstream, as usual.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37360 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-29 02:41:13 +00:00
Jean-Marc Lasgouttes
3b316bc83f better fix to #7239. Actually the whole switch and kaboodle (see r37229) is needed (otherwise sweave is broken)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37322 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-25 11:22:47 +00:00
Richard Heck
4f4a8203b3 Fix bug #7239, or at least try to do so. We need to output the command
here.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37229 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-16 19:14:14 +00:00
Vincent van Ravesteijn
8c61911270 Revert r37092. The fix was wrong.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37127 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-06 13:41:50 +00:00
Vincent van Ravesteijn
a7c135b9e1 Fix bug #7096: Wrong LaTeX export for layouts with intitle=true in branches.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37092 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-03 21:23:38 +00:00
Richard Heck
e328ed52c2 Squash warnings. The latter might matter.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36953 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-20 00:57:16 +00:00
Abdelrazak Younes
2ab1601311 Coding style/de-indent
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36939 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-18 16:32:29 +00:00
Abdelrazak Younes
41aa051d22 Coding style.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36938 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-18 16:19:05 +00:00
Abdelrazak Younes
3626b46109 Coding style.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36937 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-18 16:11:38 +00:00
Abdelrazak Younes
1614a64e15 TeXOnePar() simplification: use pit_type instead of iterator
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36936 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-18 15:57:27 +00:00
Abdelrazak Younes
fd73107054 TeXOnePar() Be on the safe side and reinitialize runparam.par_begin and par_end
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36935 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-18 14:04:02 +00:00
Abdelrazak Younes
8e092e6ca6 greatly simplify and comment TeXEnvironment():
* only one for loop
* uses runparams.par_end

InsetInclude and InsetIext: initialize runparams.par_begin and runparams.par_end

Except for a few additonal empty lines the LateX exports are identical for all help files. The reason for the additional empty lines is the more consistent TeXEnvironment() call.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36934 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-18 13:49:39 +00:00
Abdelrazak Younes
ffea94c5e6 latexParagraphs(): code polish.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36933 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-18 08:31:34 +00:00
Abdelrazak Younes
f48f0ad0bf latexParagraphs(): cleanup a bit and switch to a 'for' loop. Hopefully this should fix the performance problem when exporting very big document to latex.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36932 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-18 08:23:14 +00:00
Abdelrazak Younes
ca91d508b2 LaTeX export small speedup: Introduce RandomAccessList::position() and use it.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36931 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-18 07:37:12 +00:00
Abdelrazak Younes
b730b1c8f8 Cleanup: TeXEnvironment doesn't need data.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36897 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-15 23:46:02 +00:00
Abdelrazak Younes
67e782190a Split TeXEnvironment() in three functions. The real optimisation is yet to come.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36896 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-15 23:39:38 +00:00
Abdelrazak Younes
1ff5754a1b get rid of TeXDeeper: this was hiding the recursiveness of TeXEnvironment without any real benefits. This will allow further simplification of the code.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36895 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-15 21:48:00 +00:00
Abdelrazak Younes
811335b50c a microptimisation and a FIXME.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36894 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-15 21:11:12 +00:00
Abdelrazak Younes
fbcbeb5130 latex export optimisation step 1: There is no need for TeXOnePar to return a par iterator and to depend on that.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36893 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-15 20:51:25 +00:00
Jürgen Spitzmüller
1e8bd43a70 * output_latex.cpp: fix language nesting (with polyglossia).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36775 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-08 18:25:21 +00:00
Richard Heck
fc3b06eac8 Rename a bunch of BufferParams to conform to our usual style.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36524 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-26 18:32:29 +00:00
Jürgen Spitzmüller
fc9c1494ce further xetex disambiguation: use the flavor where the flavor is apt.
This introduces an isFullUnicode() function to OutputParams that currently only contains XETEX, but later can also contain other fully unicode-aware backends (LUATEX for instance).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36445 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-23 12:23:36 +00:00
Jürgen Spitzmüller
7cbeed2e40 * Introduce polyglossia support (bug 6576).
Please test this.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36433 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-22 12:10:16 +00:00
Jean-Marc Lasgouttes
b9b619641b This patch implements proper ERT behaviour for normal layouts.
In particular, it makes paragraph breaks generate single \n in latex output
when ParbreakIsNewline is true

This means that it is not necessary anymore to use newlines to break lines. 
Plain paragraph breaks can be used instead, like is done now in ERT/Listings. 
This is mainly aimed at sweave support.

lyx2lyx support courtesy of Richard Heck



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36163 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-06 15:06:19 +00:00
Vincent van Ravesteijn
222b3580d2 More include frenzy.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35940 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-31 01:04:03 +00:00
Jean-Marc Lasgouttes
fde0a4bb26 spacing
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35093 a592a061-630c-0410-9148-cb99ea01b6c8
2010-08-08 14:48:15 +00:00
Jean-Marc Lasgouttes
1a18cdfb39 Clean-up the code with respect to PassThru insets and layouts.
The goal is first to remove explicit testing against ERT_CODE, 
and second to allow to define layouts with the same properties as ERT insets.

This commit does not change behaviour 
* rename OutputParams::verbatim to pass_thru
* disable encoding switch inside pass_thru layouts



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35091 a592a061-630c-0410-9148-cb99ea01b6c8
2010-08-07 22:07:49 +00:00
Richard Heck
84a4ec80ab Paragraph::latex() always returned false. So remove the return value.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34676 a592a061-630c-0410-9148-cb99ea01b6c8
2010-06-15 15:49:24 +00:00
Richard Heck
c952f9a7be Fix InPreamble. I must have committed an incomplete patch.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34675 a592a061-630c-0410-9148-cb99ea01b6c8
2010-06-15 15:37:39 +00:00
Richard Heck
8480d1dd9a Rename InsetOptArg as InsetArgument.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34596 a592a061-630c-0410-9148-cb99ea01b6c8
2010-06-04 22:44:58 +00:00
Richard Heck
b0097bcddb Introduce a new "RequiredArgs" tag for layouts. This functions much as
the OptionalArgs tag does and is implemented by the now misnamed
InsetOptArgs, except that its content gets wrapped in "{}" rather than
"[]". Required arguments do not actually have to be provided, but they
are always output. 

This will allow e.g. beamer's Block environment to be implemented
without ERT.

Documentation to follow.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34591 a592a061-630c-0410-9148-cb99ea01b6c8
2010-06-04 21:50:08 +00:00
Enrico Forestieri
f84a611775 Fix #6618: RTL (sub)*section after LTR text doesn't compile.
When deciding whether to switch encoding or not, the "fragileness" of
the enclosing environment (rather than that of the actual one) should
be taken into account, as we already account for the current "fragility"
by outputting the encoding switch just before switching environment.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33882 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-27 17:29:56 +00:00
Jürgen Spitzmüller
ce349ad806 Fix encoding issues in bibitems (bug #6534)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33452 a592a061-630c-0410-9148-cb99ea01b6c8
2010-02-12 16:08:30 +00:00
Enrico Forestieri
e4cff09722 Fix bug #6510: URL in the footnote will cause the `CJK' environment to terminate
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33382 a592a061-630c-0410-9148-cb99ea01b6c8
2010-02-09 14:01:21 +00:00
Jürgen Spitzmüller
425d092204 * fix spelling in comments to please John.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33262 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-29 14:44:21 +00:00
Vincent van Ravesteijn
c22298c97b Fix bug #6387: Incorrect selectlanguage command at end of document.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32792 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-06 17:36:22 +00:00
Enrico Forestieri
128e349191 Restore the master language at the end of an included child document
instead of the child document language.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31665 a592a061-630c-0410-9148-cb99ea01b6c8
2009-10-18 21:48:13 +00:00
Enrico Forestieri
2245f82f96 Properly reset the stream encoding after an environment. Fixes bug #6216.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31392 a592a061-630c-0410-9148-cb99ea01b6c8
2009-09-16 20:50:40 +00:00
Abdelrazak Younes
8c053ea10c Move depthHook(), outerHook(), isFirstInSequence(), outerFont() to Text methods.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30957 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-09 18:35:39 +00:00
Abdelrazak Younes
2b9e44cb01 Move contents of paragraph_funcs.* to Text.h and Text.cpp.
The goal is to simplify the code afterwards.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30955 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-09 17:30:41 +00:00
Abdelrazak Younes
730a67e0d1 Text::Inset(): now returns a reference in order to make clear that the owner is mandatory.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30947 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-09 16:19:43 +00:00
Abdelrazak Younes
1919580310 Get rid of Paragraph::forcePlainLayout().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30942 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-09 15:38:55 +00:00
Abdelrazak Younes
5425c53fd1 Now that Text knows its owner, use the associated Buffer access.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30941 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-09 15:29:34 +00:00
Enrico Forestieri
898c621b84 Properly restore the file encoding after a LaTeX environment with local scope.
Fixes bug #5690: Hebrew file cannot be exported to dvi or pdf.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30848 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-03 18:31:20 +00:00
Enrico Forestieri
3e9489d870 Avoid deferencing a null pointer.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30805 a592a061-630c-0410-9148-cb99ea01b6c8
2009-07-30 03:21:04 +00:00
Enrico Forestieri
56ba7b60b1 Simpler fix for bug #5096: Language switch fails in environments.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30803 a592a061-630c-0410-9148-cb99ea01b6c8
2009-07-30 00:58:37 +00:00
Enrico Forestieri
a2b706037b Revert r30800, r30768, r30767, 30766, and r30627. Soon to be replaced
with a simpler (and thus better) fix.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30802 a592a061-630c-0410-9148-cb99ea01b6c8
2009-07-30 00:37:53 +00:00
Enrico Forestieri
e96dbacfee Refine fix for bug #5096: Language switch fails in environments.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30800 a592a061-630c-0410-9148-cb99ea01b6c8
2009-07-28 16:15:34 +00:00
Enrico Forestieri
63f72c39be This should have gone in r30766.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30768 a592a061-630c-0410-9148-cb99ea01b6c8
2009-07-25 01:09:31 +00:00
Enrico Forestieri
1344b11e45 Move bracket to the right place, as also suggested by the indentation...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30767 a592a061-630c-0410-9148-cb99ea01b6c8
2009-07-25 00:45:52 +00:00
Enrico Forestieri
49d4119736 Smash another case of missing language switch and also avoid redundant switches.
Essentially, non-default aligned paragraphs should be treated as nested ones.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30766 a592a061-630c-0410-9148-cb99ea01b6c8
2009-07-24 22:50:32 +00:00
Enrico Forestieri
e10dc486b1 Fix bug #5096: Language switch fails in environments.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30627 a592a061-630c-0410-9148-cb99ea01b6c8
2009-07-16 12:50:44 +00:00
Jürgen Spitzmüller
322eb96219 * Allow manual setting of bibliography indendation
that overrides bibitemWidest (bug 5960).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29840 a592a061-630c-0410-9148-cb99ea01b6c8
2009-05-25 08:13:56 +00:00
Jürgen Spitzmüller
737e9b2c20 start XeTeX support.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29119 a592a061-630c-0410-9148-cb99ea01b6c8
2009-04-06 06:58:30 +00:00
Jürgen Spitzmüller
d4f11c17e9 * Fix encoding problem following a Listing (bug 5783).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28830 a592a061-630c-0410-9148-cb99ea01b6c8
2009-03-17 09:25:52 +00:00
Richard Heck
2ebd679192 Cosmetics.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28450 a592a061-630c-0410-9148-cb99ea01b6c8
2009-02-11 17:16:05 +00:00
Georg Baum
030e249d91 fix potential problems detected by gcc
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27956 a592a061-630c-0410-9148-cb99ea01b6c8
2008-12-22 18:18:47 +00:00
Jürgen Spitzmüller
17e11a930d * output_latex:cpp:
- fix some CJK nesting issues.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27665 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-22 16:40:39 +00:00
Abdelrazak Younes
4209cbc631 Tommaso patch, part 5, lots of thing to cleanup still but I'll do that afterwards.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27521 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-16 00:12:21 +00:00
André Pönitz
f1cba8ff64 more latin1..utf8 schanges. all of src/* should be utf8 now
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27425 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-14 15:58:50 +00:00
Jürgen Spitzmüller
043c362dab * output_latex.cpp:
- slightly change FIXME comment. This only applies to the newly added condition.
	  The other conditions should be left untouched, even if we find a way to access the TeXRow.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27237 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-03 13:43:33 +00:00
Richard Heck
ff9d8584f9 Fix bug 5436, at least for the time being.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27236 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-03 13:07:30 +00:00
Richard Heck
fe25e93e92 Whoops.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27222 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-01 14:45:39 +00:00
Richard Heck
87dbdca653 Add some constness and remove some useless code.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27220 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-31 23:32:52 +00:00
Richard Heck
3f4cab9808 Whitespace.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27218 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-31 16:41:52 +00:00
Richard Heck
bd9cdad48f Clarify comment.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27217 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-31 15:37:34 +00:00
Richard Heck
ae9ef7c30f If we're doing this test elsewhere, we should also do it here.
(All of these commits, by the way, are just stuff I'm stumbling
across while trying to deal with the newline bug.)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27216 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-31 15:36:08 +00:00
Richard Heck
ce379265a6 Some FIXMEs for later, and a little constness.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27215 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-31 15:33:48 +00:00
Uwe Stöhr
e47d4dee70 output_latex.cpp: revert last commit as it is too risky so short before the release
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27206 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-31 01:26:11 +00:00
Uwe Stöhr
1a4e481111 output_latex.cpp: fix regression, reported here: http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg145738.html
I tested it carefully but in case this makes problems, please revert this immediately.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27205 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-30 23:19:21 +00:00
Jürgen Spitzmüller
9c432a9935 * output_latex.cpp:
- fix CJK nesting in child documents (bug 5358).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27014 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-21 17:03:49 +00:00
Jean-Marc Lasgouttes
03ec50ac4d speed up _a_lot_ switchEncoding() by avoiding an object copy
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26896 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-14 13:06:47 +00:00
Pavel Sanda
792ece8130 Fix whitespaces so the diff between branches is not so huge.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26881 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-13 11:25:37 +00:00
Enrico Forestieri
5ca3be4d67 In mathmode, treat nonascii chars with diacritical marks as an input method
for entering math accents, such that an umlauted A is translated as \ddot{A},
for example.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26577 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-26 15:53:15 +00:00
Enrico Forestieri
b5dcdbc960 When in mathmode, always use the mathcommand replacement from the
unicodesymbols file. Also take into account that a unicode symbol
may appear in both mathmode and textmode and thus both the mathmode
and textmode features may be required. As a side effect, the problem
that the \lyxmathsym definition is added to the preamble even when
a unicode symbol appears only in textmode is solved.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26548 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-25 18:38:25 +00:00
Jürgen Spitzmüller
81d02909cf Fix bug 448:
* src/OutputParams.{cpp,h}:
	- new param isLastPar, indicating if the current paragraph is the last in a given inset/buffer
* src/output_latex.cpp:
	- set isLastPar
* src/Paragraph.cpp:
	- noTrivlistCentering also in tabular cells
	- in the last par, use alignment switch instead of environment

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26443 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-18 14:51:16 +00:00
Jürgen Spitzmüller
9bfc1c9d46 final final touch.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26208 a592a061-630c-0410-9148-cb99ea01b6c8
2008-08-19 07:51:40 +00:00
Jürgen Spitzmüller
a2906cb877 ** proper implementation of pLaTeX by Tetsuya Makimura and me, fixes many remaining problems and bugs with language "japanese" (bugs 4863, 4290, 4700 and partially 4697) **
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26200 a592a061-630c-0410-9148-cb99ea01b6c8
2008-08-18 17:26:09 +00:00
Richard Heck
cca78e3c8a Change the "empty layout" to the "plain layout", to try to avoid confusion.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26025 a592a061-630c-0410-9148-cb99ea01b6c8
2008-08-01 20:57:27 +00:00
Jürgen Spitzmüller
af9305f4ac *** sanitize listing's encoding handling ***
* src/Encoding.h:
	- new member hasFixedWidth()
* src/output_latex.{cpp,h} (switchEncoding):
	- add option to force encoding switch
* src/insets/InsetListing.cpp (latex):
	- force encoding switch only in multibyte context, switch the encoding properly,
	  and add some error messages.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25730 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-20 17:14:10 +00:00
Richard Heck
780bce0f96 Rename empty layout stuff to plain layout stuff.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25541 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-10 17:41:52 +00:00
Jürgen Spitzmüller
612e52b093 Back to CJK sanity I: Fix bug 4698 and 4696.
* lib/encodings:
* src/support/docstream.h:
	- JIS is not a valid iconv name. Rename to ISO-2022-JP

* src/output_latex.cpp:
	- fix wrong encoding switch.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25510 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-09 07:21:02 +00:00
Pavel Sanda
20b9e0ba93 Remove InsetEnvironment. This is unfinished decade old stuff.
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg141609.html


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25479 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-07 16:34:55 +00:00
Jürgen Spitzmüller
35e14de706 * src/output_latex.cpp:
- no blank lines before environments (bug 4993).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25416 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-02 08:34:55 +00:00
Jürgen Spitzmüller
d7eaaba900 ** support for CJK font argument. File Format change **
* src/BufferParams.{cpp,h}:
	- new param fontsCJK (font_cjk).

* src/output_latex.cpp:
	- use fontsCJK param.

* src/Buffer.cpp:
	- increase file format

* src/frontends/qt4/GuiDocument.cpp:
* src/frontends/qt4/ui/FontUi.ui:
	- GUI for the CJK font param

* lib/lyx2lyx/lyx_1_6.py:
	- remove font_cjk param on reversion.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25135 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-05 06:18:34 +00:00
Jürgen Spitzmüller
b607d70eb4 * src/output_latex.cpp:
- handle CJK nesting correctly with nested insets (bug 4913).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25093 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-03 07:51:14 +00:00
Jean-Marc Lasgouttes
9b4a26a252 rename assert.h to lassert.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24559 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-30 08:26:40 +00:00
Richard Heck
2b77c5d4af Now fix the cosmetics.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24455 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-22 18:33:07 +00:00
Richard Heck
4b33a37c97 Whoops.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24454 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-22 18:32:00 +00:00
Richard Heck
8c99d7227e Fix bug 4576. Bug was mixed up with Empty Layout stuff. It was not always easy for me to know then which test I needed to do, but if there are more of these, they'll be similar. Anyway, the right test here would have been:
if (!par->forceEmptyLayout())
but in fact things can be simplified more.

Cosmetics will follow. This patch makes the action more obvious.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24453 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-22 18:30:43 +00:00
André Pönitz
7f461f4392 infrastructure for 'graceful asserts'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24216 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-10 21:49:34 +00:00
Enrico Forestieri
958b6b7069 Fix bug 4665:
http://bugzilla.lyx.org/show_bug.cgi?id=4665


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23989 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-26 22:38:41 +00:00
André Pönitz
62d5a54ae7 small optimization
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23893 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-21 22:51:36 +00:00
Richard Heck
a01cb111a0 Change the interface to a paragraph's layout. We still store a LayoutPtr, but now privately, and make a Layout const & available to clients.
The need for a LayoutPtr arises from the fact that (a) we do not want to give our clients a Layout &, since we do not want them to be able to change our Layout; but (b) we also need to be able to change which layout is ours. So we cannot store a Layout const &. Or so it seems to the compiler.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23522 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 21:31:27 +00:00
Richard Heck
f401ce5d29 Changes LayoutList from a vector<LayoutPtr> to a vector<Layout>.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23519 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 20:01:30 +00:00
Richard Heck
d8a6b5bfd0 Remove TextClassPtr without losing the type safety it provided.
See these threads:
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg136112.html
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg136062.html
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg135997.html
for some background.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23299 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-28 01:42:02 +00:00
André Pönitz
db8c16d554 progress on buffer-reference-in-insets. beware of instabilities...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23289 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-27 20:43:16 +00:00
Richard Heck
c7afa2d658 More cleanup from Andre.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23194 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-24 15:44:11 +00:00
Richard Heck
0362c6aae7 Andre's s/getTextClass/textClass/ cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23190 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-24 15:06:35 +00:00
Richard Heck
2e7d1199df Revert 23154.
Sorry, Andre, but this broke not only the modules stuff but the general handling of TextClasses. I'm not opposed to doing this sort of thing, but it's going to be a little more complicated. I'll do it when I get a bit of time, or I can explain what the issue is here if you want to do it.

I'll separately re-commit some of the cleanup here.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23189 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-24 14:59:23 +00:00
André Pönitz
b306e9a2e1 Replace the text class shared ptr by good old index-into-global-list.
Also a few cosmetical changes where I xould not resist.

Would be nice if the 'modules people' could verify that their baby 
is strill alive... 



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23154 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-23 11:36:15 +00:00
Abdelrazak Younes
2bf1c09376 header cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23049 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-18 07:14:42 +00:00
Richard Heck
040f3431e7 Fix bug 4037 and related problems. The patch has been cleaned up a bit
from the one posted to the list.

The basic idea has two parts. First, we hard code an "empty layout"
(called PlainLayout, for want of a better name) in TextClass and read it
before doing anything else. It can therefore be customized by classes,
if they want---say, to make it left-aligned. Second, InsetText's are
divided into three types: (i) normal ones, that use the "default" layout
defined by the text class; (ii) highly restrictive ones, such as ERT and
(not quite an inset) table cells, which demand the empty layout; (iii)
middling ones, which default to an empty layout and use the empty layout
in place of the default. (This is so we don't get the same problem we
had with ERT in e.g. footnotes.) The type of inset is signaled by new
methods InsetText::forceEmptyLayout() and InsetText::useEmptyLayout().
(The latter might better be called: useEmptyLayoutInsteadOfDefault(),
but that's silly.) The old InsetText::forceDefaultParagraphs() has been
split into these, plus a new method InsetText::allowParagraphCustomization(). 
A lot of the changes just adapt to this change.

The other big change is in GuiToolbar: We want to show LyXDefault and
the "default" layout only when they're active.

There are a handful of places where I'm not entirely sure whether we
should be using forceEmptyLayout or !allowParagraphCustomization() or
both. The InsetCaption is one of these. These places, and some others,
are marked with FIXMEs, so I'd appreciate it if people would search
through the patch and let me know whether these need changing. If they
don't, the FIXMEs can be deleted.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22966 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-12 17:31:07 +00:00
Jürgen Spitzmüller
cbf599b911 ** Fix language switch issue introduced by the CJK patch **
* src/output_latex.{cpp,h}:
	- (latexParagraphs, TeXEnvironment, TeXOnePar, TeXDeeper): pass Text element 
	   instead of ParagraphList. This is necessary to detect whether we are in the main text.
	- check if we are in the main text for language switches, if needed.
* src/Buffer.cpp:
* src/insets/InsetEnvironment.cpp:
* src/insets/InsetText.cpp:
* src/mathed/InsetMathMBox.cpp:
	- adapt to new latexParagraphs definition.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22666 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-25 13:27:08 +00:00
Jean-Marc Lasgouttes
3d8828fa14 * src/Spacing.cpp (writeBeginEnv, writeEndEnv): add a bool parameter
directing to use memoir's capitalized latex macros.
	* src/LaTeXFeatures.cpp (getPackages): act on feature "SetSpace".
	* src/output_latex.cpp (TeXOnePar): ditto

	* lib/layouts/memoir.layout: provide feature SetSpace, indicating that
	memoir provides the setspace functionality, but with a different syntax.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22551 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-14 14:53:29 +00:00
Jürgen Spitzmüller
908a119973 * src/output_latex.{cpp,h}:
* src/Font.cpp:
* src/Paragraph.cpp:
	- simplify switchEncoding.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22184 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-17 10:53:38 +00:00
Abdelrazak Younes
9abb7db468 getting rid of superfluous std:: statements.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22104 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-12 19:28:07 +00:00
Abdelrazak Younes
b89cc942eb 'using namespace lyx::support' instead of 'using support::xxx'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22103 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-12 18:57:56 +00:00
Abdelrazak Younes
9383f4c3c6 'using namespace std' instead of 'using std::xxx'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22097 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-12 10:16:00 +00:00
Jürgen Spitzmüller
dc75c0f793 Sanitize CJK support (fix bug 3561, 4349 and 4337):
* src/output_latex.{cpp, h}:
	- Many changes in order to allow CJK in a mulitlingual context.
* src/Paragraph.cpp:
	- Fix file encoding switch and language nesting with CJK.
* src/Buffer.cpp:
	- Move the opening and closing CJK and lanaguage tags to ouput_latex.cpp.
* src/Font.cpp:
	- switchEncoding call now takes runparams as argument.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22011 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-08 11:21:00 +00:00
André Pönitz
9d0ea8aeff Move debug.{cpp,h}, Messages.{cpp,h} and gettext.{cpp,h} to support/.
Now support/* should have no dependencies on src/* anymore.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21851 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-29 07:04:28 +00:00
Jürgen Spitzmüller
04574322f6 * src/output_latex.cpp:
- prevent wrong whitespace by trailing '%' on line endings.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21742 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-23 14:59:35 +00:00
André Pönitz
e1ce2f92db reduce line noise
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21631 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-15 20:04:51 +00:00
Abdelrazak Younes
cdf1378200 Introducing TextClassPtr.h to minimize header dependencies.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21506 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-07 23:25:08 +00:00
Martin Vermeer
fa2bec7440 const, sorry
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21295 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-30 16:27:31 +00:00
Martin Vermeer
af84c0957d Fix line count off-by-one for single-par verbatims
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21293 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-30 16:22:56 +00:00
Abdelrazak Younes
5ddc612b73 Splitup Font in saner bits:
* Font::FontBits -> FontInfo
* Font::FONT_XXX -> all enums transfered to FontEnums.h and renamed to FontXxx

I've replaced Font uses with FontInfo were the language() member was not needed, basically all draw() and metrics methods. There's one problematic cases with InsetQuotes which I solved by taking the Buffer main language.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21240 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-28 18:51:54 +00:00
Abdelrazak Younes
5ebafb3ba7 fix warning.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21165 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-24 07:13:20 +00:00
Martin Vermeer
6da13bd888 Improve verbatim for RTL
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21153 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-23 18:23:03 +00:00
Martin Vermeer
5ab6d5bf65 Simplify ERT by using verbatim
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21121 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-22 18:01:21 +00:00
Abdelrazak Younes
e6f059a132 * Paragraph:
- simpleTeXOnePar(): renamed to latex(), beginning of de-spaghettization by truly splitting inset and character cases.
- appendChar(), appendString(): new method for buffer reading.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21117 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-22 13:09:16 +00:00
Abdelrazak Younes
6725b2db59 Reduce header dependencies in Paragraph.h
- Move Changes.h out of Paragraph.h
- pimpl the inset list.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21033 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-18 15:29:51 +00:00
Abdelrazak Younes
f7b1c86393 Move Inset::Code to InsetCode.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20936 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-13 09:04:52 +00:00
André Pönitz
b847b8c7df the delegate patch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20667 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-02 18:27:20 +00:00
André Pönitz
cd72af583f cosmetics
(maily move layout related enums into a header of there own to remov
include dependencies, alos rename a few things)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20598 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-29 20:02:32 +00:00
Lars Gullik Bjønnes
26f336769a Remove warnings reported with gcc 4.3:
- Modifier on return type ignored
	- Ambigous else
	- Ambigous logical operators
	- Semi-colon instead of empty block
	- Missing header files
	- Missing using std::XX
	- Initialization out of order


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20304 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-16 10:36:57 +00:00
André Pönitz
39c7e2faf0 rename Layout_ptr into LayoutPtr
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19758 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-23 19:59:07 +00:00
Dov Feldstern
6a8b25ba51 Correctly generate latex for font/language/encoding switches inside and around
insets. Up until now this has not been 100% correct, especially in the case
of RTL languages (but not only those).
This fixes bug 1820 (http://bugzilla.lyx.org/show_bug.cgi?id=1820)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19150 a592a061-630c-0410-9148-cb99ea01b6c8
2007-07-20 01:28:20 +00:00
Dov Feldstern
be01974475 Fix "default" encoding to match "auto" encoding except for the actual output
of \inputencoding commands, which are not needed in some cases (e.g., Hebrew 
with ivritex).

This fixes some of the remaining problems (but not all) from bug 3613 (namely, http://bugzilla.lyx.org/show_bug.cgi?id=3613#c9).
See also some example files fixed by this in http://permalink.gmane.org/gmane.editors.lyx.devel/88805 .


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18994 a592a061-630c-0410-9148-cb99ea01b6c8
2007-07-05 19:19:41 +00:00
Georg Baum
25fc26446b typo
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18911 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-27 14:50:50 +00:00
Lars Gullik Bjønnes
897436efbb Whitespace cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18550 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-28 22:27:45 +00:00
Uwe Stöhr
ff8f2b3609 output_latex.cpp: Fix bug 3571:
http://bugzilla.lyx.org/show_bug.cgi?id=3571

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18273 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-11 23:43:17 +00:00
Abdelrazak Younes
b5ff27fdd1 Cleanup in order to better understand bug 3043 and 3561.
* switchEncoding(): simplify return logic (transform 'and -> do' to 'or ->return')


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18224 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-07 17:10:10 +00:00
Uwe Stöhr
80b94c6bf5 Georg's patch for bug 3043:
Introduces new encodings for the CJK-languages.
The CJK-languages can now be selected from LyX's menu.
For remaining small problems, see the thread "Help needed for bug 3043" on the devel-list.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18216 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-06 20:26:02 +00:00