]> git.lyx.org Git - lyx.git/log
lyx.git
9 years agoQt5MacExtras is required on a Mac; report the version of Qt5
Stephan Witt [Sun, 24 Aug 2014 19:59:12 +0000 (21:59 +0200)]
Qt5MacExtras is required on a Mac; report the version of Qt5

9 years agoReintroduce some class definitions.
Stephan Witt [Sun, 24 Aug 2014 19:40:40 +0000 (21:40 +0200)]
Reintroduce some class definitions.

9 years agoRemove superfluous class definitions.
Stephan Witt [Sun, 24 Aug 2014 18:32:01 +0000 (20:32 +0200)]
Remove superfluous class definitions.

9 years agoRemove special GlobalMenuBar class. As Patrick De Visschere pointed out it is not...
Stephan Witt [Sun, 24 Aug 2014 18:29:52 +0000 (20:29 +0200)]
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.

9 years agoFSPathMakeRef is deprecated: use LSOpenFromURLSpec instead of LSOpenFromRefSpec
Stephan Witt [Sun, 24 Aug 2014 10:49:34 +0000 (12:49 +0200)]
FSPathMakeRef is deprecated: use LSOpenFromURLSpec instead of LSOpenFromRefSpec

9 years agoCorrect the method signature of MenuTranslator::translate for Qt5
Stephan Witt [Sat, 23 Aug 2014 14:01:03 +0000 (16:01 +0200)]
Correct the method signature of MenuTranslator::translate for Qt5

9 years agoCmake build: Use find_package(Qt5X11Extras ...) independent of OS
Kornel Benko [Sat, 23 Aug 2014 09:36:24 +0000 (11:36 +0200)]
Cmake build: Use find_package(Qt5X11Extras ...) independent of OS

We need to know, if Qt5 is built over X11 in order to test with
xvkbd, which manipulates XEvents.
Qt5X11Extras is independent of underlying OS.

9 years agoInsert menu accelerator 'x' now goes to box menu
Scott Kostyshak [Wed, 6 Aug 2014 07:36:31 +0000 (03:36 -0400)]
Insert menu accelerator 'x' now goes to box menu

Before, 'x' would go to "TeX Code" but that already has a shortcut
in the common bind files.

Reported and discussed on lyx-devel at:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg185082.html

9 years agoMake BiblioInfo::collectCitedEntries private (since it can be),
Richard Heck [Fri, 22 Aug 2014 15:17:36 +0000 (11:17 -0400)]
Make BiblioInfo::collectCitedEntries private (since it can be),
and fix a comment referring to it.

9 years agoUse QProxyStyle instead of QMacStyle. QMacStyle is not available anymore with At5...
Stephan Witt [Fri, 22 Aug 2014 09:17:34 +0000 (11:17 +0200)]
Use QProxyStyle instead of QMacStyle. QMacStyle is not available anymore with At5 and QProxyStyle is present since Qt4.6 as an alternative

9 years agoAdd check for the link for libmagic.dylib.
Stephan Witt [Fri, 22 Aug 2014 08:05:40 +0000 (10:05 +0200)]
Add check for the link for libmagic.dylib.

9 years agoRemove unused code.
Stephan Witt [Fri, 22 Aug 2014 08:04:53 +0000 (10:04 +0200)]
Remove unused code.

9 years agoImproved QtConfigureOptions (for Qt5.3).
Stephan Witt [Fri, 22 Aug 2014 07:58:32 +0000 (09:58 +0200)]
Improved QtConfigureOptions (for Qt5.3).

9 years agoRemove gettext framework support. Add libmagic framework support.
Stephan Witt [Fri, 22 Aug 2014 07:52:39 +0000 (09:52 +0200)]
Remove gettext framework support. Add libmagic framework support.

9 years agoAdd command line option to define the location of the self made utilities
Stephan Witt [Fri, 22 Aug 2014 06:39:14 +0000 (08:39 +0200)]
Add command line option to define the location of the self made utilities

9 years agoAdd QtMacExtras detection for Qt5 support
Stephan Witt [Thu, 21 Aug 2014 16:22:43 +0000 (18:22 +0200)]
Add QtMacExtras detection for Qt5 support

