Commit Graph

22290 Commits

Author SHA1 Message Date
Juergen Spitzmueller
066d6a9cfb Grr... 2015-03-16 14:30:02 +01:00
Juergen Spitzmueller
bc85f0fdf7 Properly escape backslash in string 2015-03-16 14:28:16 +01:00
Juergen Spitzmueller
245c2b3c45 InsetPhantom::latex(): use a switch 2015-03-16 14:22:03 +01:00
Juergen Spitzmueller
e30db1e444 Whitespace
Time to properly set up QtCreator...
2015-03-16 14:15:05 +01:00
Juergen Spitzmueller
d044d6afa7 Phantom is fragile (#9456) 2015-03-16 14:11:45 +01:00
Enrico Forestieri
1af2242c7e Refine fix for #9453
It is better to introduce a dummy blank dir in TEXINPUTS rather than
appending a blank at the end. Even if I have checked that this is not
a problem with MikTeX, some other engine (maybe texlive, but I cannot
check) could not ignore this space and take it as the name of a dir.
In this case, TEXINPUTS would not end with an empty element and the
standard search path would not be inserted there.
2015-03-16 10:55:54 +01:00
Enrico Forestieri
0a5e1f20fc Fix bug #9453
This was due to a problem with the QProcess parser.
See #9453 for details.
2015-03-16 00:34:35 +01:00
Kornel Benko
fcf8d1a746 make build: Make it compilable for Qt4 too. 2015-03-15 20:12:55 +01:00
Jean-Marc
1f36fa6d56 Document the drawing of logos
Also fix a couple of spacings.
2015-03-15 18:21:01 +01:00
Georg Baum
73c3f3e2fd Improve code readability
Using a small helper struct instead of a std::pair makes things like
it->second.first a little less confusing: it->second.scope.
2015-03-15 13:57:45 +01:00
Georg Baum
5bb7857bb2 Add missing check
The other insert method has this as well, and it is indeed a problem is pos
points outside the vector.
2015-03-15 13:56:48 +01:00
Juergen Spitzmueller
187c5f0ef5 Use QLocale::toDouble instead of QString::toDouble in the length validator
Fixes: #9214
2015-03-15 11:48:36 +01:00
Juergen Spitzmueller
d9626ec6af Set the logic straight 2015-03-15 10:38:37 +01:00
Juergen Spitzmueller
d15388ba98 Allow to disable inputenc loading via 'Provides inputenc 1' 2015-03-15 10:29:07 +01:00
Jean-Marc Lasgouttes
322da78299 Improve display of the logos.
This look now more like the real logos. Moreover, we use not the normal font color because Color_special is a bit too flashy.
2015-03-14 17:01:49 +01:00
Georg Baum
5ee6172b7b Fix stmaryrd operators with limits (bug 9458)
LyX did not display the limits of the big math operators defined by
stmaryrd.sty correctly. The reason for this was a missing check in
InsetMathSymbol::metrics(), where it is hardcoded which symbols use display
style limits and which symbols use inline limits. In an ideal world this
information would be contained explicitly in lib/symbols.

This should go to branch as well.
2015-03-13 18:38:38 +01:00
Enrico Forestieri
ee6583ff94 Make sure that a generated temporary filename doesn't end with a dot.
This may happen if the extension is empty, and a filename ending with
a dot may give troubles on Windows.
2015-03-13 18:12:08 +01:00
Enrico Forestieri
c057d4e7ee Make sure an unzipped file has correct extension.
If a mask is missing, the TempFile class appends it to the filename.
This may be a problem with applications relying on the extension,
so explicitly add a mask.
2015-03-13 17:28:18 +01:00
Kornel Benko
d9c867da19 Cmake build: QtGui now needed also for filetools.cpp 2015-03-13 14:22:12 +01:00
Enrico Forestieri
7be2a5d815 Prefer svg icons.
If a compressed svg icon is present, load it instead of a png one.
Also introduce two more sizes (huge and giant icons) that should be
useful when using hires displays, as svg icons automatically scale
to the desired size without loss of quality.
2015-03-13 00:47:21 +01:00
Enrico Forestieri
d00dcc2ca7 Use the nominal theme's icon size for displaying the icon in an info inset. 2015-03-13 00:38:05 +01:00
Enrico Forestieri
bd9f5408cf Properly name an uncompressed sgvz file.
Some tools may rely on the extension and do not actually check whether
a svg file is compressed or not.
2015-03-13 00:34:53 +01:00
Enrico Forestieri
cbad159ac2 Make sure a temporary file is always created in the global temporary dir. 2015-03-13 00:31:08 +01:00
Georg Baum
d752334ec4 Fix tex2lyx script output
tex2lyx did not use the InsetLayout for the script insets, so it did not know
that it had to use Plain Layout. However, there is still a possible pitfall:
InsetScript uses a hard coded plain layout for the InsetText constructor, so
if anybody would remove ForcePlain 1 and MultiPar false from the InsetLayout
then LyX would still write script insets with plain layout, but tex2lyx would
output standard layout again.
2015-03-11 22:20:44 +01:00
Georg Baum
361967e613 whitespace 2015-03-11 22:03:29 +01:00
Georg Baum
d8ed62f496 Update tex2lyx test references
tex2lyx outputs the correct layout ("Plain Layout") for captions since
9d824a04d1. Previously, it did output  "Standard", which was wrong.
2015-03-11 21:02:59 +01:00
Jean-Marc Lasgouttes
58b3971eeb Avoid crash with after a params undo.
When doing a non-atomic undo, one should not try to merge with a previous params undo.

This fixes bug #7740.
2015-03-11 16:55:51 +01:00
Georg Baum
24d011117f Remove unsupported macros from autocompletion
We have some math macros that exist only because LyX can display them easily,
but which require user preamble code. These commands should not appear in
autocompletion, they are only there to make the formulas of users who actually
need thgese symbols and know what to put into the preamble more beautiful.
2015-03-10 20:53:56 +01:00
Jean-Marc Lasgouttes
e86cc0135a Fix generation of lyx_commit_hash.h
Now version.o is not recompiled on already built tree.
2015-03-10 19:13:06 +01:00
Juergen Spitzmueller
9d824a04d1 Properly define MultiPar status of caption in the layout definition.
Also remove hardcoded paragraph break disabling.

Candidate for branch.
2015-03-10 18:31:55 +01:00
Jean-Marc Lasgouttes
c85ad29f11 Take in account the parent's getStatus in macro templates
This avoids invoking the insert space dialog instead of the math version. Thereafter, spaces are correctly inserted inside macro templates.

This is the last part of the fix to #9432.
2015-03-10 16:17:29 +01:00
Jean-Marc Lasgouttes
97c6e6d1ba Do not sanitize the anchor of cursor when selection is not set
Additionally, move the code to write to a stream from Cursor to CursorData (so that debugging undo is easier). We loose x_target, but I am not sure it is important.

This is the second part of bug #9432.
2015-03-10 16:17:29 +01:00
Jean-Marc Lasgouttes
17e435c47e Check that DocIterator::sanitize only adds editable insets
This fixes the crash on ticket #9432, but the bug there has other causes.
2015-03-10 16:17:29 +01:00
Jean-Marc Lasgouttes
f07ffaee84 Some code factorization for the Change template
The original motivation is to initialize the change_ member but do it only once.

This fixes coverity issue 23432.
2015-03-05 16:52:49 +01:00
Jean-Marc Lasgouttes
a0fd54b2e7 Remove variable properly now
This is a follow-up to db1979f398.
2015-03-05 12:48:01 +01:00
Jean-Marc Lasgouttes
24737eeceb Reset stream properties after changing them
Fixes coverity issue 23468.
2015-03-05 12:46:40 +01:00
Jean-Marc Lasgouttes
db1979f398 Remove unused member.
Fixes coverity issue 23413.
2015-03-05 12:30:12 +01:00
Jean-Marc Lasgouttes
0e2ef88b43 Fix uninitialized member in Lexer constructor
Fixes coverity issue 23501.
2015-03-05 12:24:47 +01:00
Jean-Marc Lasgouttes
c925748126 Fix uninitialized members in Language constructor
Fixes coverity issue 23412.
2015-03-05 12:17:52 +01:00
Jean-Marc
4e2f16e84e Fix uninitialized member in LaTexFont constructor
Fixes coverity issue 23382
2015-03-04 23:21:34 +01:00
Jean-Marc
1e94fc4fea Fix uninitialized member in Floating constructor
Fixes coverity issue 23402.
2015-03-04 23:13:06 +01:00
Jean-Marc
3705fd4eba Fix uninitialized members in Cursor and CursorData constructors
Fix coverity issues 23401, 23407, 23416 and 23429.
2015-03-04 23:00:07 +01:00
Jean-Marc
0fbc402141 Fix unitialized members in CacheItem
Fixes coverity issue 23380.
2015-03-04 22:50:37 +01:00
Jean-Marc
8d882e662b Add test for null buffer
This is actually not needed in practice.

Fixes coverity issue 23306.
2015-03-04 22:46:48 +01:00
Jean-Marc
a5a01b6af3 Fix uninitialized members in Compare::Impl
Fixes coverity issue 23418.
2015-03-04 22:35:40 +01:00
Jean-Marc
08c9f208fb Pass parameters by reference (performance)
Fixes coverity issues 23339 and 23347.

Some additional spacing changes sneaked in.
2015-03-04 22:26:28 +01:00
Jean-Marc
fbe333245e Fix unintialized member of BufferView::Private
Fixes coverity issue 23404.
2015-03-04 22:17:51 +01:00
Jean-Marc
fac7cb922a Fix missing break in switch
Fixes coverity issue 23350.
2015-03-04 22:13:20 +01:00
Jean-Marc Lasgouttes
9448e89879 Remove unused variable BufferParams::quotes_times
This was pointed out inadvertently by coverity issue 23484: the
variable was not properly initialized.
2015-03-04 18:21:58 +01:00
Jean-Marc Lasgouttes
0552563c99 Initialize Buffer::Impl members correctly
In practice the variables were initialized later as needed.

Fixes coverity issue 23497.
2015-03-04 17:57:29 +01:00
Jean-Marc Lasgouttes
1d2b7fb1ec Initialize object properly
Fixes coverity issue 23363
2015-03-04 17:48:44 +01:00
Jean-Marc Lasgouttes
83073aec3a Record undo properly when changing multiple paragraphs parameters
Fixes bug 9437.
2015-03-01 16:25:19 +01:00
Jean-Marc Lasgouttes
536cd8ecd8 Fix cursor position before a virtual element
When there is a virtual element like an end-of-paragraph marker, the cursor should be on the left (in RTL text).

This problem was created by 46ee6799.
2015-03-01 15:59:00 +01:00
Georg Baum
3e9e6e344a Replace automatic logofication with insets
Previously, LyX did replace some words with typeset logos, and there was no
way to prvent this except putting them, in ERT (bug #4752). Now we have
special insets for these words, and standard text is left alone.
2015-03-01 11:16:57 +01:00
Jean-Marc Lasgouttes
776a4f53c2 Revert some other dubious "improvements" in b627b870 2015-02-28 23:41:20 +01:00
Georg Baum
e76fc73040 Fix \nobreakdash- roundtrip in moving args
Previously, tex2lyx did not remove the \protect which is output by LyX in
front of \nobreakdash- if needed. Now tex2lyx removes it unconditionally (like
it does elsewhere), because LyX will add it if needed.
2015-02-27 22:06:11 +01:00
Georg Baum
d49051d99f Fix hyphen conversion in passThru insets
The old hyphen replacement code did not convert hyphens if the condition
style.pass_thru || runparams.pass_thru
was met. style.pass_thru got set from inset owner (isPassThru()). Therefore
we have to consider this for the new replacement code as well.
2015-02-26 22:55:20 +01:00
Richard Heck
db954b5dc0 Add comment, so that does not happen again. 2015-02-24 20:07:32 -05:00
Richard Heck
94a5481a17 Partially revert b627b870, which broke cursor movement. 2015-02-24 20:04:59 -05:00
Georg Baum
8aa37c43a1 Fix plaintext output of dashes (bug #3647)
Previously, consecutive dashes in .lyx files were combined to endash and emdash
in some cases, and in other cases they were output as is. This made the code
complicated, and resulted in inconsitencies ((bug #3647).
Now, a dash in a .lyx file is always a dash in the output, for all flavours.
The special handling is moved to the input side, so that you still get an
endash if you type two hyphens. If needed, this can be changed or made
customizable without the need to update the file format again. Many thanks
for the fruitful mailing list dicsussion, which contributed significantly to
the final version.
2015-02-24 22:06:12 +01:00
Richard Heck
fc9e6326b9 Micro-optimization. 2015-02-24 13:43:33 -05:00
Jean-Marc Lasgouttes
b627b8701b Some performance stuff reported by cppcheck 2015-02-24 18:38:20 +01:00
Scott Kostyshak
58f428d57c Whitespace 2015-02-21 14:09:02 -05:00
Jean-Marc Lasgouttes
143c136a7f Do not read array before checking the bounds
Fixes coverity issue 23377
2015-02-20 16:51:20 +01:00
Jean-Marc Lasgouttes
2694fde47d Initialize variable properly.
This fixes coverity issue 23503.
2015-02-20 16:47:27 +01:00
Jean-Marc Lasgouttes
fd7aa2d62d Do not mix several names for the same variable
This confuses coverity, but is probably harmless.

Fxies coverity issue 23374
2015-02-20 16:37:06 +01:00
Jean-Marc Lasgouttes
d9c9c6b36d Remove C-isms in isValidLength
This fixes coverity issue 23349, with a potential out-of-bounds write to the pattern array.
2015-02-20 16:16:31 +01:00
Jean-Marc Lasgouttes
053d02d176 Don't try to show 1000 as a roman number
Fixes coverity issue 23360.
2015-02-20 15:59:19 +01:00
Jean-Marc Lasgouttes
edddb47bae whitespace 2015-02-20 15:57:45 +01:00
Jean-Marc Lasgouttes
01691cde49 Fix uninitialized variable
Fixes coverity issue 23446.
2015-02-20 15:53:19 +01:00
Jean-Marc Lasgouttes
4a439d6ac0 Do not create a new socket if the max. number of clients is attained
Fixes coverity issue 23431.
2015-02-20 15:46:34 +01:00
Jean-Marc Lasgouttes
3db4b23b3f Fix memory leak in TImer class.
This is not really important since the class is currently not used.

This is coverity issue 23291.
2015-02-20 15:39:45 +01:00
Jean-Marc Lasgouttes
eb4f963eef Main argument of a subfloat is not a moving argument
Fixes bug: #9421
2015-02-20 11:51:40 +01:00
Georg Baum
1fd4aaefd6 Fix regression of eb121f999
Again thanks to Scott for finding this. The removal of the check for full
unicode in eb121f999 was not wanted. Now listings can be exported to
lualatex and xetex again.
2015-02-17 21:19:05 +01:00
Georg Baum
bc8638bd25 Fix wrong LATTEST
Thanks to Scott for testing. If a macro is unknown (displayed in red), then
macro_ is 0. The LATTEST is now adjusted and works like in MathMacro::write()
where I stole it from.
2015-02-16 22:33:48 +01:00
Georg Baum
e4ec11e8a1 Output -- and --- in XHTML like in LaTeX
For exports based on LaTeX, consecutive hyphens are only converted to endash
and emdash if the current font family is not typewriter, and if none of the
parent insets is an IPA inset. Now this is done for XHTML export as well.
2015-02-15 20:17:21 +01:00
Uwe Stöhr
4a8881c60a text3.cpp: adapt a possible fix to current code 2015-02-15 01:04:41 +01:00
Georg Baum
7adc6125f7 Fix missing symbols in math completer
The math icons for the symbol image in the math completer were hardcoded to the
command names. This is wrong for some icons for various reasons, e.g. the case
insensitivity of windows file systems. Therefore we have to use the replacement
list which is also used for the toolbar icons. Bug #3538 is not closed because
of this problem, but IMHO it has nothing to do with this bug, it is a more
general one.
2015-02-14 20:32:25 +01:00
Georg Baum
f9f05c364b Unify layout categories 2015-02-14 11:35:40 +01:00
Georg Baum
864f44ddc2 Fix unused parameter warning 2015-02-14 11:32:39 +01:00
Scott Kostyshak
36c3495a3a Correct the spelling of "occured" to "occurred" 2015-02-09 18:44:02 -05:00
Richard Heck
5a78a112b6 Fix bug #9383. Writing directly to the output stream bypassed the
machinery that clears the tag stack.
2015-02-09 17:26:47 -05:00
Jean-Marc Lasgouttes
51cc1a1cbe Do not modify the changed() status of rows when no drawing has taken place
There are several places in the code where a row is painted with drawing disabled in the painter. The goal is only to recompute inset positions.

Such a case happens in BufferView::checkCursorScrollOffset, as part of the horizontal scrolling patch. Note that this particular piece of code should eventually be removed, since it is a performance problem.

It makes sense to consider that only a real painting of a row should change its status. However, I would not be surprised if this change would break other things.

Fixes: #9388
2015-02-09 15:16:41 +01:00
Scott Kostyshak
d81fe084a6 Revert "Do not modify the changed() status of rows when no drawing has taken place"
This reverts commit c6f8f51525.

I accidentally committed this patch, which I am testing as
a fix to 9388.
2015-02-08 16:39:06 -05:00
Jean-Marc Lasgouttes
c6f8f51525 Do not modify the changed() status of rows when no drawing has taken place
There are several places in the code where a row is painted with drawing disabled in the painter. The goal is only to recompute inset positions.

Such a case happens in BufferView::checkCursorScrollOffset, as part of the horizontal scrolling patch.

It makes sens to consider that only a real painting of a row should change its status. However, I would not be surprised if this change would break other things.

Fixes: #9388
2015-02-08 16:18:56 -05:00
Juergen Spitzmueller
d48e5330be Add pref option to disable middle-mouse-button paste
Fixes: #9399
2015-02-08 17:41:28 +01:00
Georg Baum
7178f98b0f Fix tex2lyx parsing of consecutive hyphens
tex2lyx was already behaving as if bug #3647 was fixed, but currently -- and
--- have the same special meaning in LyX as in LaTeX.
2015-02-01 14:03:58 +01:00
Georg Baum
3120ff8e9f Fix tex2lyx tests for 23e8db3e5
The textcyr test did not work anymore, since the output of
"CYRILLIC SMALL LETTER VE" changed from \textcyr{\char226} to \textcyr{\cyrv}.
The the old version is now converted to ERT. In theory it could also be
converted to "CYRILLIC SMALL LETTER VE", but this would mean to maintain an
extra list, which is not worth the effort.
2015-02-01 13:12:45 +01:00
Georg Baum
e6354e1a17 Oops 2015-02-01 12:49:41 +01:00
Georg Baum
8c3829e6f1 Improve InsetSpace docbook export
The removed link does not exist anymore. The character entities were taken
from http://www.sagehill.net/docbookxsl/SpecialChars.html.
2015-02-01 12:39:53 +01:00
Enrico Forestieri
e3960ffd0b Fix bug #9392: Matrix widget keyboard navigation broken 2015-01-27 22:59:33 +01:00
Juergen Spitzmueller
5563dc924a Fix output encoding information for non-TeX fonts XeTeX/LuaTeX on preview pane
Fixes: #8919
2015-01-24 15:53:28 +01:00
Juergen Spitzmueller
16c33b5f6e Move font encoding information to languages. 2015-01-24 14:02:16 +01:00
Jean-Marc Lasgouttes
7021f4c342 Implement new recordUndoBufferParams method.
Rename recordUndoFullDocument to recordUndoFullBuffer.

Separate the notion of recording changes to paragraphs and recording changes in buffer parameters.

Audit every user of recordUndoFullDocument and replace it with either recordUndoBufferParams or recordUndoFullBuffer. Add comments to identify remaining work.
2015-01-22 15:15:21 +01:00
Uwe Stöhr
95bf60b52b ParagraphUi.ui: update file to QT's xml format 2015-01-22 01:07:40 +01:00
Enrico Forestieri
f496ec373b Solve the "soft-hyphen" (0x00ad) symbol problem.
After the str-metrics merge, the kludge for displaying symbols whose
code point corresponds to a soft-hyphen was not working anymore.
The solution is replicating the offending glyphs with index 0x00ad
at a different index. They were replicated at 0x00ac, whose glyph
was missing in all affected fonts.

However, this would not work by alone because, if a system font with
same family name exists, it would be picked up instead of the right one
(at least on non-Windows platforms). For this reason, the style of the
fonts has been changed from "Regular" to "Lyx", so that we can discriminate
the right font. However, this requires using at least Qt 4.8. If an
older Qt is used *and* a system font with same family name is already
available, the affected glyphs will all turn out on screen as the
"logical not" symbol.

I have also set the executable flag on the font files, because on Windows
they are loaded only in this case.

This solves #9229.
2015-01-21 14:12:42 +01:00
Georg Baum
c5782ff4bb Fix pasting insets into math (bug #9302)
The problem was that the conversion to plain text (which is used as an
intermediate step) requires for some insets a valid buffer pointer, but
insets in the cut stack do not have one. Now we use the same temp buffer
business as for copying to the external clipboard.
2015-01-19 21:37:01 +01:00
Georg Baum
19f3f630bc Remove unused declaration 2015-01-14 21:44:28 +01:00
Jean-Marc Lasgouttes
3830ce46db Squash warnings reported by gcc 4.9
Most of these are just about conversion from double to int.

Of note also the replacement of an horrible reinterpret_cast by a proper solution.
2015-01-14 11:52:14 +01:00
Vincent van Ravesteijn
51b28ba1d8 ConsoleApplication: Fix typos 2015-01-13 21:59:39 +01:00