It is actually easier to set the 20 pixels margin in redoParagraph, since it is not necessary to take newlines in account when deciding what is the real last row of the paragraph.
Moreover this solves the following bug (present in 2.1.x too): when the document ends with a newling, the bottom margin disappears.
Update PAINTING_ANALYSIS with new tasks.
* remove optional arguments to the helpers that use a FontInfo
* add a textwidth argument to the text() methods that are used by rowpainter.
Now textwidth is only computed if a null value was passed to the
text() method. This means that in the use case of rowpainter, no
textwidth needs to be computed.
The initial values for maxasc and maxdes (renamed from maxdesc) is obtained as a maximum of max ascents/descents of all row elements.
This allows to get rid of Paragraph::highestFontInRange and FontList::highestInRange.
Some auxilliary variables declarations are also moved to where they are needed.
Let breakRow return a boolean indicating whether an additional row is
required (after a newline) and use that to replace the code that added
an extra row when a paragraph ends with a newline.
There are two main cases:
* when drawing is disabled from the start, use a simplified code that only paints insets (in order to cache positions).
* when the row is not visible, do the same.
The goal of this optimization is to be able to always run a no-drawing draw after the metrics have been computed.
Although the fix affects only a content of a LyX note, it is
still surprising to get a dialog-window demanding creation
a new document if trying to edit the subdocument.
Now that 5mu are added on each side of : (because it is a relation), there is no need to do the same in the definition of \vcentcolon.
This is closer to what is done in mathtools.sty.
This is a first cleanup step. More complex rules have to be
implemented on top of this.
Use proper spacing \thinmuskip, \medmuskip and \thickmuskip instead of
ad-hoc values.
Rename isRelOp to isMathRel and introduce isMathBin and isMathPunct
(for InsetMathChar and InsetMathSymbol). Update the categories of
characters in InsetMathChar according to LaTeX source (fontmath.ltx).
Set correctly the spacing around mathrel, mathbin and mathpunct
elements. Use \thinmuskip around MathDelim instead of a hardcoded 4.
This is related to bug #8883.
There is already a spacing of 2 pixels on each side of a button (e.g. collapsed inset). There is no need to add one extra pixel for command insets.
Fixes part of bug #10149.
The computation of the width of the button was wrong. If <--> stands for TEXT_TO_INSET_OFFSET/2 spacing, and if `[]' marks the button's limits, then the intent is
<-->[<-->button text<-->]<-->
Therefore the physical grey rectangle width is
width - Inset::TEXT_TO_INSET_OFFSET
With this change, the spacing on the right of the button is not larger than the left one.
Fixes bug #10147.
The way it works is:
* the inset defines allowParagraphCustomization() correctly
* Text::getStatus acts on it.
Note that, in Text::getStatus, testing for cur.inset().allowParagraphCustomization() does not make much sense, since one should pass the cursor idx as parameter. Actually, for some reason the safest bet is to use the owner of the Text object as inset.
The way it works is:
* the inset defines forcePlainLayout() correctly
* Text::getStatus acts on it.
Note that, in Text::getStatus, testing for cur.inset().forcePlainLayout() does not make much sense, since one should pass the cursor idx as parameter.
There are many other lfuns that do not have to be handled directly by insets. InsetScript in particular has tests for way too many lfuns.
This method did access more CursorSlice than Text. It is only a setter for
CursorSlice with some bound checking. The new signature is
setPitPos(pit_type, pos_type).
The old name would be confusing wrt setSelection(), which does additional checks.
This one is a pure acessor, and the more complete methods are
* setSelection(), which avoids empty selections
* clearSelection(), which resets anchor, and sets word selection and mark more to false.
Most of the code should use these two instead of selection(bool), but this is for later.
It turns out that it did not take off since introduced in 2011. It is better to remove it and the associated boost headers (extract.sh was run against boost 1.60 to do the update).
Since we will move away from several boost classes when transitioning to C++11, it is good to start by removing lesser used ones.
It is easier to use instead getVectorFromString for the use we have of this tokenizer. The two places are environment.cpp (path stuff) and qt_helpers (file fileters). The new code is much shorter.
This allow to remove boost/tokenizer.hpp and friends from our boost tree.
Some headers contain
class Foo;
whereas there is no class Foo.
The list of class statements is given by
classes=`git grep '^\(class\|struct\) [a-zA-Z_:]*;' src | sed 's/^.* \(.*\);/\1/'|sort -u`
The ones that are useless are:
for c in $classes ; do grep -r "\\<$c\\>" src| grep -vq '^[^:]*:\(class\|struct\) [a-zA-Z_:]*;' || echo "$c"; done