Remove most warnings in ORX

Closes #61
This commit is contained in:
Edwin Jakobs
2020-04-09 16:00:27 +02:00
parent 8fc74555b3
commit d0d096d773
10 changed files with 55 additions and 57 deletions

View File

@@ -167,10 +167,8 @@ class Slider : Element(ElementType("slider")) {
if (it.key == KEY_ENTER) {
try {
val number = NumberFormat.getInstance().parse(keyboardInput).toDouble()
if (number != null) {
interactiveValue = number.coerceIn(range.min, range.max)
}
} catch (e : ParseException) {
interactiveValue = number.coerceIn(range.min, range.max)
} catch (e: ParseException) {
// -- silently (but safely) ignore the exception
}
keyboardInput = ""

View File

@@ -81,9 +81,6 @@ abstract class TextElement(et: ElementType) : Element(et) {
}
fun TextElement.bind(property: KMutableProperty0<String>) {
var currentValue: Double? = null
if (root() as? Body == null) {
throw RuntimeException("no body")
}

View File

@@ -48,6 +48,9 @@ class Matcher {
Combinator.LATER_SIBLING -> if (result == MatchingResult.RESTART_FROM_CLOSEST_DESCENDANT) {
return result
}
Combinator.DESCENDANT -> {
// intentionally do nothing
}
}
}
}