Commit Graph

22004 Commits

Author SHA1 Message Date
Stephan Witt
8829eeed04 #9130 Text in main work area isn't rendered with high resolution
Assign the pixel_ratio of graphics params to the Qt pixmap of the image.
2014-10-18 15:46:17 +02:00
Stephan Witt
f9bff2d9b1 #9130 Text in main work area isn't rendered with high resolution
Add display_pixel_ratio to buffer params to use it for displays with high resolution.
It holds the highest ratio between physical pixels and device-independent pixels of the LyX application.
Preview snippets will be generated using this value to get high resolution preview.
2014-10-18 15:39:58 +02:00
Stephan Witt
82904d4603 #9130 Text in main work area isn't rendered with high resolution
Add pixel_ratio to graphics params to use it for displays with high resolution.
It holds the ratio between physical pixels and device-independent pixels of the graphics.
2014-10-18 15:26:49 +02:00
Stephan Witt
e7163a0999 #9130 Text in main work area isn't rendered with high resolution
Add search mode check_hidpi to ease the lookup for images with double size to use for displays with high resolution.
2014-10-18 15:19:47 +02:00
Stephan Witt
9135dcee07 #9130 Text in main work area isn't rendered with high resolution
Introduce the concept of pixel ratio: the ratio of physical and device independent pixels.
This is useful for rendering of content on Retina-displays of Mac hardware with high resolution.
Qt has real support for this starting with Qt5 - therefore it has to be compiled conditionally.
This change uses some work of Marcelo Galvão Póvoa, thank you.
2014-10-18 11:53:16 +02:00
Richard Heck
2ca21d2c15 Update comment. 2014-10-16 16:50:03 -04:00
Richard Heck
080a4d84e2 Fix bug #9296. The key may be multiple keys. 2014-10-16 16:31:03 -04:00
Jean-Marc Lasgouttes
f58d9f27a2 Erase correctly math multi-cell selection
What a selection spans several cells in mathed, and a deletion occurs though LFUN_CHAR_DELETE_FORWARD for example, only the case of a proper grid was handled. When no such grid exists, all cells between the first and the last index are cleared now.
2014-10-16 16:16:15 +02:00
Jean-Marc Lasgouttes
ac018bd8db Fix ticket #9224: text overflows through adjacent insets
The logic of Row::shortenIfNeeded is completely changed to look at the row from the start and not the end. This leads to clearer code.
2014-10-16 14:53:54 +02:00
Scott Kostyshak
5636906aee No space after inline math for text export (#9282)
This extra space was the result of the fix for #6094
(at 7e624928).
2014-10-15 19:21:18 -04:00
Scott Kostyshak
3b96c6e901 Remove line in text export of inline math (#9282)
If there is only one row, a new line should not be appended. If
there is more than one row, the new line should not be appended for
the last row.

For example, if in LyX there was "as you can see in $x$ there..." a
copy/paste would lead to a newline after "x".
2014-10-15 19:18:46 -04:00
Alfredo Braunstein
8f821dba70 Rewrite of change-related helpers
lyxfind.cpp(findNextChange, findPreviousChange, findChange, selectChange): factor the change-selection part out of the change-finding part
Text.cpp (acceptOrRejectChanges): call only selectChange
2014-10-14 17:40:44 +02:00
Alfredo Braunstein
b2246c4ea2 insets/InsetTabular.cpp (doDispatch): fix to #9291. The problem was simply that the default status for the cursor in the call to *::doDispatch is "dispatched".
insets/InsetTabular.cpp (edit): do not reset the selection
2014-10-14 12:04:19 +02:00
Jean-Marc
82ab83080f Whitespace only 2014-10-13 22:44:30 +02:00
Alfredo Braunstein
866fc2afcc mathed/InsetMathHull.cpp (InsetMathHull::doDispatch): do not declare LFUN_FINISHED_* lfuns as undispatched after handling them
Fixes #9289, and an unreported cousin of #3900
2014-10-12 11:07:28 +02:00
Alfredo Braunstein
25cf12d650 Text2.cpp (checkAndActivateInset, checkAndActivateInsetVisual): activate insets on selection if the anchor is inside the inset.
insets/InsetText.cpp (InsetText::edit): do not reset the selection
Fixes #2346.
2014-10-12 10:07:18 +02:00
Alfredo Braunstein
ec269c2000 Whitespace 2014-10-11 23:28:15 +02:00
Stephan Witt
68d217df49 Mac menu bar init has to be repeated for Qt5 after clearing the menu 2014-10-11 12:39:08 +02:00
Jean-Marc Lasgouttes
8ecb96c09a Add the git commit (if applicable) to LyX version
This only works for autotools right now, but adding that to cmake is trivial
2014-10-10 12:12:17 +02:00
Jean-Marc Lasgouttes
d605048b5c Fix ticket #9276: Labeling cursor off by several characters
The length of STRING row elements is not updated until finalizeLast() is called.
2014-10-09 22:09:33 +02:00
Juergen Spitzmueller
db2044dc14 Fix key code 2014-10-08 10:57:58 +02:00
Stephan Witt
ce57594afd Remove Qt4 artifacts in comments 2014-10-01 10:06:17 +02:00
Uwe Stöhr
96ca121fc9 LaTeXFeatures.cpp: fix bug #9266
mhchem loads amsmath and needs therefore be loaded after it but before packages that redefine commands of amsmath. We already take care of esint but not of wasysym
2014-09-10 22:01:29 +02:00
Kornel Benko
5a6020ea15 Update file formats of test files 2014-09-04 12:14:47 +02:00
Kornel Benko
90717df577 Cmake tex2lyx tests: Take care of initialized userdir
If we are testing tex2lyx the first time, then the userdir
is empty. We call now configure.py to initalize in case it is needed.
The algorithm to detect if reconfigure is needed mimics the lyx behaviour.
2014-09-03 21:21:05 +02:00
Stephan Witt
bf581924c9 Fix possibly uninitialized use of variables 2014-09-03 00:07:26 +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
Kornel Benko
08fa62396b Add some missing files to autoconf's dist 2014-08-31 15:23:28 +02:00
Kornel Benko
6c7b5b12c7 Add cmake files to autoconf's dist 2014-08-31 15:21:20 +02:00
Juergen Spitzmueller
87eb430395 Add support for todonotes package
Fixes: #7546
2014-08-31 14:49:30 +02:00
Juergen Spitzmueller
ccdd782b4f Add support for the fixme package.
Fixes: #8868
2014-08-31 14:38:28 +02:00
Juergen Spitzmueller
9a702f195d Add support for beamer lemma environment.
File fomat change.
2014-08-31 12:30:14 +02:00
Enrico Forestieri
90b6920083 Fix export of xfig external insets (bug #9244).
The check for a latex format is very fragile. Both libmagic and our
guessing from contents cannot distinguish the pstex and pdftex formats
used by the xfig external inset. Moreover, it may also happen that
lyx files are mistaken as latex ones. Thus, when the guessed format
is latex, the only solution is to give precedence to the format
determined by the file extension.
2014-08-29 10:42:16 +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
Peter Kümmel
ada262a78b print callstack on assert 2014-08-27 19:48:42 +02:00
Stephan Witt
0d6f17afe2 More careful NSAutoreleasePool management 2014-08-26 08:22:12 +02:00
Stephan Witt
3aa428fdea #9245 replace Q_WS_MACX with Q_OS_MAC - the Q_OS_MAC macro is usable with Qt4 and Qt5. 2014-08-25 20:08:59 +02:00
Enrico Forestieri
4521fc757b Replace Q_WS_WIN with appropriate guards to account for Qt5.
This commit replaces almost all occurrences of Q_WS_WIN to comply
with Qt5. The remaining occurrences should *not* be replaced,
because the guarded code won't compile on Qt5.
2014-08-25 19:27:45 +02:00
Enrico Forestieri
565260126e Fix the -geometry command line argument for Windows.
The command line argument -geometry WIDTHxHEIGHT±XOFF±YOFF
specifies a preferred size and location for the main window.
Currently, this is semi-broken on Windows. Indeed, only
specifying WIDTH and HEIGHT places the main window such that
the left and top borders are invisible such that the window cannot
be moved. Moreover, the XOFF and YOFF parts (when present) are
used to specify the distance of the window from the left and top
or right and bottom edges of the screen, when using '+' or '-',
respectively. However, -geometry 800x600-20-20, instead of placing
the window such that its bottom and right edges are at a distance
of 20 pixels from the corresponding screen edges, places the
window such that its left and top borders are out of the screen.
This is corrected by this commit, which also addresses the fact
that Qt5 does not define Q_WS_WIN anymore.
2014-08-25 18:35:15 +02:00
Richard Heck
a5c4ccfd26 Add a debugging message. 2014-08-25 11:14:27 -04:00
Uwe Stöhr
94a9c127e3 support for the LaTeX commands \x***arrow
- this patch supports the \x***arrow commands provided by the mathtool package
- fileformat change
2014-08-25 00:44:09 +02:00
Stephan Witt
5af8238700 Reintroduce some class definitions. 2014-08-24 21:40:40 +02:00
Stephan Witt
3218d32ace Remove superfluous class definitions. 2014-08-24 20:32:01 +02:00
Stephan Witt
f73091228c Remove special GlobalMenuBar class. As Patrick De Visschere pointed out it is not needed. The shortcut handling of Qt does it internally now what GlobalMenuBar was made for. 2014-08-24 20:29:52 +02:00
Stephan Witt
fad67d64ac FSPathMakeRef is deprecated: use LSOpenFromURLSpec instead of LSOpenFromRefSpec 2014-08-24 12:49:34 +02:00
Stephan Witt
6cbaad9398 Correct the method signature of MenuTranslator::translate for Qt5 2014-08-23 16:01:03 +02:00
Richard Heck
6490cdafbe Make BiblioInfo::collectCitedEntries private (since it can be),
and fix a comment referring to it.
2014-08-22 11:18:10 -04:00
Stephan Witt
d1bfad86e5 Use QProxyStyle instead of QMacStyle. QMacStyle is not available anymore with At5 and QProxyStyle is present since Qt4.6 as an alternative 2014-08-22 11:17:34 +02:00
Peter Kümmel
6407d45a69 fix coding style
(should have read ml first)
2014-08-16 07:27:00 +02:00
Peter Kümmel
39911dfe2b build test_Layout test 2014-08-16 06:55:32 +02:00
Richard Heck
54c2ab2732 Possible fix for the mystery crash, which is bug #9049.
Investigation of bug #9236 showed that crash to be due to a Paragraph's
holding a dangling pointer to an old and deleted Layout after the
DocumentClass was reset. Since the backtraces look almost identical, it
seems likely that we have the same problem here.

Since this crash seems almost always to involve tables, I looked at the
code in switchBetweenClasses() and found that the Paragraphs that belong
to "hidden" table cells are not seen by the initial recursion using a
ParIterator: It skips right over them. This was confirmed by test code
suggested by Enrico, with results reported in Trac.

The present patch attempts to deal with this problem in the second
recursion, over Insets. When we see an InsetTabular, we call a new
routine that recurses through the cells, looking for hidden ones. If it
finds a hidden one, it then resets the Layout for the cell's Paragraphs
(there should be only one, but we do not make any assumptions) to the
PlainLayout that belongs to the new DocumentClass. This is good enough,
since such cells never have content.

There is extensive discussion of the patch here:
  https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg185095.html
Additional testing by Enrico and me confirmed the existence of the
dangling pointer.
2014-08-15 10:44:37 -04:00
Richard Heck
88ce7bd5d4 Update comments. 2014-08-12 15:44:15 -04:00
Richard Heck
96d75db418 Little bit of cleanup. 2014-08-12 13:13:47 -04:00
Richard Heck
dd0f71e5fe Make the constructor of the singleton class LayoutFileList private. 2014-08-12 12:49:17 -04: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
Kornel Benko
49efd1933a Cmake build: Move use of QT5 libraries to the end of linker command line.
To prevent the linker error if they were before some object file referencing
some symbol there.
2014-08-11 21:30:21 +02:00
Richard Heck
3a78422782 Add some comments about the behavior of cellInset and cellIndex. 2014-08-09 13:13:10 -04:00
Richard Heck
c2fdbbe01a Fix bug #9236: After we recreate the DocumentClass, we have to apply
it to the document.
2014-08-07 15:13:31 -04:00
Enrico Forestieri
39492b0cd7 Do not allow copying a separator without a following par end.
This makes virtually impossible copying a separator inset whithout
also copying the end of paragraph. These insets are not supposed to
be directly inserted by users. For example, the parbreak version
represents a LaTeX paragraph break, not a LyX one. So, if it is
possible to copy and paste it by alone, an unsespecting user may be
surprised to see a paragraph break in the output but not on the LyX
screen (because of the lack of indentation, for example).
In this way, it also becomes a LyX par break from a user point of
view, not any more useful than simply introducing a par break by
hitting <return> (except in those cases where it makes a difference,
in which case they are automatically inserted by LyX).
2014-08-06 02:21:18 +02:00
Scott Kostyshak
453ce61191 Revert "Clear empty selections in GuiView after dispatch"
This reverts commit fb05011ad0,
which lead to various menu-related crashes, such as when
going to Help > About.
2014-08-03 19:20:56 -04:00
Juergen Spitzmueller
b555f31a34 Fix bug with wrong baseline calculation in last paragraph
Fixes: #9231
2014-08-03 11:26:16 +02:00
Jean-Marc Lasgouttes
37fd7b24ba Use enum instead of int in TextMetrics::getAlign
This is just a code cleanup, no (intented) effect.
2014-07-29 11:05:14 +02:00
Jean-Marc
f29e78039d More tweaking of boundary setting at end of row 2014-07-28 23:31:32 +02:00
Jean-Marc
46ee67995d Fix display of cursor at end of row
The particular case here is:
* the last element of the row is an inset
* the row is broken by a display inset.
2014-07-28 22:03:57 +02:00
Jean-Marc
fca332bace Rename FontSpan::inside(pos) to contains(pos) 2014-07-28 20:42:01 +02:00
Scott Kostyshak
4843618655 Disable branches insert menu if read only 2014-07-28 12:59:35 -04:00
Scott Kostyshak
0bf61a48c0 Disable custom insets insert menu if read only
Before, if a document was read only and had no custom insets
defined, the submenu would be enabled.
2014-07-28 12:59:34 -04:00
Scott Kostyshak
d449e7e64e Submenus now expand even if all items are disabled
As stated in the Apple HIG[1] (via JMarc):

  Ensure that a submenu’s title is undimmed even when all its commands
  are unavailable. As with menu titles, it’s important for users to be
  able to view a submenu’s contents, even if none of them are
  available in the current context.

[1]
https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/AppleHIGuidelines/Menus/Menus.html#//apple_ref/doc/uid/TP30000356-TP6
2014-07-28 12:59:34 -04:00
Scott Kostyshak
fb05011ad0 Clear empty selections in GuiView after dispatch
Empty selections can cause confusing behavior for a few reasons:

(1) some functions behave differently depending on whether there is a
selection. If I press delete, nothing happens (where I expect the
character or inset before the cusor to be deleted). If I toggle bold or
emphasize nothing happens (where if there is no selection the entire
word is toggled). There are other LyX functions that depend on whether
there is a selection or not. Further, I wonder if any part of LyX's code
assumes that if there is a selection it is non-empty.

(2) menu options are incorrectly set. For example, the scissors icon.

For remaining empty selection issues, see #9222.

For more information, see:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg184758.html
2014-07-28 10:37:08 -04:00
Jean-Marc Lasgouttes
f9caebd29f Fix compilation warnings on windows. 2014-07-28 09:46:13 +02:00
Jean-Marc Lasgouttes
7f7dc5d314 Whitespace 2014-07-26 16:29:23 +02:00
Jean-Marc Lasgouttes
5e126d2920 Whitespace only 2014-07-25 22:36:20 +02:00
Kornel Benko
5acc6b3791 Make it compilable under cmake again after the merge from str-metrics 2014-07-25 22:03:59 +02:00
Jean-Marc Lasgouttes
b54deb3683 Rename rowpainter.* to RowPainter.*
This is the convention for files that define classes.
2014-07-25 21:55:08 +02:00
Jean-Marc
41740ea915 Merge remote-tracking branch 'features/str-metrics'
This branch implements string-wise metrics computation. The goal is to
have both good metrics computation (and font with proper kerning and
ligatures) and better performance than what we have with
force_paint_single_char. Moreover there has been some code
factorization in TextMetrics, where the same row-breaking algorithm
was basically implemented 3 times.

Globally, the new code is a bit shorter than the existing one, and it
is much cleaner.  There is still a lot of potential for code removal,
especially in the RowPainter, which should be rewritten to use the new
Row information.

The bugs fixed and caused by this branch are tracked at ticket #9003:
http://www.lyx.org/trac/ticket/9003

What is done:

* Make TextMetrics methods operate on Row objects: breakRow and
  setRowHeight instead of rowBreakPoint and rowHeight.

* Change breakRow operation to operate at strings level to compute
  metrics The list of elements is stored in the row object in visual
  ordering, not logical. This will eventually allow to get rid of the
  Bidi class.

* rename getColumnNearX to getPosNearX (and change code accordingly).
  It does not make sense to return a position relative to the start of
  row, since nobody needs this.

* Re-implement cursorX and getPosNearX using row elements.

* Get rid of lyxrc.force_paint_single_char. This was a workaround that
  is not necessary anymore.

* Implement proper string metrics computation (with cache). Remove
  useless workarounds which disable kerning and ligatures.

* Draw also RtL text string-wise. This speeds-up drawing.

* Do not cut strings at selection boundary in RowPainter. This avoids
  ligature/kerning breaking in latin text, and bad rendering problems
  in Arabic.

* Remove homebrew Arabic and Hebrew support from Encoding.cpp. We now
  rely on Qt to do handle complex scripts.

* Get rid of LyXRC::rtl_support, which does not have a real use case.

* Fix display of [] and {} delimiters in Arabic scripts.
2014-07-25 20:10:55 +02:00
Jean-Marc
1fefbf5bdc Fix bad use of undo kind in Tabular inset. 2014-07-25 20:03:42 +02:00
Jean-Marc
6ee39ff90a Fix logic error for spacing of RTL rows
The code referred to vpos (the visible position) instead of pos, the logical one.
This can lead to using the wrong font when computing spaces width.
2014-07-25 19:59:37 +02:00
Jean-Marc
3599285019 Fix display of parenthesis in arabic
Actually the workaround that is used to show parenthesis in the right direction
is not needed any more, since this is part of the unicode bidi writing algorithm.

This fixes at the same time the use of [] or  as delimiters in arabic, which was wrong on screen.

Note that there is a problem with hebrew, but this will require a fileformat change.
2014-07-25 19:59:37 +02:00
Jean-Marc
f4fc035cf6 Better algorithm for forcing bidi drawing
The use of RLO/LRO overrides to force text orientation was really hackish and the way it was done caused dropped letters in Mac OS X (for some unknown reasons).

This new approach is much cleaner, except that it relies on features not advertised in documentation
but present at least from Qt 4.5 to Qt 5.3:
* TextFlag enum values TextForceLeftToRight and TextForceRightToLeft, which are strong versions
  of QPainter::setLayoutDirection; they are passed as a parameter of QPainter::drawText.

* QTextLayout::setFlags method, which is required to pass the above flags to QTextLayout.

The unicode override method is still used to draw strings Mac OS X because, for some reason, the direction was not really enforced in this case.
2014-07-25 19:56:51 +02:00
Kornel Benko
63976066ad avoid qt4 variable names in cmake build 2014-07-21 08:49:05 +02:00
Jean-Marc Lasgouttes
bbe6e9f593 Revert optimization where several words are drawn at the same time
This can only be done where splitting of string is identical in row breaking and display. It will be possible to reintroduce this when row painting uses the tokenized row information.
2014-07-20 18:54:31 +02:00
Enrico Forestieri
4bdeae2733 Update autotools for building with Qt5.
The option --enable-qt5 allows configuring for Qt5. The default is Qt4.
Nothing special is done with respect to Qt4, apart from pulling in the
correct libraries. Indeed, other than the core and gui libraries, now
also the concurrent and widgets libraries are needed.
2014-07-19 03:34:28 +02:00
Enrico Forestieri
4342411297 Fix build on FreeBSD.
Notified by Raphael Kubo da Costa.
2014-07-16 22:28:46 +02:00
Enrico Forestieri
294d08b1bf Add forward search command for qpdfview.
Also update docs explaining how to activate reverse search in qpdfview.
2014-07-13 20:08:43 +02:00
Enrico Forestieri
2af17f8f89 Revert 6a5aa1ca
That commit is obsoleted by 5bd14af8.
2014-07-12 19:52:12 +02:00
Enrico Forestieri
5bd14af887 Fix bug #9193: Spacing modification not exact
The conversion from floating point to string performed by
boost:lexical_cast does not allow specifying a precision and,
for example, values such as 0.9 are resturned as 0.899999976.
The standard C++ way for performing the conversion is using
std::ostringstream which is exempt from this problem, even if
less efficient. For the sake of accuracy, boost::lexical_cast
is ditched in favor of the ostrinsgstream implementation.
In C++11 another option would be using std::to_string, but I
think it is not as efficient as the boost way and not worth
implementing through #ifdef's.
Incidentally, this patch would have also fixed #9190 and all
similar cases involving the use of convert<string>(float|double).
2014-07-12 19:12:08 +02:00
Enrico Forestieri
b3735501c7 Fix compatibility issue with 64-bit cygwin. 2014-07-11 16:49:10 +02:00
Enrico Forestieri
6a5aa1cab1 Fix scale parameter for fonts.
When a font is scaled by a certain percentage in the document settings,
LyX was outputting a ridiculous parameter value. For example, if the
font is scaled 90%, the corresponding parameter was "scaled=0.899999976".
The patch avoids this and, in the previous case, one gets "scaled=0.9".
This is not only cosmetic, because in roundtrip conversions the parameter
would be continuosly changing.

This commit and b60b505f should be backported to the 2.1.x branch, where
reimporting with tex2lyx an exported document produces wrong results
(also in version 2.1.0).
2014-07-11 16:12:08 +02:00
Enrico Forestieri
b60b505fd8 Fix import of latex documents with scaled fonts. 2014-07-11 11:21:45 +02:00
Enrico Forestieri
60a1b3b83c Fix make check. 2014-07-11 11:14:02 +02:00
Georg Baum
98fc5e518f Support new languages in tex2lyx
I forgot that this was part of the file format update as well.
Also fix a mixup of "english" and "uppersorbian".
2014-07-10 22:15:34 +02:00
Georg Baum
1a073ea416 Missing file format bis from 0c3b88e3 2014-07-10 21:59:17 +02:00
Jean-Marc Lasgouttes
45eb314a86 Get rid of rtl_support preference
This variable was introduced to guard against any bad consequence of the then-new right-to-left
languages support. Let's be bold and get rid of it altogether!

Now right to left support is always enabled.
2014-07-09 21:11:08 +02:00
Jean-Marc Lasgouttes
9d5c947110 Remove LyXRC option force_paint_single_char
It was not honored anymore.
2014-07-08 23:12:09 +02:00
Jean-Marc Lasgouttes
4bd5a7e883 Move some text from the readme file to relevant source files 2014-07-08 21:30:06 +02:00
Jean-Marc Lasgouttes
f3924a52b3 Reintroduce the code related to InsetEnvSeparator
This commits (tries to) reintroduce properly the code that was reverted at the beginning of this branch. This had to be done because these patches interefered with the big refactoring of TextMetrics.cpp.

This commit reintroduces the changes to TextMetrics.cpp contained in c668ebf6, c85dbfea9 and 061509bf.
2014-07-08 21:30:06 +02:00
Jean-Marc Lasgouttes
d6337a2488 Remove obsolete code to handle Hebrew and Arabic characters
This is handled by Qt now.

Note that a small optimization (do not draw text that is to the left
of WorkArea) is removed because it cannot be guaranteed to be exact
anymore. It was probably not very useful anyway, and would become
useless once the RowPainter is rewritten to use Row information.

Update 00README_STR_METRICS_BRANCH.
2014-07-08 21:30:06 +02:00
Jean-Marc Lasgouttes
ec42b2e4c9 Do not split words at selection boundary
The display of partially-selected word is now done in a new Painter::text method
which displays the string twice with different clip settings. This allows to
catter for the case where Color_selectiontext is not black.

Morover, the code that uses unicode override characters to force the
direction of a string is moved to lstrings.h.

Fixes: #9116
2014-07-08 21:30:06 +02:00
Jean-Marc Lasgouttes
e1c4cb7146 Fix breaking of loooong word in RTL languages
Moreover, breaks row at insets when there is no suitable separator.

Also make the code of Row::shorten_if_needed somewhat simpler by using
iterators and factoring the code.

Fixes: #9120
2014-07-08 21:30:05 +02:00
Jean-Marc Lasgouttes
2ff639a0e6 Fix positionning of cursor
The old implementation of Row::Element::pos2x and x2pos did not work
correctly with Arabic text, because characters can have shapes that
depend on context.

This new implementation leverages QTextLayout in a simplified way,
since only one word is added to the layout.

This allows to make Row::Element::x2pos more readable.

Fixes: #9115.
2014-07-08 21:30:05 +02:00