Browse Source

无JIRA任务,sonar问题修复

research/11.0
author 5 years ago
parent
commit
5064993263
  1. 2
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/SyntaxView.java
  2. 4
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/TokenIterator.java
  3. 9
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/WrappedSyntaxView.java

2
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/SyntaxView.java

@ -656,7 +656,7 @@ public class SyntaxView extends View implements TabExpander,
if (tabSize == 0) if (tabSize == 0)
return x; return x;
int ntabs = (((int) x) - tabBase) / tabSize; int ntabs = (((int) x) - tabBase) / tabSize;
return tabBase + ((ntabs + 1) * tabSize); return (float) (tabBase + ((ntabs + 1) * tabSize));
} }

4
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/TokenIterator.java

@ -9,6 +9,7 @@
package com.fr.design.gui.syntax.ui.rsyntaxtextarea; package com.fr.design.gui.syntax.ui.rsyntaxtextarea;
import java.util.Iterator; import java.util.Iterator;
import java.util.NoSuchElementException;
/** /**
@ -73,6 +74,9 @@ class TokenIterator implements Iterator<Token> {
token = null; token = null;
} }
} }
else {
throw new NoSuchElementException();
}
return t; return t;
} }

9
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/WrappedSyntaxView.java

@ -268,7 +268,7 @@ public class WrappedSyntaxView extends BoxView implements TabExpander,
if (host.getEOLMarkersVisible()) { if (host.getEOLMarkersVisible()) {
g.setColor(host.getForegroundForTokenType(Token.WHITESPACE)); g.setColor(host.getForegroundForTokenType(Token.WHITESPACE));
g.setFont(host.getFontForTokenType(Token.WHITESPACE)); g.setFont(host.getFontForTokenType(Token.WHITESPACE));
g.drawString("\u00B6", x, y-fontHeight); g.drawString("\u00B6", x, (float) (y-fontHeight));
} }
} }
@ -458,7 +458,7 @@ public class WrappedSyntaxView extends BoxView implements TabExpander,
if (host.getEOLMarkersVisible()) { if (host.getEOLMarkersVisible()) {
g.setColor(host.getForegroundForTokenType(Token.WHITESPACE)); g.setColor(host.getForegroundForTokenType(Token.WHITESPACE));
g.setFont(host.getFontForTokenType(Token.WHITESPACE)); g.setFont(host.getFontForTokenType(Token.WHITESPACE));
g.drawString("\u00B6", x, y-fontHeight); g.drawString("\u00B6", x, (float) (y-fontHeight));
} }
} }
@ -841,10 +841,11 @@ public class WrappedSyntaxView extends BoxView implements TabExpander,
* @return the tab stop, measured in points >= 0 * @return the tab stop, measured in points >= 0
*/ */
public float nextTabStop(float x, int tabOffset) { public float nextTabStop(float x, int tabOffset) {
if (tabSize == 0) if (tabSize == 0) {
return x; return x;
}
int ntabs = ((int) x - tabBase) / tabSize; int ntabs = ((int) x - tabBase) / tabSize;
return tabBase + ((ntabs + 1) * tabSize); return (float) (tabBase + ((ntabs + 1) * tabSize));
} }

Loading…
Cancel
Save