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
This commit is contained in:
Richard Heck 2010-03-26 16:59:08 +00:00
parent 88f1ca654f
commit 30484ecced

View File

@ -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())