9 years agoAdd policy definitions to avoid warnings from cmake 3.0.0
Stephan Witt [Thu, 21 Aug 2014 16:03:37 +0000 (18:03 +0200)]
Add policy definitions to avoid warnings from cmake 3.0.0

9 years agofix coding style
Peter Kümmel [Sat, 16 Aug 2014 05:26:21 +0000 (07:26 +0200)]
fix coding style

(should have read ml first)

9 years agoignore Qt Creator's cmake file
Peter Kümmel [Sat, 16 Aug 2014 04:59:40 +0000 (06:59 +0200)]
ignore Qt Creator's cmake file

9 years agobuild test_Layout test
Peter Kümmel [Sat, 16 Aug 2014 04:55:32 +0000 (06:55 +0200)]
build test_Layout test

9 years ago* sk.po
Kornel Benko [Fri, 15 Aug 2014 15:11:12 +0000 (17:11 +0200)]
* sk.po

9 years agoPossible fix for the mystery crash, which is bug #9049.
Richard Heck [Thu, 7 Aug 2014 19:00:35 +0000 (15:00 -0400)]
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.

9 years agoUpdate comments.
Richard Heck [Tue, 12 Aug 2014 19:44:15 +0000 (15:44 -0400)]
Update comments.

9 years agoLittle bit of cleanup.
Richard Heck [Tue, 12 Aug 2014 17:13:47 +0000 (13:13 -0400)]
Little bit of cleanup.

9 years agoMake the constructor of the singleton class LayoutFileList private.
Richard Heck [Tue, 12 Aug 2014 16:49:17 +0000 (12:49 -0400)]
Make the constructor of the singleton class LayoutFileList private.

9 years agoUse a const ref here. Guess it was a thinko when I did it.
Richard Heck [Tue, 12 Aug 2014 16:32:01 +0000 (12:32 -0400)]
Use a const ref here. Guess it was a thinko when I did it.

9 years agoCmake build: Move use of QT5 libraries to the end of linker command line.
Kornel Benko [Mon, 11 Aug 2014 19:30:21 +0000 (21:30 +0200)]
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.

9 years agoCMake: add option to enable address sanitizer
Peter Kümmel [Sun, 10 Aug 2014 08:35:56 +0000 (10:35 +0200)]
CMake: add option to enable address sanitizer

9 years agoAdd some comments about the behavior of cellInset and cellIndex.
Richard Heck [Sat, 9 Aug 2014 17:13:10 +0000 (13:13 -0400)]
Add some comments about the behavior of cellInset and cellIndex.

9 years agoFix bug #9236: After we recreate the DocumentClass, we have to apply
Richard Heck [Wed, 6 Aug 2014 15:43:22 +0000 (11:43 -0400)]
Fix bug #9236: After we recreate the DocumentClass, we have to apply
it to the document.

9 years agoDo not allow copying a separator without a following par end.
Enrico Forestieri [Wed, 6 Aug 2014 00:21:18 +0000 (02:21 +0200)]
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).

9 years agoinstaller: update changelog
Uwe Stöhr [Mon, 4 Aug 2014 21:59:29 +0000 (23:59 +0200)]
installer: update changelog

9 years agoRevert "Clear empty selections in GuiView after dispatch"
Scott Kostyshak [Sun, 3 Aug 2014 22:37:45 +0000 (18:37 -0400)]
Revert "Clear empty selections in GuiView after dispatch"

This reverts commit fb05011ad0db2e2c5e557d91f398970d75cf8d15,
which lead to various menu-related crashes, such as when
going to Help > About.

9 years agoDo not break documents with complex beamer block ERT usage we cannot handle
Juergen Spitzmueller [Sun, 3 Aug 2014 10:21:35 +0000 (12:21 +0200)]
Do not break documents with complex beamer block ERT usage we cannot handle

Fixes: #9144
9 years agoFix bug with wrong baseline calculation in last paragraph
Juergen Spitzmueller [Sun, 3 Aug 2014 09:26:16 +0000 (11:26 +0200)]
Fix bug with wrong baseline calculation in last paragraph

Fixes: #9231
9 years agoImprove parsing of ERT arguments in beamer block titles.
Juergen Spitzmueller [Fri, 1 Aug 2014 07:42:43 +0000 (09:42 +0200)]
Improve parsing of ERT arguments in beamer block titles.

