Commit Graph

22177 Commits

Author SHA1 Message Date
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
Vincent van Ravesteijn
1950152b39 cmake: Put check_ExternalTransforms in tests folder 2015-01-13 21:21:12 +01:00
Enrico Forestieri
35357c1225 Fix preferences panel.
This commit fixes a thinko in [8bab2338/lyxgit] causing the warning:
QObject::connect: No such slot lyx::frontend::GuiPreferences::slotApplyRC() in ../../../../src/frontends/qt4/GuiPrefs.cpp:3308
QObject::connect:  (sender name:   'applyPB')
QObject::connect:  (receiver name: 'PrefsUi')
2015-01-11 20:11:40 +01:00
Georg Baum
eb121f9993 Replace hardcoded hack with InsetLayout tag 2015-01-11 20:01:19 +01:00
Jean-Marc Lasgouttes
6e519e7727 Fix two warnings about conversion from double to int. 2015-01-11 19:55:05 +01:00
Enrico Forestieri
d4428ceb81 Adjust preprocessor guards for Qt5/X11.
This fixes the -geometry command line option and restores the
"Use icons from system's theme" checkbox in the preferences.

There is still code addressing Qt4 and xlib that has to be
audited. This code cannot be compiled with Qt5 because the
default backend is now xcb and not xlib. I have marked such
code with a "FIXME QT5" comment.
2015-01-11 19:44:35 +01:00
Georg Baum
5d6351d476 Fix wrong listings preamble encoding (bug #9382)
The listings package employs some dirty tricks internally, therefore it does
not work with utf8 encoding, but requires fixed width encodings. This version
of the fix uses ugly hardcoding instead of a layout file format change, so it
could be backported if needed.
2015-01-11 19:17:51 +01:00
Georg Baum
7b48e2aac0 Start qt event loop for commandline usage
This is needed since src/support calls lots of qt code, and some parts of it
(e.g. QFileInfo) require a running event loop. This fixes bug #4917 which is
a symptom of the problem.
The fix is to create a QCoreApplication for tex2lyx, lyxclient and LyX running
without GUI. In the future this could be extended, i.e. to split up the
frontend Application class in a GUI and a console class, and having the
console class use LyXConsoleApp in the same way as Application now uses
GuiApplication. If that is done, one could also think of moving
support/ConsoleApplication to frontend/console/ConsoleApplication.
2015-01-11 14:06:17 +01:00
Georg Baum
a02af82b82 Fix indentation 2015-01-11 11:29:00 +01:00
Jean-Marc Lasgouttes
1e18ab586e Fixes to InsetCaption \protect-ion
* \caption does not need to be protected in general
* the contents of \caption arguments need to be protected, though.

All styles related to caoption inset have been audited and updated.

The special casing of captions in longtables has been removed, since there is no special case.

Fixes bug: #9177
2015-01-10 19:48:56 +01:00
Jean-Marc Lasgouttes
9c55af4a22 Merge remote-tracking branch 'features/scroll-reloaded'
This implement horizontal scrolling of rows to allow editing insets
(math, tabular...) that are larger then the screen. The scrolling happens
as the cursor moves, in order to make sure that the cursor is always visible.
This effectively closes an 11 years old bug.

This feature is the result of the work of Hashini Senaratne as part of
Google Summer of Code 2013. The code has been cleaned-up for inclusion
and remaining bugs have been fixed.

Fixes bug: #1083.
2015-01-10 18:39:09 +01:00
Georg Baum
ca6fba31fb Remove direct calls of exit()
This is a preparation for using QCoreApplication.
2015-01-09 21:43:45 +01:00
Georg Baum
8f2828197c Move otexstream out of support
This resolves a dependency of src/support/docstream.cpp on src/TexRow.cpp,
which is the wrong way round. This fixes the linking
src/tests/check_ExternalTransforms with MSVC where the linker is not clever
enough to detect that the whole otexstream class is unused.
2015-01-09 21:07:59 +01:00
Georg Baum
9c1504a416 Update references after 706960eba
The generated output is correct, since the lyx2lyx forward conversion is empty.
2015-01-09 21:05:42 +01:00