| 1931 | } |
| 1932 | |
| 1933 | void TextEditor::Cut() |
| 1934 | { |
| 1935 | if (IsReadOnly()) |
| 1936 | { |
| 1937 | Copy(); |
| 1938 | } |
| 1939 | else |
| 1940 | { |
| 1941 | if (HasSelection()) |
| 1942 | { |
| 1943 | UndoRecord u; |
| 1944 | u.mBefore = mState; |
| 1945 | u.mRemoved = GetSelectedText(); |
| 1946 | u.mRemovedStart = mState.mSelectionStart; |
| 1947 | u.mRemovedEnd = mState.mSelectionEnd; |
| 1948 | |
| 1949 | Copy(); |
| 1950 | DeleteSelection(); |
| 1951 | |
| 1952 | u.mAfter = mState; |
| 1953 | AddUndo(u); |
| 1954 | } |
| 1955 | } |
| 1956 | } |
| 1957 | |
| 1958 | void TextEditor::Paste() |
| 1959 | { |