diff options
author | Felipe Heidrich <fheidric> | 2011-02-17 16:44:03 +0000 |
---|---|---|
committer | Felipe Heidrich <fheidric> | 2011-02-17 16:44:03 +0000 |
commit | 21a85b41f5c1c26f952db6e604e4efdfcf4f2b15 (patch) | |
tree | f577454a9eac69f97dc1e0f1b94f866baed9fba7 | |
parent | 937921e5fbaf3b529c910374057856df248c8d7c (diff) | |
download | eclipse.platform.swt-21a85b41f5c1c26f952db6e604e4efdfcf4f2b15.tar.gz eclipse.platform.swt-21a85b41f5c1c26f952db6e604e4efdfcf4f2b15.tar.xz eclipse.platform.swt-21a85b41f5c1c26f952db6e604e4efdfcf4f2b15.zip |
removing unnecessary if statements
(Bug 101654 - [typing] [Ctrl+] Home/End doesn't reveal caret if already at position)
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java index 430f46ceb3..2cc14aabe2 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java @@ -2466,20 +2466,16 @@ void doContentEnd() { doLineEnd(); } else { int length = content.getCharCount(); - if (caretOffset <= length) { - setCaretOffset(length, SWT.DEFAULT); - showCaret(); - } + setCaretOffset(length, SWT.DEFAULT); + showCaret(); } } /** * Moves the caret in front of the first character of the widget content. */ void doContentStart() { - if (caretOffset >= 0) { - setCaretOffset(0, SWT.DEFAULT); - showCaret(); - } + setCaretOffset(0, SWT.DEFAULT); + showCaret(); } /** * Moves the caret to the start of the selection if a selection exists. @@ -2633,10 +2629,8 @@ void doLineEnd() { int lineLength = content.getLine(caretLine).length(); lineEndOffset = lineOffset + lineLength; } - if (caretOffset <= lineEndOffset) { - setCaretOffset(lineEndOffset, PREVIOUS_OFFSET_TRAILING); - showCaret(); - } + setCaretOffset(lineEndOffset, PREVIOUS_OFFSET_TRAILING); + showCaret(); } /** * Moves the caret to the beginning of the line. @@ -2652,10 +2646,8 @@ void doLineStart() { lineOffset += offsets[lineIndex]; renderer.disposeTextLayout(layout); } - if (caretOffset >= lineOffset) { - setCaretOffset(lineOffset, OFFSET_LEADING); - showCaret(); - } + setCaretOffset(lineOffset, OFFSET_LEADING); + showCaret(); } /** * Moves the caret one line up and to the same character offset relative |