The existing code already avoids merging with typewriter font, but it does not work with LyX-Code, where the typewriter family is inherited. Therefore it is Cursor::real_current_font that must be tested.
Fixes bug #9987.
removeShortcut() restores default settings, therefore was used incorrectly. I
introduce deactivateShortcuts() which only removes assignments.
Clean up a bit the lack of view / model distinction (getting rid of the crashing
code at the same time).
Repair inconsistency of the selection in the "modify" case. (regression at
717d19d3c)
Make the test for existing bindings a bit more robust. (Not perfect yet.)
Focus on the item that has just been added/modified. (cosmetic)
Since at least gcc 4.6 requires it, -std=c++11 has been passed to CPPFLAGS at 39717adfd. This was deemed necessary so that tests that use the preprocessor directly (AC_CHECK_HEADER) can have the right information.
It turns out that CPPFLAGS gets passed to objc compilation too (on Mac OS X) and this create compile-time errors.
Therefore we remove the -std flag from CPPFLAGS and re-add it to a separate variable cxx11_flags that is passed to LYX_CXX_USE_REGEX.
This fixes a failing unit test with 32bit gcc 4.9.3 and -O2 optimization:
It computed 9953 instead of 9954 for Length::inPixels() of value 2342.
The reason for this is probably different rounding behaviour caused by storing
the unrounded value in a processor register (uses 80bit accuracy) vs. writing
it back to memory (uses 64bit accuracy). The unrounded value is very close to
9953.5 (which is not representable as an exact IEEE floating point value).
Apart from that, having a proper function for rounding makes the code more
readable, and has the nice side effect to make Length::inPB() work for
negative lengths as well.