Commit Graph

162 Commits

Author SHA1 Message Date
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
4176795e72 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.
2014-07-08 21:30:05 +02:00
Jean-Marc Lasgouttes
7734270163 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).
2014-07-08 21:24:01 +02:00
Jean-Marc Lasgouttes
3013ce3716 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.
2014-07-08 21:24:00 +02:00
Jean-Marc Lasgouttes
ea1a5cb80e 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.
2014-07-08 21:24:00 +02:00
Jean-Marc Lasgouttes
059de2d04c Fix getColumnNearX for nested insets
The horizontal position of the inset was not taken in account.
The rounding is not always the same as with the old code, but this
is not really important.

Additional changes:

 * improve debug output of rows

 * remove Bidi& argument of the RowPainter constructor, since it is always
   an empty Bifi that is passed. This means that the Bidi class is not
   used at all any more in TextMetrics.cpp. The only remaining user is
   RowPainter.
2014-06-25 17:55:30 +02:00
Jean-Marc Lasgouttes
ff608f46fd Handle boundary in getColumnNearX (and more)
Use proper font everywhere for end-of-par marker

Fix getColumnNearX for RTL text and for centered/right-justified paragraphs.

Let computeRowMetrics update the row width.
2014-06-25 17:55:30 +02:00
Jean-Marc Lasgouttes
01c9bcb432 Get rid of ugly font metrics workarounds.
Now we have proper ligatures and kerning on screen...
2014-06-25 17:55:16 +02:00
Richard Heck
d79225ae98 Remove all messages to user related to assertions. We'll just use
a basic message which is defined in lassert.cpp now.
2013-04-27 17:52:55 -04:00
Richard Heck
1b1f8dd235 Audit all the LASSERT calls, and try to do something sensible at
each failure.

There are several places I was not sure what to do. These are marked
by comments beginning "LASSERT:" so they can be found easily. At the
moment, they are at:

