* src/Text.cpp (changeCase): do not set the selection if it was not

already set.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@22700 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2008-01-28 13:20:44 +00:00
parent c61c949a2a
commit 54b0ad5904
2 changed files with 12 additions and 5 deletions

View File

@ -1088,9 +1088,11 @@ void Text::changeCase(Cursor & cur, Text::TextCase action)
CursorSlice from;
CursorSlice to;
bool gotsel = false;
if (cur.selection()) {
from = cur.selBegin();
to = cur.selEnd();
gotsel = true;
} else {
from = cur.top();
getWord(from, to, PARTIAL_WORD);
@ -1174,10 +1176,13 @@ void Text::changeCase(Cursor & cur, Text::TextCase action)
}
// the selection may have changed due to logically-only deleted chars
setCursor(cur, begPit, begPos);
cur.resetAnchor();
setCursor(cur, endPit, right);
cur.setSelection();
if (gotsel) {
setCursor(cur, begPit, begPos);
cur.resetAnchor();
setCursor(cur, endPit, right);
cur.setSelection();
} else
setCursor(cur, endPit, right);
checkBufferStructure(cur.buffer(), cur);
}

View File

@ -153,7 +153,9 @@ What's new
- Avoid spurious warning messages about translation of "Plain text" at
start-up.
- Unicode support for missing space modifier letters.
- Unicode support for missing space modifier letters.
- The case-changing functions do not select text anymore.
* DOCUMENTATION