Commit Graph

330 Commits

Author SHA1 Message Date
Richard Heck
8b57600a1c Fix warnings. 2014-10-27 10:42:03 -04:00
Jean-Marc Lasgouttes
2737f82139 Fix bug #9288: Cannot position cursor near the end of a line.
The problem was that some parts of the code assume that the right margin is part of the width of the row. This is not the case, only the left margin (Row::x) is counted.

The code has been fixed and documented to reflect this.
2014-10-19 15:38:38 +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
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
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 Lasgouttes
f9caebd29f Fix compilation warnings on windows. 2014-07-28 09:46:13 +02:00
Jean-Marc Lasgouttes
8fb1aa51f8 Whitespace only 2014-07-25 22:40:48 +02:00
Jean-Marc Lasgouttes
5e126d2920 Whitespace only 2014-07-25 22:36:20 +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 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
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
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
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
b0543270a9 Remove debug code from TextMetrics
After this, it is possible to remove one parameter to getPosNearX.
2014-07-08 21:29:52 +02:00
Jean-Marc Lasgouttes
b8170e0e01 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.
2014-07-08 21:23:59 +02:00
Jean-Marc Lasgouttes
1a4b3201e7 Update README and do a small code cleanup 2014-07-08 21:23:58 +02:00
Jean-Marc Lasgouttes
f686375eec 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().
2014-07-08 21:10:47 +02:00
Jean-Marc Lasgouttes
79014c7551 More fixes to cursorX
In Row::Element::pos2x, handle the boundaries in a cleaner way.
2014-06-25 17:55:30 +02:00
Jean-Marc Lasgouttes
8649ac7fe6 Some fixes related to RTL text
* fix handling of boundary situations in Row::Elements::x2pos;

 * fix handling of boundary situations in TextMetrics::getColumnNearX;

 * make sure to always use Font::isVisibleRightToLeft instead of Font::isRightToLeft;

 * Improve debug messages.
2014-06-25 17:55:30 +02:00
Jean-Marc Lasgouttes
443a453427 New reverseRTL implementation
The old version was a bit complicated and wrong for RtL paragraphs
containing LtR text. THe new one is clearer.
2014-06-25 17:55:30 +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
6258cebb77 Fix line breaking algorithm
Break words longer than the screen width. The code is more complicated
than I would like, but I have no better idea right now.

Implement properly the notion of a row broken by a display inset. This is useful in different places.

Also fix a bug with last line of a paragraph spotted by Kornel.
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
f215bb3b92 Re-implement getColumNearX using row elements
The code is now so much shorter that it is scary... Expect that
further changes will be necessary

Cursor boundary is not handled yet.
2014-06-25 17:55:30 +02:00
Jean-Marc Lasgouttes
35d47698c6 Convert cursorX() and computeRowMetrics() to the new scheme
* convert cursorX to new scheme; old computation is still there for the sake of comparison.

* use Row to compute separator width in computeRowMetrics; again, the old code is retained for now.

* Get rid of rowWidth()
2014-06-25 17:54:27 +02:00
Jean-Marc Lasgouttes
d32f76f7fe Small Inset isXXX methods cleanup
* rename isStretchableSpace to isHfill
 * inline a trivial method
 * remove InsetIPAMacro::isLineSeparator, which has the same value as default.
2014-06-25 17:54:26 +02:00
Jean-Marc Lasgouttes
b2eba66083 Implement proper handling of RtL in Rows
Now the row elements are sorted according to RtL/LtR.

Some additional cleanup.
2014-06-25 17:54:26 +02:00
Jean-Marc Lasgouttes
452fb60359 Store in the Row object the list of elements it contains
* Row now contains a vector of Elements
* replace Row::dump by a proper << operator
* the width is updated as elements are added
* breakRow is reimplmented to use this infrastructure
2014-06-25 17:54:26 +02:00
Jean-Marc Lasgouttes
cf31077932 Change TextMetrics::rowHeight to setRowHeight
This new function takes a row as parameter.

Also, add direct access to Row::dim_
2014-06-25 17:53:34 +02:00
Jean-Marc Lasgouttes
fe8c3b4348 Cleanup TextMetrics::rowBreakPoint.
Collect properly all strings to compute string metrics

Some changes with respect to existing code
 - end of paragraph font is now the one of the text
 - words longer than a line are not broken anymore. I think this is not useful  if we have horizontal scrollbar

Other than that, the code is still compatible with rowWidth and friends.
2014-06-25 17:53:34 +02:00
Jean-Marc Lasgouttes
edcedf3324 Revert temporarily changes related to InsetSeparator
This is to avoid many conflicts with the str-metrics branch.
2014-06-25 17:53:09 +02:00
Enrico Forestieri
061509bf75 Avoid an assertion.
Do not assert if an inset separator is the only item of a List
environment. Although it is a weird thing to do, both GUI and
latex output can deal with it.
2014-05-28 20:50:45 +02:00
Jean-Marc Lasgouttes
0212ef5426 Make TextMetrics::editXY more robust
This fixes a crash in examples/fa/splash.lyx when selecting text
representing menu entries. This happens because menu names are in LTR
English, while the inset itself is in RTL.

The problem is that the current code relies on the fact that
 1. getColumnNearX and checkInsetHit share the same idea about cursor
    position.
 2. pos and pos + 1 are in general consecutive on screen.

It seems that 1. is wrong here (for reasons I did not try to
understand); the second assumption is definitely false with
bi-directional text. This makes editXY very fragile.

The new code should be more robust in this respect. The logic is:
 * if checkInsetHit finds an inset, use its position,
 * otherwise, ask getColumnNearX for the cursor position.

Fixes: #9142
2014-05-28 14:22:21 +02:00
Enrico Forestieri
c85dbfea98 Fix indentation of paragraphs after an environment.
When deciding whether a paragraph should be indented or not, LyX
only takes into account default layouts. This is wrong, because
an environment could be nested into another one and thus a following
paragraph would not be "default". With this patch all paragraphs
after an environment are correctly indented, independently of
whether their layouts are "default" or not.
The latex output (which was modeled following the previous wrong
assumption) is also correspondingly adapted.
2014-05-28 01:07:47 +02:00
Enrico Forestieri
a596736d76 Fix another glitch with on-screen indentation.
If a new paragraph is created just before a nested environment,
the indentation of the nested environment is not computed
correctly because the parindent of the previous layout would
also be erroneously taken into account. This would cause the
nested environment to move back and forth when something is
added to the new paragraph.
2014-05-22 23:58:23 +02:00
Enrico Forestieri
a17710e499 Fix wrong indentation on screen.
LyX fails to indent on screen a standard paragraph when it is
nested into an environment. The fix is a one-liner but the diff
is larger because it also fixes a previous wrong indentantion
in the source ;)
2014-05-21 21:47:01 +02:00
Enrico Forestieri
95787a0a4c Fix an on-screen representation glitch.
If a layout has NextNoIndent set to true, the following paragraph
is not indented on screen. LyX checks the previous layout for that
style parameter to decide whether to indent or not. Of course,
what matters is the latex output and the on-screen representation
should match this output. Now, when a layout has NextNoIndent==true,
the latex output is correctly not indented, while the on-screen
representation may fail to match this output. This can occur when,
for example, a standard paragraph is nested in the previous layout,
because LyX would check the property of the nested layout instead
of the container layout. Thus, LyX should check the property of a
previous layout at the same depth for correctly deciding whether
a paragraph has to be indented or not.
See also http://www.lyx.org/trac/ticket/9055#comment:12 for an
example document where the previous scenario actually occurs.
2014-05-16 15:31:43 +02:00
Enrico Forestieri
c668ebf611 Fix bugs #8546 and #9055, and introduce new separator inset.
The algorithm used for breaking a paragraph in LaTeX export is changed
for avoiding spurious blank lines causing too much vertical space.
This change is tied to the introduction of a new inset (with two
different specializations) helping in either outputing LaTeX paragraph
breaks or separating environments in LyX. Both of the above goals were
previously achieved by the ---Separator--- layout and can now be
accomplished by the new inset in a more natural way. As an example,
after leaving an environment by hitting the Return key for two times,
a third return automatically inserts a parbreak inset, which is
equivalent to the old separator layout, i.e., it also introduces a
blank line in the output. If this blank line is not wanted, the
parbreak separator can be changed to a plain separator by a right
click of the mouse. Of course, an environment can still be separated
by the following one by using the Alt+P+Return shortcut (or the
corresponding menu key), but now the plain separator inset is used
instead of the old separator layout, such that no blank line occurs in
the LaTeX output.

Old documents are converted such that the LaTeX output remains unchanged.
As a result of this conversion, the old separator layout is replaced by
the new parbreak inset, which may also appear in places where the old
algorithm was introducing blank lines while the new one is not.
Note that not all blank lines were actually affecting the LaTeX output,
because a blank line is simply ignored by the TeX engine when it occurs
in the so called "vertical mode" (e.g., after an alignment environment).
The old ---Separator--- layout is now gone and old layout files using it
are also automatically converted.

Round trip conversions between old and new format should leave a document
unchanged. This means that the new behavior about paragraph breaking is
not "carried back" to the old format. Indeed, this would need introducing
special LaTeX commands in ERT that would accumulate in roundtrip
conversions, horribly cluttering the document. So, when converting a
modified document to old formats, the LaTeX output may slightly differ in
vertical spacing if the document is processed by an old version of LyX.
In other words, forward compatibility is guaranteed, but not backwards.
2014-05-10 23:25:11 +02:00
Richard Heck
065db68067 Fix a bunch of minor issues discovered by the cppcheck script. 2014-04-21 11:52:00 -04:00
Jean-Marc Lasgouttes
a8c05f20be Whitespace only. 2014-03-14 14:22:26 +01:00
Jean-Marc Lasgouttes
bab58480bc Do not skip space at start of row (fixes #8947, #8838)
TextMetrics::getColumnNearX (x -> pos translation) has special code to
ignore spaces at the beginning of a row, but neither the display code
nor TextMetrics::cursorX (pos->x translation) follow this logic. One
might argue that spaces should actually be ignored (like LaTeX does),
but this leads to UI issues and is probably too difficult to
implement.
2014-01-28 11:04:31 +01:00
Jean-Marc Lasgouttes
f7b0ecb64e Remove obsolete comment
It is not possible to make editXY const because of checkInsetHit, getPitNearY and getPitandRowNearY that modify the TextMetrics object.
2013-12-20 14:14:32 +01:00
Vincent van Ravesteijn
88eae06611 Fix FontIterator to not access pos >= par.size()
An iterator is typicall incremented passed the valid data into the 'end'
state. However, if this means that other functions are called with invalid
parameter, we should fix this.

This explains why fontSpan was called with pos==size() while this was not
expected to happen.

This patch reverts partly f5ad0c128a (Jean-Marc Lasgouttes; Get rid of
annoying warning message).
2013-04-28 19:12: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
f6fceea317 Const. 2013-04-11 15:56:41 -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
Jean-Marc Lasgouttes
c999e35e54 Make sure that undo is recorded when magic tricks are played with InsetBibitem.
Fixes bug #7111: Assertion with undo and InsetBibitem

  * add Paragraph::brokenBiblio(), with tells whether there is something to fix.
  * rename Paragraph::checkBiblio to fixBiblio; simplify it greatly by using
    InsetList methods
  * In TextMetrics::redoParagraph, call recordUndo before fixBiblio (only when
    there is something to fix obviously)

Special care is taken to update cursor only when it makes sense. Note
that there are cases where undo information is not recorded (current
cursor not in the slice where action happens)
2012-07-18 15:36:58 +02:00
Jean-Marc Lasgouttes
a756403301 "Performance" fixes suggested by cppcheck
While cppcheck did not turn out any suspicious error messages, using
the "performance" flag highlighted several nitpicks in three categories
 * do not use it++ for iterators, ++it is better
 * do not use size() to test for emptyness, empty() is here
 * do not use "const T" as a function parameter, "const & T" is better

I doubt that any of these is a real performance problem, but the code is cleaner anyway.
2012-05-28 22:42:44 +02:00
Lars Gullik Bjønnes
fb3ecca01c TextMetrics.cpp: comment out addressBreakPoint function
Only user of this function is code that has been commented out, comment
out this function as well.

Signed-off-by: Lars Gullik Bjønnes <larsbj@gullik.org>
2012-05-20 11:08:20 +02:00
Vincent van Ravesteijn
6df750aa18 TextMetrics::leftMargin(): Explain why the disabled code is wrong 2012-05-10 10:46:35 +02:00
Vincent van Ravesteijn
92ac678715 Fix bug #8152: Uneditable long rows for 'Right addresses'
As long as leftMargin() is not correctly implemented for
MARGIN_RIGHT_ADDRESS_BOX, we should also not do this here. Otherwise, long
rows will be painted off the screen and will not be editable.
2012-05-10 10:46:32 +02:00
Vincent van Ravesteijn
225bcf92df Indicate that this rtl variable is only valid on the last row
Otherwise the variable might be used incorrectly as in [0a137e31/lyxgit].
2012-04-29 22:49:30 +02:00
Vincent van Ravesteijn
d7f68078cf Fix bug #7518: Assert when selecting in RTL text
If we are in rtl text, we *need* to check whether the first character is a
space. We can't use the rtl variable for this because this is only
computed on the last row.

This bug was introduced in [0a137e31/lyxgit] to fix the computation for
freespacing paragraphs. We better can just check whether the paragraph is
freespacing or not.
2012-04-29 22:47:06 +02:00
Richard Heck
5a7672adec Fix bug #5805 and similar requests. Adds a document setting that
tells LyX not to show BLOCK text as justified, but still keeps
the usual paragraph indentation.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40427 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-07 22:33:25 +00:00
Richard Heck
88cdfb0d42 Fix bugs #7110 and #7160 by reverting r36521.
This was an attempt to fix #2743 without re-working the InsetBibitem
mess. It didn't work, so we have to do that.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38702 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-11 12:44:39 +00:00
Richard Heck
5f1d31bf16 Just whitespace and a comment.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38485 a592a061-630c-0410-9148-cb99ea01b6c8
2011-04-25 01:46:37 +00:00
Abdelrazak Younes
8d06c1ebda TextMetrics::editXY(): don't continue executing code when asserting.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37915 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-13 16:38:36 +00:00
Abdelrazak Younes
076151f508 Trying to fix #7321: add some assertions.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37914 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-13 16:26:57 +00:00
Jean-Marc Lasgouttes
53e8746b47 In the case of non-null paragraph separation, replace the hardcoded test for ERT and LISTINGS insets by proper check for newLineIsParBreak.
This fixes the display of sweave Chunks in sweave.lyx example, which uses parskip instead of indent.

The rest of the changes are just white space


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37881 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-08 14:41:01 +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
Richard Heck
13126b8060 Fix bug #6302: Allow setting of on-screen paragraph indentation when
alignment is LEFT.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37642 a592a061-630c-0410-9148-cb99ea01b6c8
2011-02-14 00:58:44 +00:00
Vincent van Ravesteijn
8e6e9d3782 Add comment.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37621 a592a061-630c-0410-9148-cb99ea01b6c8
2011-02-13 09:49:50 +00:00
Richard Heck
c981018111 Fix bug #2743.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36521 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-26 17:30:45 +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
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
Jean-Marc Lasgouttes
402b9ec199 Revert r35339 for now following Enrico criticisms. I'll come back to it later.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35356 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-13 13:16:49 +00:00
Jean-Marc Lasgouttes
2a7a076f1a Make lines more compact (less interline spacing).
If there are use cases where this is useful, we can
think of a better way to reintroduce this.

Comments welcome.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35339 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-10 10:46:14 +00:00
Uwe Stöhr
7d68833dc9 remove unused include of FuncRequest
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35189 a592a061-630c-0410-9148-cb99ea01b6c8
2010-08-24 03:07:09 +00:00
Richard Heck
5577e877bb Try to move all updateBuffer() calls to a central location. We now use
DispatchResult to store a flag that tells us whether we need a buffer
update or not. 

So: If you find a missing one, go to an appropriate place in the
dispatch and call cur.forceBufferUpdate() or, if you don't have a cursor
but do have a DispatchResult, call dr.forceBufferUpdate().

There is one remaining call I could not move, in
TextMetrics::redoParagraph. But this looks like an emergency call when
the macro context has not been set. There are also a couple calls that
are connected with buffer creation that I commented out, since the same
call is done again almost immediately. But I'm not positive about those.

Now the nice thing would be to do the same for updateMacros().


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34826 a592a061-630c-0410-9148-cb99ea01b6c8
2010-07-09 14:37:00 +00:00
Jürgen Spitzmüller
0a137e315a * TextMetrics.cpp: fix metrics calculation with preceeding blank in free spacing context (bug #6746)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34705 a592a061-630c-0410-9148-cb99ea01b6c8
2010-06-25 14:07:55 +00:00
Vincent van Ravesteijn
863e1eb35b * TextMetrics.cpp: Line length.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34372 a592a061-630c-0410-9148-cb99ea01b6c8
2010-05-05 16:23:11 +00:00
Vincent van Ravesteijn
63d24ca3c4 Remove boundary parameter from BufferView::getPos(). The first DocIterator parameter already contains this information.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34247 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-21 13:03:04 +00:00
Vincent van Ravesteijn
d8db0e8515 Rename anchor() to normalAnchor() as the anchor() function was already returning a normalized anchor in stead of the real one.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34145 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-15 17:49:15 +00:00
Richard Heck
bd3f2308b4 Style, I guess.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33876 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-26 17:00:07 +00:00
Richard Heck
25df3fa83d Defer calculations we may not have to do.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33802 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-19 15:07:52 +00:00
Richard Heck
32faa2a273 Simplify a bit, after last commit.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33798 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-19 01:46:13 +00:00
Richard Heck
4d0d67872e Fix at least the most immediate manifestation of bug #6454.
Investigation of this bug revealed that we are blinking the cursor even
when it is not visible. This should also be reverted. It may, in a way,
be that bug that caused this one, but this check is worth doing anyway.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33797 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-19 01:43:53 +00:00
Vincent van Ravesteijn
ff7526a3ed No camelBump style for local variables.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33719 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-11 19:50:04 +00:00
Vincent van Ravesteijn
c5f556e43a Remove unused function.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33718 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-11 19:48:49 +00:00
Richard Heck
d65020b293 s/updateLabels/updateBuffer/g, per a suggestion of Abdel's.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33613 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-03 22:13:45 +00:00
Jürgen Spitzmüller
425d092204 * fix spelling in comments to please John.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33262 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-29 14:44:21 +00:00
Vincent van Ravesteijn
99a9d3dd69 Simplify code.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32413 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-07 19:06:15 +00:00
Vincent van Ravesteijn
5b7a7cca73 Fix bug #6113: Customized font color in footnote is not rendered in LyX.
It seems we realized the font in the wrong order. If the layout font specifies "Font Size Small", we should be able to make it large if we want to.

see:
http://thread.gmane.org/gmane.editors.lyx.devel/122682

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32129 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-21 15:33:41 +00:00
Vincent van Ravesteijn
3852f3298f * TextMetrics.cpp: cosmetics.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32117 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-21 01:15:12 +00:00
Vincent van Ravesteijn
08feb0e14c Fix bug #6161: Wrong cursor position in bidi text.
If the first character is a separator, we are in RTL text. This character will not be painted on screen and thus we should not count it and skip to the next.

This bug pretty much destroyed cursor placement in RTL text on a row with large gaps.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32116 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-20 22:28:51 +00:00
Vincent van Ravesteijn
3581c31d1b Allow PgUp and PgDwn to put the cursor on the first or last row.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32036 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-15 23:53:40 +00:00
Vincent van Ravesteijn
a9ae2abb7e Fix bug #6327: Crash in new file and press PgUp button.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32035 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-15 23:45:39 +00:00
Abdelrazak Younes
ff4460603e Make Buffer argument mandatory in most of the InsetMath based class... boring work...
Math manual loads and save correctly it seems but expect some instability period.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31898 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-08 11:45:46 +00:00
Vincent van Ravesteijn
d833a023f6 Add a FIXME to a piece of unreachable code. This dates back to r8251.
see http://www.lyx.org/trac/changeset/8251.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31858 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-04 15:30:35 +00:00
Vincent van Ravesteijn
e666039283 Only paint the paragraph end markers when a new paragraph follows. Otherwise, charstyle insets, for example, also get a paragraph end marker although they are just part of the paragraph.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31168 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-20 18:30:06 +00:00
Vincent van Ravesteijn
6ee19b2a54 Fix bug #6129: Show paragraph marks / pilcrows.
To be activated in Tools->Preferences->Display.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31155 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-19 22:46:43 +00:00
Vincent van Ravesteijn
41c1dcdc27 Fix the painting of the last character of a paragraph. That is either the added/deleted paragraph breaks in change tracking or the to-be introduced pilcrow marks.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31154 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-19 22:43:52 +00:00
Vincent van Ravesteijn
bc9b16683e Fix bug #6126: Assertion with page down in Math manual.
If we correct the row where we put the cursor after a PgDn or PgUp command, then we should also adjust the y-coordinate that is used later for checkInsetHit and inset->editXY. 

However, this code doesn't function like it should, but that is bug #4382.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31007 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-13 14:18:12 +00:00
Abdelrazak Younes
cd8e483f3a Text::dispatch(): the spellchecking code is now uneeded.
TextMetrics::drawParagraph(): really check the whole row and not only the first word.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30971 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-10 21:17:08 +00:00
Abdelrazak Younes
0cc197d3c1 Move the inline spellchecking code from collectWords() to the row drawing routine. The text row is spell checked only if changed!
Now inline SpellChecker is faster than ever. Now, I honestly think that we blow out all the competitors (thunderbird, OO, MSWord, etc) :-)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30970 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-10 20:54:22 +00:00
Vincent van Ravesteijn
742bf1b950 Correct datatypes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30968 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-10 19:47:37 +00:00
Vincent van Ravesteijn
231c2e2d61 Fix bug #3997: RTL paragraphs are painted slightly too far to the left
In the computation of the row width, the last space on a row was included. However, this space is not drawn on screen and shouldn't contribute to the width. As a result all rows in a paragraph were painted slightly too far to the left, except the last on.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30967 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-10 19:47:05 +00:00