Author.cpp:105: // LASSERT: What should we do here?
Author.cpp:121: // LASSERT: What should we do here?
Buffer.cpp:4525:        // LASSERT: Is it safe to continue here, or should we just return?
Cursor.cpp:345:         // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:403:         // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:1143:                // LASSERT: There have been several bugs around this code, that seem
CursorSlice.cpp:83:     // LASSERT: This should only ever be called from an InsetMath.
CursorSlice.cpp:92:     // LASSERT: This should only ever be called from an InsetMath.
LayoutFile.cpp:303:                     // LASSERT: Why would this fail?
Text.cpp:995:           // LASSERT: Is it safe to continue here?
2013-04-25 17:27:10 -04:00
Richard Heck
e7827264e7 Eliminate the hard-coded special handing of chapters. We'll use the
new Above LabelType instead.
2013-02-09 13:44:06 -05:00
Richard Heck
32b0e8cbdb Change LabelType Top_Environment to LabelType Above, and LabelType
Centered_Top_Environment to LabelType Centered.
2013-02-09 13:44:06 -05:00
Lars Gullik Bjønnes
6b2232a29c src/*.cpp: reformatting to increase consistency 2012-10-28 17:42:07 +01:00
Lars Gullik Bjønnes
43f6b1672b Use empty() to check empty and non-empty'ness not size()
Also add FormatList::empty().
2012-10-27 01:25:38 +02:00
Juergen Spitzmueller
0b5c20fc0f Fix direction of brackets in Hebrew when using Polyglossia (bug #8251) 2012-07-23 14:56:00 +02:00
Vincent van Ravesteijn
c671703f05 Fix bug #953: Paint text decorations for spaces 2012-05-02 18:02:52 +02:00
Vincent van Ravesteijn
af4e31ec28 Reset the (running) change in PainterInfo
When an InsetText is deleted, all lines in the inset are painted as
deleted. This status should be restored afterwards. If not, insets will be
painted in the wrong color afterwards (e.g. tables).
2012-04-29 14:56:19 +02:00
Abdelrazak Younes
47b28d4511 Code cleanup: split out RowPainter::paintFirst() in three and de-indent.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40087 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-30 09:16:30 +00:00
Vincent van Ravesteijn
6cb775b134 *rowpainter.cpp: Squeeze warnings.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37919 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-13 21:06:16 +00:00
Stephan Witt
f6e7fbefce #6920 paint single characters only when Qt4.7 or better, otherwise automatic kerning breaks cursor positioning
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37781 a592a061-630c-0410-9148-cb99ea01b6c8
2011-02-24 21:38:12 +00:00
Georg Baum
f176a18434 Fix bug #6919 by splitting Inset::noFontChange() into inheritFont() and
resetFontEdit(). The former is used for on-screen and export formatting,
and the latter is used for interactive editing.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37761 a592a061-630c-0410-9148-cb99ea01b6c8
2011-02-22 19:41:04 +00:00
Stephan Witt
9754d5e2cd #7120 use separate line thickness for solid and dotted lines to mark foreign, changed and misspelled text parts
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37735 a592a061-630c-0410-9148-cb99ea01b6c8
2011-02-20 07:50:28 +00:00
Stephan Witt
f361c26a05 suppress the misspelled marker only when typing in a word the first time
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37463 a592a061-630c-0410-9148-cb99ea01b6c8
2011-02-03 17:27:13 +00:00
Stephan Witt
5eed97b56b restore the correct behavior of suppression of misspelled marker for word at cursor position - the change r37340 broke it
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37363 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-29 12:28:02 +00:00
Stephan Witt
29d849f251 more careful check for mathed to normal text change and vice versa for correct display of misspelled markers
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37020 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-28 13:20:20 +00:00
Stephan Witt
fab1507221 fix for #7081: the painting of misspelled marker is suppressed for the word at cursor position
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36990 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-22 07:29:16 +00:00
Enrico Forestieri
4e8cc18554 Fix bug #7193 (Math macro template painting problem)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36987 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-22 00:16:51 +00:00
Enrico Forestieri
cf85f9ce69 Fix bugs #7165 (Auto-complete does not disappear after using it)
and      #7174 (Math selection broken)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36902 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-16 08:14:27 +00:00
Stephan Witt
ad76c66e33 #7120 the painter expects a float as line_thickness_, simplify initial computation of line_thickness_ and line_offset_
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36890 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-15 07:12:42 +00:00
Stephan Witt
48b071d983 #7120 adjust the line thickness to mark changes, foreign language and misspelled text to zoom factor in user preferences
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36869 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-13 16:18:37 +00:00
Vincent van Ravesteijn
1f76d67c66 Fix bug #7164: Text in tables not painted immediately.
Fixes the regression introduces in r36630. I already fixed this, but forgot to commit apparently.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36848 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-12 20:56:01 +00:00
Pavel Sanda
5f08562026 Removal of this color was forgotten.
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg163890.html


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36724 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-04 22:41:50 +00:00
Vincent van Ravesteijn
bbbd0d6597 *rowpainter.cpp: Squeeze some warnings and reduce linelength.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36683 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-03 15:40:23 +00:00
Stephan Witt
31c546bdff #6920 correct the ugly workaround - now it is ugly as well but works
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36633 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-30 15:48:43 +00:00
Vincent van Ravesteijn
de7964e501 Fix bug #4889: Painting problem with some insets. RowPainter::paintOnlyInsets is only meant to paint nested Insets, so I guess only the InsetText based insets.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36630 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-30 15:10:31 +00:00
Jean-Marc Lasgouttes
14d57ba19e experiment in spell checker mark appearance (see bug #7112)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36629 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-30 14:36:51 +00:00
Vincent van Ravesteijn
51c5b13db1 Make the color of the misspelled marking customizable.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36612 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-30 00:37:09 +00:00
Vincent van Ravesteijn
2b44b0ef4d Move TextMetrics::drawRowSelection to RowPainter::paintSelection(). RowPainter knows about a possible offset in the y-coordinate, while drawSelection uses the cached value. Instead of adding another parameter to TextMetrics::drawRowSelection, we can as weel move it to RowPainter and lose all parameters at all.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36485 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-25 13:16:30 +00:00
Vincent van Ravesteijn
3c5b30a8ea Disentangle InsetTabular::drawSelection and InsetTabular::drawBackground().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36484 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-25 13:08:26 +00:00
Pavel Sanda
3ffbab3bca typo
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36432 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-22 11:44:36 +00:00
Abdelrazak Younes
da3d4e681b Fix previous commit: previous_char was not updated at all!
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36431 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-22 09:06:36 +00:00
Abdelrazak Younes
90ac66e7d1 Work around bug #6920. This disables ligatures with involving 'f'
character.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36430 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-22 08:57:33 +00:00
Abdelrazak Younes
55f761b6ae whitescape
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36429 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-22 08:35:12 +00:00
Vincent van Ravesteijn
824780b8a9 Rowpainter.cpp: Squeeze warning.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35643 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-13 20:18:16 +00:00
Stephan Witt
f9956c2d36 shift misspelled line slightly lower when inside running change
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35557 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-04 16:26:12 +00:00
Uwe Stöhr
85a40507e4 rowpainter.cpp: remove hack introduced in r35299
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35440 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-18 17:29:37 +00:00
Abdelrazak Younes
bfd5447fdd Thicker misspelled underlining.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35438 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-18 15:33:02 +00:00
Stephan Witt
dec437fbac add cache of spell checker results to speed up native speller engine on macosx
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35362 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-14 05:24:04 +00:00
Uwe Stöhr
2582cc24ab rowpainter.cpp: revert a hack
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35342 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-11 16:16:59 +00:00
Uwe Stöhr
0e7ab29f49 InsetLine: support for the LaTeX command \rule; kick out the hardcoded \lyxline; fileformat change
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35299 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-07 00:41:00 +00:00