Fixed #6555 (crash when trying to replace starting from multi-par selection with end pos < beg pos).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33542 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Tommaso Cucinotta 2010-02-22 21:44:59 +00:00
parent 038b7e2b19
commit a7f63005f0

View File

@ -1137,9 +1137,12 @@ static void findAdvReplace(BufferView * bv, FindAndReplaceOptions const & opt, M
return;
DocIterator sel_beg = cur.selectionBegin();
DocIterator sel_end = cur.selectionEnd();
LASSERT(&sel_beg.inset() == &sel_end.inset(), /**/);
if (&sel_beg.inset() != &sel_end.inset()
|| sel_beg.pit() != sel_end.pit())
return;
int sel_len = sel_end.pos() - sel_beg.pos();
LYXERR(Debug::FIND, "sel_beg: " << sel_beg << ", sel_end: " << sel_end << ", sel_len: " << sel_len << endl);
LYXERR(Debug::FIND, "sel_beg: " << sel_beg << ", sel_end: " << sel_end
<< ", sel_len: " << sel_len << endl);
if (sel_len == 0)
return;
LASSERT(sel_len > 0, /**/);