> Index: src/Bidi.cpp
> ===================================================================
> --- src/Bidi.cpp      (revision 18314)
> +++ src/Bidi.cpp      (working copy)
> @@ -12,6 +12,7 @@
>  
>  #include "Bidi.h"
>  #include "Buffer.h"
> +#include "BufferView.h"
>  #include "Font.h"
>  #include "Row.h"
>  #include "LyXRC.h"
> @@ -209,4 +210,18 @@
>  }
>  
>  
> +bool Bidi::reverseDirections(Cursor const & cur) 
> +{
> +     /*
> +      * We determine the directions based on the direction of the
> +      * bottom() --- i.e., outermost --- paragraph, because that is
> +      * the only way to achieve consistency of the arrow's movements
> +      * within a paragraph, and thus avoid situations in which the
> +      * cursor gets stuck.
> +      */
> +     return cur.bottom().paragraph().isRightToLeftPar(
> +                     cur.bv().buffer()->params());
> +}

The fact that you need an extra header for a static function (which does
not use the class at all) is a good sign that it doesn't really
belong there.

If it were in Cursor, it'd look like:

 bool Cursor::reverseDirections() const
 {
        /*
         * We determine the directions based on the direction of the
         * bottom() --- i.e., outermost --- paragraph, because that is
         * the only way to achieve consistency of the arrow's movements
         * within a paragraph, and thus avoid situations in which the
         * cursor gets stuck.
         */
        return bottom().paragraph().isRightToLeftPar(bv().buffer()->params());
 }

The only reason not to do this is that Cursor is already too fat, but I
don't think it is outweighed in this case.

Could be a Paragraph method, too...

Andre'

Reply via email to