mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
fix a crash when the inset containing the new word at cursor is deleted
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37563 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
dc4abad361
commit
e1a685fcb1
@ -552,17 +552,21 @@ void Cursor::checkNewWordPosition()
|
||||
if (!inTexted())
|
||||
clearNewWordPosition();
|
||||
else {
|
||||
if (paragraph().id() != new_word_.paragraph().id())
|
||||
if (pit() != new_word_.pit())
|
||||
clearNewWordPosition();
|
||||
else {
|
||||
FontSpan ow = new_word_.locateWord(WHOLE_WORD);
|
||||
FontSpan nw = locateWord(WHOLE_WORD);
|
||||
if (nw.intersect(ow).empty())
|
||||
if (nw.size()) {
|
||||
FontSpan ow = new_word_.locateWord(WHOLE_WORD);
|
||||
if (nw.intersect(ow).empty())
|
||||
clearNewWordPosition();
|
||||
else
|
||||
LYXERR(Debug::DEBUG, "new word: "
|
||||
<< " par: " << pit()
|
||||
<< " pos: " << nw.first << ".." << nw.last);
|
||||
} else {
|
||||
clearNewWordPosition();
|
||||
else
|
||||
LYXERR(Debug::DEBUG, "new word: "
|
||||
<< " par: " << pit()
|
||||
<< " pos: " << nw.first << ".." << nw.last);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -196,8 +196,10 @@ FontSpan DocIterator::locateWord(word_location const loc) const
|
||||
{
|
||||
FontSpan f = FontSpan();
|
||||
|
||||
f.first = pos();
|
||||
top().paragraph().locateWord(f.first, f.last, loc);
|
||||
if (!top().text()->empty()) {
|
||||
f.first = pos();
|
||||
top().paragraph().locateWord(f.first, f.last, loc);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user