diff options
-rw-r--r-- | qadevOOo/runner/util/utils.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/qadevOOo/runner/util/utils.java b/qadevOOo/runner/util/utils.java index 2ca7351db781..3acbb556cfd5 100644 --- a/qadevOOo/runner/util/utils.java +++ b/qadevOOo/runner/util/utils.java @@ -685,18 +685,19 @@ public class utils { appExecCommand = appExecCommand.replace("\"", ""); appExecCommand = appExecCommand.replace("'", ""); StringTokenizer commandTokens = new StringTokenizer(appExecCommand, " \t"); - String officeExecutable = ""; String officeExecCommand = "soffice"; + StringBuilder sb = new StringBuilder(); // is there a 'soffice' in the command? 2do: eliminate case sensitivity on windows int index = -1; while (commandTokens.hasMoreTokens() && index == -1) { - officeExecutable += commandTokens.nextToken() + " "; - index = officeExecutable.indexOf(officeExecCommand); + sb.append(commandTokens.nextToken()).append(" "); + index = sb.indexOf(officeExecCommand); } if (index == -1) { errorMessage = "Error: Your 'AppExecutionCommand' parameter does not " + "contain '" + officeExecCommand + "'."; } else { + String officeExecutable = sb.toString(); // does the directory exist? officeExecutable = officeExecutable.trim(); String officePath = officeExecutable.substring(0, index); |