Avoid unnecessary redraw when selecting text.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21629 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-11-15 18:01:04 +00:00
parent 8c1f803b83
commit f46454fb7a

View File

@ -536,29 +536,27 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
case LFUN_CHAR_LEFT_SELECT:
//FIXME: for visual cursor, really move left
if (reverseDirectionNeeded(cur)) {
lyx::dispatch(FuncRequest(
cmd.action == LFUN_CHAR_LEFT_SELECT ?
LFUN_CHAR_FORWARD_SELECT : LFUN_CHAR_FORWARD));
cmd.action = cmd.action == LFUN_CHAR_LEFT_SELECT ?
LFUN_CHAR_FORWARD_SELECT : LFUN_CHAR_FORWARD;
} else {
lyx::dispatch(FuncRequest(
cmd.action == LFUN_CHAR_LEFT_SELECT ?
LFUN_CHAR_BACKWARD_SELECT : LFUN_CHAR_BACKWARD));
cmd.action = cmd.action == LFUN_CHAR_LEFT_SELECT ?
LFUN_CHAR_BACKWARD_SELECT : LFUN_CHAR_BACKWARD;
}
break;
dispatch(cur, cmd);
return;
case LFUN_CHAR_RIGHT:
case LFUN_CHAR_RIGHT_SELECT:
//FIXME: for visual cursor, really move right
if (reverseDirectionNeeded(cur)) {
lyx::dispatch(FuncRequest(
cmd.action == LFUN_CHAR_RIGHT_SELECT ?
LFUN_CHAR_BACKWARD_SELECT : LFUN_CHAR_BACKWARD));
cmd.action = cmd.action == LFUN_CHAR_RIGHT_SELECT ?
LFUN_CHAR_BACKWARD_SELECT : LFUN_CHAR_BACKWARD;
} else {
lyx::dispatch(FuncRequest(
cmd.action == LFUN_CHAR_RIGHT_SELECT ?
LFUN_CHAR_FORWARD_SELECT : LFUN_CHAR_FORWARD));
cmd.action = cmd.action == LFUN_CHAR_RIGHT_SELECT ?
LFUN_CHAR_FORWARD_SELECT : LFUN_CHAR_FORWARD;
}
break;
dispatch(cur, cmd);
return;
case LFUN_UP_SELECT:
case LFUN_DOWN_SELECT:
@ -632,15 +630,14 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
case LFUN_WORD_RIGHT_SELECT:
//FIXME: for visual cursor mode, really move right
if (reverseDirectionNeeded(cur)) {
lyx::dispatch(FuncRequest(
cmd.action == LFUN_WORD_RIGHT_SELECT ?
LFUN_WORD_BACKWARD_SELECT : LFUN_WORD_BACKWARD));
cmd.action = cmd.action == LFUN_WORD_RIGHT_SELECT ?
LFUN_WORD_BACKWARD_SELECT : LFUN_WORD_BACKWARD;
} else {
lyx::dispatch(FuncRequest(
cmd.action == LFUN_WORD_RIGHT_SELECT ?
LFUN_WORD_FORWARD_SELECT : LFUN_WORD_FORWARD));
cmd.action = cmd.action == LFUN_WORD_RIGHT_SELECT ?
LFUN_WORD_FORWARD_SELECT : LFUN_WORD_FORWARD;
}
break;
dispatch(cur, cmd);
return;
case LFUN_WORD_FORWARD:
case LFUN_WORD_FORWARD_SELECT:
@ -652,15 +649,14 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
case LFUN_WORD_LEFT_SELECT:
//FIXME: for visual cursor mode, really move left
if (reverseDirectionNeeded(cur)) {
lyx::dispatch(FuncRequest(
cmd.action == LFUN_WORD_LEFT_SELECT ?
LFUN_WORD_FORWARD_SELECT : LFUN_WORD_FORWARD));
cmd.action = cmd.action == LFUN_WORD_LEFT_SELECT ?
LFUN_WORD_FORWARD_SELECT : LFUN_WORD_FORWARD;
} else {
lyx::dispatch(FuncRequest(
cmd.action == LFUN_WORD_LEFT_SELECT ?
LFUN_WORD_BACKWARD_SELECT : LFUN_WORD_BACKWARD));
cmd.action = cmd.action == LFUN_WORD_LEFT_SELECT ?
LFUN_WORD_BACKWARD_SELECT : LFUN_WORD_BACKWARD;
}
break;
dispatch(cur, cmd);
return;
case LFUN_WORD_BACKWARD:
case LFUN_WORD_BACKWARD_SELECT: