From 6caed46dba2c8be34c3cb32dc6bddf31f98eac02 Mon Sep 17 00:00:00 2001 From: Sven Göthel Date: Sun, 4 Feb 2024 07:33:21 +0100 Subject: Use new com.jogamp.common.util.StringUtil (GlueGen) --- .../classes/com/jogamp/opengl/util/av/SubTextEvent.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/jogl/classes/com/jogamp/opengl/util/av/SubTextEvent.java') diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/SubTextEvent.java b/src/jogl/classes/com/jogamp/opengl/util/av/SubTextEvent.java index 622c5d29a..be8219634 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/av/SubTextEvent.java +++ b/src/jogl/classes/com/jogamp/opengl/util/av/SubTextEvent.java @@ -30,6 +30,7 @@ package com.jogamp.opengl.util.av; import java.time.format.DateTimeParseException; import com.jogamp.common.av.PTS; +import com.jogamp.common.util.StringUtil; /** * Text Event Line including ASS/SAA of {@link SubtitleEvent} @@ -215,19 +216,7 @@ public class SubTextEvent extends SubtitleEvent { this.name = name; this.effect = effect; this.text = text.replace("\\N", "\n"); - { - final int len = this.text.length(); - int lc = 1; - for(int i=0; len > i; ) { - final int j = this.text.indexOf("\n", i); - if( 0 > j ) { - break; - } - ++lc; - i = j + 1; - } - this.lines = lc; - } + this.lines = StringUtil.getLineCount(this.text); } @Override -- cgit v1.2.3