On Tue, May 15, 2007 at 01:07:43AM +0300, Dov Feldstern wrote: > Andre Poenitz wrote: > >>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' > > I hear you. But what about the fact that logically it belongs in Bidi? > How do we take that into account?
If it is really only useful in this setting it might go to Bidi. However, there's already Paragraph::isRightToLeftPar(), so paragraph already knows _something_ about RTL. I admit that the core is a loadm of rubbish when it comes to what belongs where... Andre'