Exemplo n.º 1
0
bool InsetText::notifyCursorLeaves(Cursor const & old, Cursor & cur)
{
	if (buffer().isClean())
		return Inset::notifyCursorLeaves(old, cur);
	
	// find text inset in old cursor
	Cursor insetCur = old;
	int scriptSlice	= insetCur.find(this);
	LASSERT(scriptSlice != -1, /**/);
	insetCur.cutOff(scriptSlice);
	LASSERT(&insetCur.inset() == this, /**/);
	
	// update the old paragraph's words
	insetCur.paragraph().updateWords();
	
	return Inset::notifyCursorLeaves(old, cur);
}
Exemplo n.º 2
0
bool InsetText::notifyCursorLeaves(Cursor const & old, Cursor & cur)
{
	if (buffer().isClean())
		return Inset::notifyCursorLeaves(old, cur);
	
	// find text inset in old cursor
	Cursor insetCur = old;
	int scriptSlice	= insetCur.find(this);
	// we can try to continue here. returning true means
	// the cursor is "now" invalid. which it was.
	LASSERT(scriptSlice != -1, return true);
	insetCur.cutOff(scriptSlice);
	LASSERT(&insetCur.inset() == this, return true);
	
	// update the old paragraph's words
	insetCur.paragraph().updateWords();
	
	return Inset::notifyCursorLeaves(old, cur);
}