aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Document.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Document.cxx')
-rw-r--r--src/Document.cxx20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index 4272dda63..def80c49c 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -535,26 +535,18 @@ void Document::DelChar(int pos) {
DeleteChars(pos, LenChar(pos));
}
-int Document::DelCharBackMove(int pos, int len) {
- if (DeleteChars(pos - len, len)) {
- return pos - len;
- } else {
- return pos;
- }
-}
-
-int Document::DelCharBack(int pos) {
+void Document::DelCharBack(int pos) {
if (pos <= 0) {
- return pos;
+ return;
} else if (IsCrLf(pos - 2)) {
- return DelCharBackMove(pos, 2);
+ DeleteChars(pos - 2, 2);
} else if (SC_CP_UTF8 == dbcsCodePage) {
int startChar = MovePositionOutsideChar(pos - 1, -1, false);
- return DelCharBackMove(pos, pos - startChar);
+ DeleteChars(startChar, pos - startChar);
} else if (IsDBCS(pos - 1)) {
- return DelCharBackMove(pos, 2);
+ DeleteChars(pos - 2, 2);
} else {
- return DelCharBackMove(pos, 1);
+ DeleteChars(pos - 1, 1);
}
}