Fix bug 6650: Error Messages Repeated

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35664 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2010-10-17 12:06:47 +00:00
parent 5520817bd3
commit 496f7a23fd
2 changed files with 8 additions and 13 deletions

View File

@ -332,6 +332,7 @@ void Cursor::dispatch(FuncRequest const & cmd0)
fixIfBroken();
FuncRequest cmd = cmd0;
Cursor safe = *this;
disp_ = DispatchResult();
buffer()->undo().beginUndoGroup();

View File

@ -936,23 +936,17 @@ void Text::insertChar(Cursor & cur, char_type c)
// disable the double-space checking
if (!freeSpacing && isLineSeparatorChar(c)) {
if (cur.pos() == 0) {
static bool sent_space_message = false;
if (!sent_space_message) {
cur.message(_("You cannot insert a space at the "
"beginning of a paragraph. Please read the Tutorial."));
sent_space_message = true;
}
cur.message(_(
"You cannot insert a space at the "
"beginning of a paragraph. Please read the Tutorial."));
return;
}
LASSERT(cur.pos() > 0, /**/);
if ((par.isLineSeparator(cur.pos() - 1) || par.isNewline(cur.pos() - 1))
&& !par.isDeleted(cur.pos() - 1)) {
static bool sent_space_message = false;
if (!sent_space_message) {
cur.message(_("You cannot type two spaces this way. "
"Please read the Tutorial."));
sent_space_message = true;
}
&& !par.isDeleted(cur.pos() - 1)) {
cur.message(_(
"You cannot type two spaces this way. "
"Please read the Tutorial."));
return;
}
}