From: Dov Feldstern Date: Fri, 21 Nov 2008 11:32:56 +0000 (+0000) Subject: get rid of code duplication between overloaded versions of isRTLBoundary X-Git-Tag: 2.0.0~7653 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=af1d2906ef85a2de7fa807f277793eb6fd3b1b6b;p=features.git get rid of code duplication between overloaded versions of isRTLBoundary This is in preparation of some changes to be made in this function, now the change will only have to be done once... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27656 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 37b7793125..87459718de 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -321,15 +321,9 @@ bool TextMetrics::isRTLBoundary(pit_type pit, pos_type pos) const if (pos == 0) return false; - Paragraph const & par = text_->getPar(pit); + Font const & left_font = displayFont(pit, pos - 1); - bool left = displayFont(pit, pos - 1).isVisibleRightToLeft(); - bool right; - if (pos == par.size()) - right = par.isRTL(bv_->buffer().params()); - else - right = displayFont(pit, pos).isVisibleRightToLeft(); - return left != right; + return isRTLBoundary(pit, pos, left_font); }