Fixes: #9225
9 years agoRevert "AGUTeX template/layout: support the new cls name"
Scott Kostyshak [Tue, 29 Jul 2014 19:46:16 +0000 (15:46 -0400)]
Revert "AGUTeX template/layout: support the new cls name"

This reverts commit cde8707 and changes "AGUTeX" back to "agutex".
The maintainer has changed "AGUTeX.cls" back to "agutex.cls" and has
confirmed (through private email) that he plans to keep the filename
all lowercase now that he is aware of case-sensitive file systems.

9 years agoUse enum instead of int in TextMetrics::getAlign
Jean-Marc Lasgouttes [Tue, 29 Jul 2014 09:05:14 +0000 (11:05 +0200)]
Use enum instead of int in TextMetrics::getAlign

This is just a code cleanup, no (intented) effect.

9 years agoMore tweaking of boundary setting at end of row
Jean-Marc [Mon, 28 Jul 2014 21:31:32 +0000 (23:31 +0200)]
More tweaking of boundary setting at end of row

9 years agoFix display of cursor at end of row
Jean-Marc [Mon, 28 Jul 2014 20:03:57 +0000 (22:03 +0200)]
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.

9 years agoRename FontSpan::inside(pos) to contains(pos)
Jean-Marc [Mon, 28 Jul 2014 18:41:01 +0000 (20:41 +0200)]
Rename FontSpan::inside(pos) to contains(pos)

9 years agoDisable branches insert menu if read only
Scott Kostyshak [Wed, 19 Feb 2014 21:58:31 +0000 (16:58 -0500)]
Disable branches insert menu if read only

9 years agoDisable custom insets insert menu if read only
Scott Kostyshak [Wed, 19 Feb 2014 21:58:29 +0000 (16:58 -0500)]
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.

9 years agoSubmenus now expand even if all items are disabled
Scott Kostyshak [Fri, 21 Feb 2014 15:26:36 +0000 (10:26 -0500)]
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

9 years agoClear empty selections in GuiView after dispatch
Scott Kostyshak [Wed, 25 Jun 2014 20:50:31 +0000 (16:50 -0400)]
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

9 years agoFix compilation warnings on windows.
Jean-Marc Lasgouttes [Mon, 28 Jul 2014 07:46:13 +0000 (09:46 +0200)]
Fix compilation warnings on windows.

9 years agoFix beamer block conversion when arguments are in multiple ERTS.
Juergen Spitzmueller [Sun, 27 Jul 2014 09:30:25 +0000 (11:30 +0200)]
Fix beamer block conversion when arguments are in multiple ERTS.

Fixes second part of #9208.

9 years agoAdd beamer-resenumerate (from our wiki) to the list of safe modules for argment conve...
Juergen Spitzmueller [Sun, 27 Jul 2014 08:23:17 +0000 (10:23 +0200)]
Add beamer-resenumerate (from our wiki) to the list of safe modules for argment conversion, since it is safe.

Fixes part of #9208.

9 years agoWhitespace
Jean-Marc Lasgouttes [Sat, 26 Jul 2014 14:29:23 +0000 (16:29 +0200)]
Whitespace

9 years agoWhitespace only
Jean-Marc Lasgouttes [Fri, 25 Jul 2014 20:35:08 +0000 (22:35 +0200)]
Whitespace only

9 years agoMake it compilable under cmake again after the merge from str-metrics
Kornel Benko [Fri, 25 Jul 2014 20:03:59 +0000 (22:03 +0200)]
Make it compilable under cmake again after the merge from str-metrics

9 years agoRename rowpainter.* to RowPainter.*
Jean-Marc Lasgouttes [Fri, 25 Jul 2014 19:55:08 +0000 (21:55 +0200)]
Rename rowpainter.* to RowPainter.*

This is the convention for files that define classes.

9 years agoMerge remote-tracking branch 'features/str-metrics'
Jean-Marc [Fri, 25 Jul 2014 18:10:55 +0000 (20:10 +0200)]
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.

