1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Comment adjustment.

This commit is contained in:
Sergey Prigogin 2010-04-18 03:33:25 +00:00
parent 165279718e
commit 3dbeea6a38

View file

@ -130,9 +130,9 @@ public final class ToggleCommentAction extends TextEditorAction {
// For each partition in the text selection, figure out the startline and endline. // For each partition in the text selection, figure out the startline and endline.
// Count the number of lines that are selected. // Count the number of lines that are selected.
for (int i = 0, j = 0; i < regions.length; i++, j+= 2) { for (int i = 0, j = 0; i < regions.length; i++, j+= 2) {
// start line of region // Start line of region
lines[j]= getFirstCompleteLineOfRegion(regions[i], document); lines[j]= getFirstCompleteLineOfRegion(regions[i], document);
// end line of region // End line of region
int length= regions[i].getLength(); int length= regions[i].getLength();
int offset= regions[i].getOffset() + length; int offset= regions[i].getOffset() + length;
if (length > 0) if (length > 0)
@ -158,9 +158,8 @@ public final class ToggleCommentAction extends TextEditorAction {
return false; return false;
} }
return true; return true;
} catch (BadLocationException x) { } catch (BadLocationException e) {
// should not happen CUIPlugin.log(e); // Should not happen
CUIPlugin.log(x);
} }
return false; return false;
@ -180,9 +179,8 @@ public final class ToggleCommentAction extends TextEditorAction {
int length= selection.getLength() == 0 ? line.getLength() : selection.getLength() + (selection.getOffset() - line.getOffset()); int length= selection.getLength() == 0 ? line.getLength() : selection.getLength() + (selection.getOffset() - line.getOffset());
return new Region(line.getOffset(), length); return new Region(line.getOffset(), length);
} catch (BadLocationException x) { } catch (BadLocationException e) {
// should not happen CUIPlugin.log(e); // Should not happen
CUIPlugin.log(x);
} }
return null; return null;
} }
@ -204,9 +202,8 @@ public final class ToggleCommentAction extends TextEditorAction {
offset= document.getLineOffset(startLine + 1); offset= document.getLineOffset(startLine + 1);
return (offset > region.getOffset() + region.getLength() ? -1 : startLine + 1); return (offset > region.getOffset() + region.getLength() ? -1 : startLine + 1);
} catch (BadLocationException x) { } catch (BadLocationException e) {
// should not happen CUIPlugin.log(e); // Should not happen
CUIPlugin.log(x);
} }
return -1; return -1;
@ -246,9 +243,8 @@ public final class ToggleCommentAction extends TextEditorAction {
} }
} }
return true; return true;
} catch (BadLocationException x) { } catch (BadLocationException e) {
// should not happen CUIPlugin.log(e); // Should not happen
CUIPlugin.log(x);
} }
return false; return false;