getPosNearX, which is the only user of x2pos, should always return the
nearest position.
In editXY, there is a need to return the position where the inset
stands, but it is done using checkInsetHit.
This is a simplification of commit eb4a2a19, which has been reverted
at 01f0ab64a.
Fixes part of bug #10569.
Instead of using complicated (and wrong) code, it is better to use
getPosNearX here.
Also simplify the code by removing temporary variables.
Fixes part of #10569.
The code that looks whether neighbor block has a different direction
should look to the left or to the right depending on the direction of
the current block.
Fixes part of bug #10569
This allows to fix distclean properly, since we know that
subdir-objects is used. When it is the case, it is not a good idea for
a Makefile to use a source file which is under the control of another
one. This could not be made to work work with old automake versions
(<1.14).
Therefore we refer directly to object files in Makefile.am instead of
source files. The actually leads to less compilation in tex2lyx.
Update the code here and there to remove compatibility hacks. Update
documentation.
Re-enable the layout test and fix the Length test, which was ovewriting
memory in test_inPixels() because lyxrc did not had a correct layout.
As it was, the comparison buffer was sharing a DocumentClass with
one of the compared buffers. I don't fully understand why this was
causing a problem, since we use a shared_ptr. But this patch creates
a new DocumentClass for the new buffer.
This is preliminary work to make roots look more like in TeX output:
* correct font size for root order
* set minimum size of the root from the max ascent descent of the
font. This is what TeX does.
* fix drawing, and in particular horizontal size.
More needs to be done, in particular:
* handle zooming and dpi correctly by removing hardcoded pixel values.
* factor the code for the two types of roots in one.
With RtL text, the method can be non-monotonic wrt x value (which is a
Qt bug). To work around this, we check whether positions adjacent to
those returned by xToCursor look better. Depending on whether the new
x position is too small or too large, we look backward or forward for
a better solution.
The performance is probably not great, but this is only needed for
user interactions, so the performance penalty should not be a problem.
Fixes#10569.
Coverity flags this code as not handling exception that may happen in buffer().
My own analysis is that this can never happen because isBufferValid()
does check whether buffer_ is null.
Any insght appreciated. The commit should be expeanded to more cases, actually.