9 years agoFix bad use of undo kind in Tabular inset.
Jean-Marc [Sat, 19 Jul 2014 22:50:24 +0000 (00:50 +0200)]
Fix bad use of undo kind in Tabular inset.

9 years agoremove branch documentation
Jean-Marc [Fri, 25 Jul 2014 18:01:04 +0000 (20:01 +0200)]
remove branch documentation

9 years agoFix logic error for spacing of RTL rows
Jean-Marc [Thu, 24 Jul 2014 22:10:10 +0000 (00:10 +0200)]
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.

9 years agoFix display of parenthesis in arabic
Jean-Marc [Mon, 21 Jul 2014 21:57:10 +0000 (23:57 +0200)]
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.

9 years agoBetter algorithm for forcing bidi drawing
Jean-Marc [Sun, 20 Jul 2014 22:19:50 +0000 (00:19 +0200)]
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.

9 years agoavoid qt4 variable names in cmake build
Kornel Benko [Mon, 21 Jul 2014 06:49:05 +0000 (08:49 +0200)]
avoid qt4 variable names in cmake build

9 years agoRevert optimization where several words are drawn at the same time
Jean-Marc Lasgouttes [Sun, 20 Jul 2014 16:54:31 +0000 (18:54 +0200)]
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.

9 years agoavoid qt4 variable names
Stephan Witt [Sun, 20 Jul 2014 16:16:36 +0000 (18:16 +0200)]
avoid qt4 variable names

9 years agoUpdate autotools for building with Qt5.
Enrico Forestieri [Sat, 19 Jul 2014 01:34:28 +0000 (03:34 +0200)]
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.

9 years agoFix build on FreeBSD.
Enrico Forestieri [Wed, 16 Jul 2014 20:25:49 +0000 (22:25 +0200)]
Fix build on FreeBSD.

Notified by Raphael Kubo da Costa.

9 years agodo not strip binary for packaging by default; improved name of disk image
Stephan Witt [Wed, 16 Jul 2014 20:25:25 +0000 (22:25 +0200)]
do not strip binary for packaging by default; improved name of disk image

9 years agoAdd forward search command for qpdfview.
Enrico Forestieri [Sun, 13 Jul 2014 18:08:43 +0000 (20:08 +0200)]
Add forward search command for qpdfview.

Also update docs explaining how to activate reverse search in qpdfview.

9 years agoAdd some postscript and pdf viewers for Unix and Windows.
Enrico Forestieri [Sun, 13 Jul 2014 17:59:31 +0000 (19:59 +0200)]
Add some postscript and pdf viewers for Unix and Windows.

For Windows: AcroRd32 and gsview (both 32 and 64 bit versions).
For Unix: qpdfview.

Qpdfview is a nice alternative to Okular for KDE users and a superior
alternative to Evince for Gnome users, due to its complete synctex
support. It only depends on Qt libraries for the graphical interface.

9 years agoUse getent instead of grepping /etc/passwd.
Enrico Forestieri [Sun, 13 Jul 2014 12:39:05 +0000 (14:39 +0200)]
Use getent instead of grepping /etc/passwd.

Forthcoming versions of cygwin will use a different mechanism for
obtaining passwd/group information based on /etc/nsswitch.conf.
Thus, it will not be guaranteed that the files /etc/passwd and
/etc/group even exist. The recommended way for obtaining those
info is by using the getent command, which already works in
current versions.

9 years agoRevert 6a5aa1ca
Enrico Forestieri [Sat, 12 Jul 2014 17:52:12 +0000 (19:52 +0200)]
Revert 6a5aa1ca

That commit is obsoleted by 5bd14af8.

9 years agoFix bug #9193: Spacing modification not exact
Enrico Forestieri [Sat, 12 Jul 2014 17:12:08 +0000 (19:12 +0200)]
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).

9 years agoFix compatibility issue with 64-bit cygwin.
Enrico Forestieri [Fri, 11 Jul 2014 14:49:10 +0000 (16:49 +0200)]
Fix compatibility issue with 64-bit cygwin.

9 years agoFix scale parameter for fonts.
Enrico Forestieri [Fri, 11 Jul 2014 14:12:08 +0000 (16:12 +0200)]
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).

