Commit Graph

21732 Commits

Author SHA1 Message Date
Juergen Spitzmueller
c5753af50d Fix crash when right-clicking into an inset with more paragraphs than the main text.
Fixes: #9123.
2014-05-18 18:03:06 +02:00
Enrico Forestieri
0616c8fe32 Disregard font properties changes when inserting a separator.
This allows to output a simple blank line instead of strange constructs.
2014-05-18 17:34:11 +02:00
Enrico Forestieri
a919cd8c68 Take into account that a blank line is always output before a command. 2014-05-18 17:31:58 +02:00
Richard Heck
4d30b613ba Whitespace. 2014-05-18 11:27:54 -04:00
Scott Kostyshak
d863a76f45 Correct my previous comment (thanks Kornel) 2014-05-18 05:14:05 -04:00
Stephan Witt
b3b6fc643d #8849 catch exception in enchant speller backend and avoid multiple speller lookups for missing dictionaries 2014-05-18 10:43:32 +02:00
Scott Kostyshak
10df612191 Add comment 2014-05-18 04:29:59 -04:00
Scott Kostyshak
4bd0941b4f Graphics only handle inset-modify graphics (#8262)
inset-modify tabular and others are now passed on.
2014-05-16 23:38:32 -04:00
Scott Kostyshak
43d464cca0 Fix alignment rendering of multirow in LyX (#8976)
Multirow cells now have the same alignment rendering in LyX
as in the output. The alignment of a multirow can change as
long as the column is not of fixed width. If the column is
of fixed width, the multirow is left-aligned.

When setting a multirow, the alignment is copied from
the last cell in the selection.
2014-05-16 23:38:26 -04: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
95787a0a4c 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 15:31:43 +02:00
Jean-Marc Lasgouttes
f9e0d4a595 Remove unused parameter. 2014-05-16 15:25:17 +02:00
Jean-Marc Lasgouttes
ee7c4db72a Do not forget last word of paragraph in completion
With the old code, the last word of a paragraph would not be added in
the completion list. The key difference is to pass `from' instead of `pos'
to FontList::fontiterator.

Slight cleanup of the code.
2014-05-16 15:22:51 +02:00
Enrico Forestieri
15e1f5eb39 Make use of otexstream also in external::writeExternal
This was not necessary when LyX was generously outputting newlines.
As it may happen that the output produced by writeExternal (the
result of an external inset) starts right at the beginning of a
line, if otexstream does not know that something is already on
the line, the iomanip-like variable 'breakln' fails to actually
break the line.
2014-05-16 14:40:09 +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
Scott Kostyshak
1821c6d8a3 Centralize substitution of python commands
The code for detecting python commands and substituting in the
correct prefix is now merged with what used to be libScriptSearch()
and is now renamed to commandPrep(). This commit does not change
any functionality and just improves organization to reduce the
chance of bugs in the future.
2014-05-14 15:45:20 -04:00
Scott Kostyshak
8b66f9cedf Centralize replacement of "$$s"
Now the replacement is done in startScript(). In addition to making
the code cleaner and more consistent, this commit fixes a bug where
"$$s" was not replaced when "latex=" was specified in the extra flags
of a converter.

Note that the temporary fix at 731b8610 is reverted with this commit.
2014-05-14 15:45:20 -04:00
Jean-Marc Lasgouttes
3b3d28cf8e Rename misleading parameter.
... and a typo and some whitespace.
2014-05-14 18:09:40 +02:00
Georg Baum
3c1b79dd5b Update tex2lyx test references
This is needed after c668ebf61. tex2lyx itself was already updated, and I
verified that the new output is correct.
2014-05-12 21:23:47 +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
6b0a8fbc96 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.
2014-05-08 18:19:55 -04:00
Enrico Forestieri
3e681bea4f Fix problem with drawing of math backround with selections. 2014-05-07 14:18:14 -04:00
Juergen Spitzmueller
d7e9ab08a3 Listings: Validate skip amounts correctly.
Fixes: #7373.
2014-05-07 12:33:39 +02:00
Jean-Marc Lasgouttes
015333d987 Rely on Qt to handle small caps text
This has the advantage of simplifying our code and to produce the
correct output: the small capitals should have the exact same width as
the lower case letters.

The slanted fonts are also translated to oblique on Qt side, but this
does not seems to have an effect in my testing. It may be that proper
oblique fonts need to be installed.
2014-05-07 12:13:27 +02:00
Juergen Spitzmueller
5368645e70 Simplification 2014-05-07 08:09:04 +02:00
Juergen Spitzmueller
ef05f7cca9 Store InsetListingsParams in a vector of pairs, not a map, since order of insertion matters.
Fixes: #8144, #5203.
2014-05-06 20:22:25 +02:00
Juergen Spitzmueller
e43e4456ea Fix typos in InsetListingsParams validator 2014-05-06 20:17:03 +02:00
Kornel Benko
fdd5a1bd5f make build: Versioning of lyx.svg (missed in previous commit) 2014-05-06 17:24:00 +02:00
Jean-Marc Lasgouttes
ac9a2fa9f8 Turn an error message into a Debug::LOCALE warning 2014-05-06 14:29:42 +02:00
Juergen Spitzmueller
2730f9e2b5 Fix View Source size
Fixes: #9084.
2014-05-01 18:00:37 +02:00
Stephan Witt
36e5864a82 improve language flag for Objective-C compiler call 2014-04-30 23:14:41 +02:00
Stephan Witt
43d75a0796 struct with virtual functions should have virtual destructor 2014-04-30 23:14:41 +02:00
Georg Baum
8ed7f52584 Whitespace fixes 2014-04-29 22:06:02 +02:00
Georg Baum
351363c599 Fix C++11 test
Thanks Vincent for noticing. The old test was slightly off, the C++98 standard
guarantees that __cplusplus is defined as 199711L, not 19971L.
2014-04-29 21:00:02 +02:00
Vincent van Ravesteijn
2552c737be GuiLog: Use GuiClipboard to put the log on the clipboard
All direct interaction with the Qt clipboard is now done in either GuiClipboard or GuiSelection.
2014-04-29 15:38:35 +02:00
Vincent van Ravesteijn
847d1fb2f5 Use the cached value GuiSelection::selection_supported_
That's where it is for.
2014-04-29 15:17:15 +02:00
Juergen Spitzmueller
79a59fce1d Do not write an empty default_otf_view_format.
Fixes: #9100.
2014-04-28 14:59:03 +02:00
Georg Baum
0c0e16c61c Make iparserdocstream more like std::istream
In C++98 std::istream does not use an operator bool(), but an operator
void*() instead, which prevents some unwanted conversions (this is one
possible implementation of the safe bool idiom).
In C++11 std::istream uses explicit operator bool, which prevents the unwanted
conversions using a new language feature.

This change does not have any effect on correct code, but prevents some
mistakes.
2014-04-22 22:03:31 +02:00
Vincent van Ravesteijn
b6ccf21192 cmake: Objective-C compilation support with clang and C++11
This fixes an issue when compiling with C++11 flags on: the
objective-C clang compiler produces an error. This patch set
the -std option to ansi for the Objective-C sources.
2014-04-22 09:41:25 +02:00
Benjamin Piwowarski
d863088986 Revert "Objective-C compililation support with cmake and C++11"
This reverts commit c2e67a41ce.
2014-04-22 09:36:17 +02:00
Juergen Spitzmueller
a4ea543f2f Bibtopic requires styles files to be passed via argument
Fixes: #9060
2014-04-22 09:25:58 +02:00
Jean-Marc Lasgouttes
5c32dc85d5 Fix various warnings issued by clang++.
* remove unused class TexStream.

* remove unused virtual method Inset::cellXOffset

* remove second argument of FileDialog constructor, which was actually
  not used

* remove some dead local code

* remove some unused private members of classes

* in InsetMathNest::updateBuffer, fix the logic of a test
2014-04-22 00:04:04 +02:00
Kornel Benko
f3a96fb833 Cmake build: Add include path for src/tests/dummy_functions.cpp
Othervise the statement '#include "../Messages.h"' results in error.
2014-04-21 19:14:25 +02:00
Jean-Marc Lasgouttes
6c8a775c73 Use subdir-objects for automake 1.14 or newer
This option is going to be mandatory starting with automake 2.0.
LyX is able to use this since version 2.1, but it turns out that it is
badly implemented in versions of automake older than 1.14.

We rely on some (undocumented) symbol to detect automake 1.14 and
use the subdirs-objects option in this case.

For more details, see:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg181023.html

Making everything work with autotools required making a copy of two
files from support/tests. It seems that we should not point to source files
that are handled by another Makefile.am.
2014-04-21 11:52:00 -04:00
Richard Heck
39ac113ba1 Update other comment. 2014-04-21 11:52:00 -04:00
Richard Heck
6021322c01 Update comment slightly. 2014-04-21 11:52:00 -04:00
Juergen Spitzmueller
2928afbd01 Add comment. 2014-04-21 11:52:00 -04:00
Richard Heck
75aa0d61db Make some functions return const refs, and add a comment. 2014-04-21 11:52:00 -04:00
Richard Heck
c0be76a2d6 Whitespace. 2014-04-21 11:52:00 -04:00
Richard Heck
065db68067 Fix a bunch of minor issues discovered by the cppcheck script. 2014-04-21 11:52:00 -04:00