Commit Graph

33907 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
cb0dbfdadb Avoid crash when inserting space in the middle of misspelled character
This is a fixup to commit 4796e6b3.
2015-07-15 20:38:07 +02:00
Günter Milde
605b933ec2 Add "TODO-comments" with link to textcyr/textgreek tickets.
Add links to tickets #9637 and  #9681 at places that require 
changes in the code and/or comments.
2015-07-15 18:55:30 +02:00
Jean-Marc Lasgouttes
7ac700920f Auto feature for minibuffer toolbar
Now the minibuffer toolbar is "auto" by default. It is opened by
command-execute (M-x) and closed when the command is executed without error.

* make lyx::dispatch return a DispatchResult struct

* there is a new MINIBUFFER type of toolbar, that can be used for this use.

* remove special handling of M-x in minnibuffer; Escape can be used instead. Fix focus in this case.

* when minibuffer toolbar is "auto", make the toolbar close itself after
  - a command has been executed without error
  - an empty command has been executed
  - the Escape key has been used

[this is actually commit fdcff02a, which was later reverted at dd61d8cf]
2015-07-15 17:41:09 +02:00
Jean-Marc Lasgouttes
4796e6b337 Avoid breaking kerning with continuous spell checking
There is a mismatch between the way text is tokenized in Row objects
and the way it is shown on screen. When metrics are computed,
continuous spell checking has not been done yet. Yet, the row painter
explicitly breaks words at spell status boundaries. This creates
problem with a text like "PMP," (see bug #9649), where there is a
negative kerning before the comma.

This is solved by not taking in account spell status when drawing
text, and drawing spell underlines separately.

* replace Paragraph::isSameSpellRange with new method getSpellRange.

* merge RowPainter::paintChars into RowPainter::paintFromPos

* move the actual text painting code into the new paintTextAndSel.

* merge some code from paintFromPos to paintMisspelledMark

* in paintMisspelledMark, scan the string which needs to be annotated
  and add dashed line below text marked as misspelled.

Fixes bug #9649.
2015-07-15 12:13:24 +02:00
Jean-Marc Lasgouttes
1136bc4fb2 Convert a few more variables to int
This avoids warnings with windows compiler. It is a pity that even
clang does not give those. Maybe I missed them with the large amount
of boost warnings that it spits.
2015-07-15 10:16:42 +02:00
Jean-Marc Lasgouttes
a05b8be4bf Always use unicode override characters to enforce direction
There is a second solution in the code which uses some undocumented Qt
stuff, but it does not work in some cases. The best is to rely on the
documented way.
2015-07-14 23:19:26 +02:00
Jean-Marc Lasgouttes
8f73d1e56b Fix comment. 2015-07-14 18:03:58 +02:00
Jean-Marc Lasgouttes
463bd17d75 Use integer line thickness in painter
There is no need for real-valued line width in painters. Actually, this even leads to uneven dashes for continuous spell checker.

The new code is supposed to be equivalent to the old one, just more readable. From this, we can try to see whether some lines need to be made thicker on HiDPI screens.
2015-07-14 17:42:45 +02:00
Günter Milde
468cedb923 Fix #9679 textcyr fails without fontenc 2015-07-14 14:47:44 +02:00
Uwe Stöhr
44527cceed installer/include/filelist.nsh: add the QtSvg library 2015-07-13 21:29:48 +02:00
Jean-Marc
e471e6cd49 Do not forget QtSvg when using pkgconfig in autoconf 2015-07-12 19:12:51 +02:00
Kornel Benko
789e7f7ed9 Cmake tests: Add missing definition for check_Length_SOURCES
This was forgotten in previous commit ccbac353ea
2015-07-12 18:59:24 +02:00
Georg Baum
ccbac353ea Fix Length::inBP()
Length::inBP() returned the wrong values for most units. I guess that this was
caused by the default case in the switch statement: It did probably exist
before the other units were added.
inBP() is now correct for all units except the font dependent ones em, ex and
mu and the percent units: For these only approximate values are returned,
since not all needed information is available.
2015-07-12 18:36:19 +02:00
Georg Baum
7910502b8e Add unit test for the Length class
I noticed that inBP() is wrong for several units and want to fix it.
The unit test will help me to find regressions.
2015-07-12 18:10:43 +02:00
Günter Milde
3f6b034167 Fix Ticket #9607 (support comma below accent in unicodesymbols).
LaTeXFeatures defines \textcommabelow and \textcommaabove based on a 
generic \LyXTextAccent and declares TextCompositeCommands for the Baltic 
letters in the T1 font encoding, using \textcommaabove for the small letter g 
and \textcommabelow else.

This allows overwriting of the composite definition for other font encodings. 
Especially, it does not interfere with the polish/baltic font encoding L7x 
(supported by LatinModern and TeXGyre fonts)  that provides pre-composed 
glyphs.
2015-07-12 16:21:25 +02:00
Günter Milde
476a073c61 Greek subsript letters require "textgreek" flag.
Add the "textgreek" feature to entries for greek subscript letters
in "unicodesymbols".
2015-07-11 18:18:28 +02:00
Günter Milde
5a47e4bc70 Fix #9636 textgreek: restore compatibility with lgrenc.def.
Greek characters with perispomeni (tilde) accent were not properly shown
in the output document, because the "textgreek" feature re-defined \~ in
a way incompatible with lgrenc.def since version 0.8  (2013-05-13)
(package greek-fontenc).

The compatibility-definition is required for older versions of the font setup
(before the move of "lgrenc.def" from "babel" to "greek-fontenc").
It is now done with "ProvideTextCommand" to not overwrite the more complete
implementation in lgrenc.def.
With the compatibility definition, combined diacritics with tilde
must be input with the tilde first (e.g. \~>, not \>~).
"unicodesymbols" is changed accordingly.

Also, some LICRs for combining Greek diacritical characters were added to
Unicodesymbols.
2015-07-11 15:39:02 +02:00
Scott Kostyshak
27ce44df4f FontEncoding format is "utf8" instead of "utf-8"
Otherwise LyX does not recognized the encoding.

This is a follow-up of commit f7518565.
2015-07-10 20:20:46 -04:00
Günter Milde
f7518565b6 Apply #9652: fixes for the lib/language file.
Add font encodings auto-set by babel.

Set font encoding for georgian to the babel default.

Remove InternalEncoding from languages that use a font encoding
compatible to T1.

Change (LaTeX input) encoding for Serbian (cyrillic) and Romanian.

See #9652 for details.
2015-07-09 18:43:19 +02:00
Jean-Marc Lasgouttes
7d018853fc Position better the cursor after math-display
When the cursor had idx > 0 (since math-display does merging anyways),
reset cursor to the start of the inset. This looks less strange than
setting it at the end.

Now at least the basic case of a displayed equation with cursor
somewhere at top-level is handled correctly.

The math-display lfun operates at top level in the math inset.
Therefore, when the cursor is in an inner inset, it will after the
lfun be moved at top level. Unfortunately, there is no way that I know
f to detect this in Inset::doDispatch.

Even if we could, as things stand, it is difficult to keep the cursor in the
inner inset, especially if the inner inset moves : this happens for
example when moving from eqnarray to inline maths.

Therefore this fix is the best I can think of now.

Fixes part of bug #9664.
2015-07-09 12:00:25 +02:00
Günter Milde
2a7deb802a Remove "notermination" flags from combining characters in "unicodesymbols".
This fixes bug #9615.

The "notermination" flag tells LyX, that terminating an LICR macro with {} is 
not necessary. This is normally the case for all macros with non-alphabetical
name (e.g. \{).

However, combining diacritical characters are converted to *accent macros*,
which expect an argument (the base character). 
In Unicode, the base character precedes the combining character, 
in LaTeX the combining character precedes the base character. 
LyX changes the order of the two characters to get this right,
e.g. "x" + "combining tilde" becomes "\~{x}". 

In the special case there is no preceding character (e.g. at the start of the 
document or a paragraph), Unicode shows the combining diacritical character
without base character.
The replacement is currently not "terminated" (e.g. "\~"), because of the 
"notermination=text" flags in "unicodesymbols". 
The accent macros take the *following* character as base character, which is
clearly not intended.
In case of a paragraph consisting of just one combining diacritical character,
LaTeX compilation fails with an error.

With the patch, LyX writes the accent macros with an empty argument,
e.g.  "\~{}", the output is similar to the view in the GUI with the diacritical 
character on its own, not on the follwoing character.
2015-07-09 11:54:37 +02:00
Stephan Witt
301e003db0 Don't touch @rpath based frameworks with install_name_tool 2015-07-08 18:02:21 +02:00
Stephan Witt
0f802fde90 Qt5.5 cannot be build in parallel anymore
Automatic symlink creation for Qt frameworks
2015-07-08 18:01:05 +02:00
Stephan Witt
789ab61442 Qt 5.5.x introduced a new framework dependency: QtDBus 2015-07-08 17:58:07 +02:00
Stephan Witt
6e9bd23a1f Add paths of private frameworks to linker rpath options 2015-07-08 17:56:26 +02:00
Jean-Marc Lasgouttes
f41e423b30 Small clean-up to debug support 2015-07-08 11:03:42 +02:00
Scott Kostyshak
36b9b9737e Use font 'Scheherazade' in tests of Arabic docs
We do not currently have any Arabic documents, but when we do, these
fonts will be used for the tests that use system fonts.

They can be installed on Debian-type systems from the
'fonts-sil-scheherazade' package.
2015-07-07 06:54:12 -04:00
Enrico Forestieri
b7dd5ade94 Remove unneeded header
Forgot this at 4dff1394
2015-07-06 23:47:22 +02:00
Günter Milde
c56f0538a0 Fix clash between marvosym and bbding packages (fixes #7811).
Both marvosym and bbding define the "Cross" macro.
To prevent a compilation error due to conflicting definitions, 
we undefine the "Cross" macro if both packages are required.
2015-07-06 14:10:34 +02:00
Pavel Sanda
b3f97f0b8a Upate layouttranslations for he.po. 2015-07-05 15:26:52 -07:00
Pavel Sanda
a3ac58e4f8 Remerge he.po 2015-07-05 14:45:50 -07:00
Enrico Forestieri
4dff1394ab Avoid calling Buffer::getMacro inside the MathMacro copy constructor
It turns out that it is always better using the copy of the MacroData
for updating the macro_ pointer to avoid problems related to the cursor
position.
2015-07-05 20:44:54 +02:00
Enrico Forestieri
2ea3e07a23 Fix a couple of issues with filename encodings.
* Take into account the filesystem encoding for the zip export on *nix
  such that the representation of filenames in the zip archive is not
  mangled, when possible. This only concerns the way filenames are displayed
  as their creation in the filesystem was nevertheless correct.

* On Windows, try to obtain the command line parameters from the wide char
  representation by directly accessing the platform APIs through ctypes.
  This allows to also deal with filenames not exactly representable using
  the current code page and corrects a bug resulting in silently dropping
  those kind of filenames.
2015-07-05 15:45:40 +02:00
Guy Rutenberg
ca0ba7c6ad lyxpak: Fix the common path prefix calculation.
The old implementation could fail in some rare cases.
2015-07-05 13:33:14 +02:00
Stephan Witt
8a772549d7 Fix for #9659 - Qt may send more then one close event to a window. Therefore multiple calls to unregisterView for a GuiView are possible. The first one removes the view from the list of known views, subsequent calls do nothing. 2015-07-04 18:59:29 +02:00
Uwe Stöhr
4b027dd4ea ar.po: update from Hatim 2015-07-04 14:23:17 +02:00
Scott Kostyshak
0d52736061 Remove an incorrect horizontal size policy
This effectively makes the horizontal size policy "minimum", which
makes it clear that there is no advantage for this widget of
increasing the horizontal size past the minimum, allowing other
GUI elements to use the horizontal space if useful.

This change for caseCB is consistent with wordsCB and searchbackCB.
2015-07-02 10:33:38 -04:00
Enrico Forestieri
2072de8349 Avoid code duplication 2015-06-30 19:27:38 +02:00
Enrico Forestieri
305a712bbb Avoid using a dangling pointer
This can happen when a macro is copied and then the document where
it is defined is closed. In this case, the macro survives in the
cut stack but the the buffer pointer is dangling.
2015-06-30 18:54:19 +02:00
Jean-Marc Lasgouttes
dd61d8cf3f Revert "Auto feature for minibuffer toolbar"
This reverts commit fdcff02a31.

This was pushed too early, we are not ready yet.
2015-06-30 11:09:48 +02:00
Jean-Marc Lasgouttes
c8c1ee72bc Constify RowPainter (no intended change) 2015-06-29 16:12:11 +02:00
Jean-Marc Lasgouttes
fdcff02a31 Auto feature for minibuffer toolbar
Now the minibuffer toolbar is "auto" by default. It is opened by
command-execute (M-x) and closed when the command is executed without error.

* make lyx::dispatch return a DispatchResult struct

* there is a new MINIBUFFER type of toolbar, that can be used for this use.

* remove special handling of M-x in minnibuffer; Escape can be used instead. Fix focus in this case.

* when minibuffer toolbar is "auto", make the toolbar close itself after
  - a command has been executed without error
  - an empty command has been executed
  - the Escape key has been used
2015-06-29 09:21:15 +02:00
Georg Baum
8a27143e72 Test negative numbers as well 2015-06-28 11:27:17 +02:00
Georg Baum
b8eb4fffee Make it explicit that we need floating point abs
The 'using namespace std' at the top of the file makes it quite difficult to
understand which abs is used: double std::abs<double>(double) or
int ::abs(int)? Now it is explicit, and the code does not change in subtle
ways if somebody removes the using statement.
2015-06-28 11:27:17 +02:00
Scott Kostyshak
6c3a6ea9bd Give Advanced Find a minimum size
The horizontal size policy is now set to "MinimumExpanding", which
means that sizeHint() is enforced as a minimum, but that the widget
can make use of extra available space.

Before, the size policy was ignored, and often resulted in a
scrunched pane that had to have its size manually increased.
2015-06-28 05:16:49 -04:00
Scott Kostyshak
8f1b7f47fa FindAndReplaceUi: update format 2015-06-28 05:16:14 -04:00
Enrico Forestieri
9b0e5215d9 Was forgetting this 2015-06-26 22:54:23 +02:00
Enrico Forestieri
67c52ae773 Amend c9d9309c
It suffices taking the log of the absolute value.
2015-06-26 22:49:17 +02:00
Juergen Spitzmueller
c9d9309c1e Fix formatFPnumber with negative doubles. 2015-06-26 15:49:44 +02:00
Juergen Spitzmueller
2a8db0a64b HSpace/VSpace: use a _signed_ length validator in the dialogs. 2015-06-26 13:19:12 +02:00