9 years agoFix import of latex documents with scaled fonts.
Enrico Forestieri [Fri, 11 Jul 2014 09:21:45 +0000 (11:21 +0200)]
Fix import of latex documents with scaled fonts.

9 years agoFix make check.
Enrico Forestieri [Fri, 11 Jul 2014 09:14:02 +0000 (11:14 +0200)]
Fix make check.

9 years agoSupport new languages in tex2lyx
Georg Baum [Thu, 10 Jul 2014 20:15:34 +0000 (22:15 +0200)]
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".

9 years agoMissing file format bis from 0c3b88e3
Georg Baum [Thu, 10 Jul 2014 19:59:17 +0000 (21:59 +0200)]
Missing file format bis from 0c3b88e3

9 years agoGet rid of rtl_support preference
Jean-Marc Lasgouttes [Wed, 9 Jul 2014 18:12:06 +0000 (20:12 +0200)]
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.

10 years agoRemove LyXRC option force_paint_single_char
Jean-Marc Lasgouttes [Tue, 8 Jul 2014 21:12:09 +0000 (23:12 +0200)]
Remove LyXRC option force_paint_single_char

It was not honored anymore.

10 years agoMove some text from the readme file to relevant source files
Jean-Marc Lasgouttes [Mon, 30 Jun 2014 13:55:30 +0000 (15:55 +0200)]
Move some text from the readme file to relevant source files

10 years agoReintroduce the code related to InsetEnvSeparator
Jean-Marc Lasgouttes [Mon, 30 Jun 2014 09:45:24 +0000 (11:45 +0200)]
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 c668ebf6c85dbfea9 and 061509bf.

10 years agoRemove obsolete code to handle Hebrew and Arabic characters
Jean-Marc Lasgouttes [Fri, 13 Jun 2014 14:33:58 +0000 (16:33 +0200)]
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.

10 years agoDo not split words at selection boundary
Jean-Marc Lasgouttes [Fri, 23 May 2014 16:59:53 +0000 (18:59 +0200)]
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
10 years agoFix breaking of loooong word in RTL languages
Jean-Marc Lasgouttes [Mon, 19 May 2014 09:35:15 +0000 (11:35 +0200)]
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
10 years agoFix positionning of cursor
Jean-Marc Lasgouttes [Wed, 14 May 2014 15:46:43 +0000 (17:46 +0200)]
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.
10 years agoRemove support for LyXRC::force_paint_single_char
Jean-Marc Lasgouttes [Wed, 14 May 2014 13:36:44 +0000 (15:36 +0200)]
Remove support for LyXRC::force_paint_single_char

This workaround is not necessary anymore, and it complicates the code.

The variable itself will be removed after the landing of the branch on
master.

10 years agoUpdate description of what has been done in the branch.
Jean-Marc Lasgouttes [Mon, 12 May 2014 09:02:22 +0000 (11:02 +0200)]
Update description of what has been done in the branch.

10 years agoRemove debug code from TextMetrics
Jean-Marc Lasgouttes [Fri, 2 May 2014 13:55:10 +0000 (15:55 +0200)]
Remove debug code from TextMetrics

After this, it is possible to remove one parameter to getPosNearX.

10 years agoSpeed-up drawing when text is not justified.
Jean-Marc Lasgouttes [Fri, 2 May 2014 13:03:20 +0000 (15:03 +0200)]
Speed-up drawing when text is not justified.

Do not cut strings at separators in RowPainter when text is not
justified. This speeds-up painting by reducing the number of strings
to draw.

Do also a modest cleanup of paintChar (remove dubious optimization).

10 years agoImplement a better solution for painting of RTL text
Jean-Marc Lasgouttes [Wed, 30 Apr 2014 14:15:31 +0000 (16:15 +0200)]
Implement a better solution for painting of RTL text

Instead of relying on character range (Hebrew or Arabic) or character
direction, use RLO unicode character (Right-to-Left override) to force
painting in the direction indicated by the current font. This should
be as close as we can to the old LyX behavior (and requires less
code).

If this code works as intended, it will be possible to remove a lot of
code from Encodings.cpp.

10 years agoDraw right-to-left text string-wise using Qt
Jean-Marc Lasgouttes [Thu, 10 Apr 2014 14:37:21 +0000 (16:37 +0200)]
Draw right-to-left text string-wise using Qt

