]> git.lyx.org Git - features.git/commitdiff
Defer calculations we may not have to do.
authorRichard Heck <rgheck@comcast.net>
Fri, 19 Mar 2010 15:07:52 +0000 (15:07 +0000)
committerRichard Heck <rgheck@comcast.net>
Fri, 19 Mar 2010 15:07:52 +0000 (15:07 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33802 a592a061-630c-0410-9148-cb99ea01b6c8

src/TextMetrics.cpp

index 8a18dd29566d4f3a9958e593ff88252a4e2665c9..19a71ffbb99154ad41ed597c0ab4431929aaf0b5 100644 (file)
@@ -344,13 +344,6 @@ bool TextMetrics::isRTLBoundary(pit_type pit, pos_type pos,
                return false;
 
        Paragraph const & par = text_->getPar(pit);
-       bool left = font.isVisibleRightToLeft();
-       bool right;
-       if (pos == par.size())
-               right = par.isRTL(bv_->buffer().params());
-       else
-               right = displayFont(pit, pos).isVisibleRightToLeft();
-       
        // no RTL boundary at line break:
        // abc|\n    -> move right ->   abc\n       (and not:    abc\n|
        // FED                          FED|                     FED     )
@@ -360,6 +353,13 @@ bool TextMetrics::isRTLBoundary(pit_type pit, pos_type pos,
                        || par.isSeparator(pos - 1)))
                return false;
        
+       bool left = font.isVisibleRightToLeft();
+       bool right;
+       if (pos == par.size())
+               right = par.isRTL(bv_->buffer().params());
+       else
+               right = displayFont(pit, pos).isVisibleRightToLeft();
+       
        return left != right;
 }