From 30484eccede354c9a4cde12382737939e1bde2c6 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Fri, 26 Mar 2010 16:59:08 +0000 Subject: [PATCH] Backport fix for #6454. The real cause may be elsewhere, but this does fix the crash and is a worthwhile sanity check in any event. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@33875 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/TextMetrics.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 788b5e35b9..f5f9ef5b85 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -328,13 +328,14 @@ bool TextMetrics::isRTLBoundary(pit_type pit, pos_type pos) const bool TextMetrics::isRTLBoundary(pit_type pit, pos_type pos, Font const & font) const { - if (!lyxrc.rtl_support) + if (!lyxrc.rtl_support + // no RTL boundary at paragraph start + || pos == 0 + // if the metrics have not been calculated, then we are not + // on screen and can safely ignore issues about boundaries. + || !contains(pit)) return false; - // no RTL boundary at paragraph start - if (pos == 0) - return false; - ParagraphMetrics & pm = par_metrics_[pit]; // no RTL boundary in empty paragraph if (pm.rows().empty())