We rely on Qt built-in unicode support for handling Arabic and Hebrew
compose characters. This allows to avoid to use our homegrown
machinery.

This  should provide a nice speedup at a low cost and
will eventually allow us to get rid of:
 * most of our Arabic/Hebrew machinery in Encodings.cpp,
 * Paragraph::transformChar,
 * and probably more.

10 years agoFix various selection-related problems
Jean-Marc Lasgouttes [Fri, 21 Mar 2014 10:56:42 +0000 (11:56 +0100)]
Fix various selection-related problems

All these problems are related to what happens at the extreme points of rows

 * since VIRTUAL elements have a width but no contents, they have to
   be treated specially at some places. It would have been better to
   avoid testing for them explicitly, but I did not find a way.

 * Improve and cleanup the code in breakRow and fix in passing a crash
   when clicking on the right of an incomplete MARGIN_MANUAL
   paragraph.

 * improve the computation of row width in TextMetrics::computeRowMetrics.

 * handle properly the case where a position if not found on the row
   in both cursorX and getPosNearX (actually, this happens when
   selecting).

 * Some code cleanup and comments.

10 years agoFix bug #9040: In RtL documents end-of-paragraph marker shifts the row display
Jean-Marc Lasgouttes [Thu, 20 Mar 2014 10:00:14 +0000 (11:00 +0100)]
Fix bug #9040: In RtL documents end-of-paragraph marker shifts the row display

The fact that the bug was still present in the features/str-metrics
branch comes from a goof in the initial implementation of 'virtual'
row elements (completion and end-of-par markers). Now that this is
corrected, everything works as it should.

The fact that the bug is present in master is due to some other reason
that is not useful to investigate now.

10 years agoUpdate README and do a small code cleanup
Jean-Marc Lasgouttes [Mon, 3 Mar 2014 14:29:37 +0000 (15:29 +0100)]
Update README and do a small code cleanup

10 years agoChange getColumnNearX to getPosNearX
Jean-Marc Lasgouttes [Fri, 20 Dec 2013 13:02:31 +0000 (14:02 +0100)]
Change getColumnNearX to getPosNearX

The semantics was bad: the old implementation would return pos - row.pos(), and then all user of the function had to re-add row.pos().

10 years agoRemove unneeded swap() (thanks Jean-Marc)
Georg Baum [Mon, 7 Jul 2014 19:16:10 +0000 (21:16 +0200)]
Remove unneeded swap() (thanks Jean-Marc)

std::swap() does exactly the same thing, and avoiding code duplication is
always good.

10 years agoFix a bunch of small performance issues spotted by cppcheck
Jean-Marc [Sat, 5 Jul 2014 17:13:10 +0000 (19:13 +0200)]
Fix a bunch of small performance issues spotted by cppcheck

Most of these are about passing const strings parameters as references.

10 years agoFix possible bug spotted by cppcheck
Jean-Marc [Sat, 5 Jul 2014 17:12:09 +0000 (19:12 +0200)]
Fix possible bug spotted by cppcheck

I am not sure what this locking is really about, but the new code seems to be the right thing to do.

10 years agoFix typo spotted by cppcheck
Jean-Marc [Sat, 5 Jul 2014 16:01:19 +0000 (18:01 +0200)]
Fix typo spotted by cppcheck

10 years agoMark some singletons with FIXME THREAD
Georg Baum [Sat, 5 Jul 2014 13:20:54 +0000 (15:20 +0200)]
Mark some singletons with FIXME THREAD

10 years agoMake GraphicsConverter threadsafe
Georg Baum [Sat, 5 Jul 2014 13:11:24 +0000 (15:11 +0200)]
Make GraphicsConverter threadsafe

build_script() was already threadsafe, since it used a TempFile, and the
counter was basically not needed, but the new solution makes this obvious
and has the additional advantage that TempFile constructs the real output
file, not a dummy without extension which is not needed.

10 years agoFix uncodable author warning
Georg Baum [Sat, 5 Jul 2014 12:49:51 +0000 (14:49 +0200)]
Fix uncodable author warning

The old code was not threadsafe, and the restriction to one message box per
author name did not work if more than two authors were uncodable.