diff options
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/com/sun/star/wizards/common/Desktop.java | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/wizards/com/sun/star/wizards/common/Desktop.java b/wizards/com/sun/star/wizards/common/Desktop.java index 14c3a7a77561..62b3ea6754d2 100644 --- a/wizards/com/sun/star/wizards/common/Desktop.java +++ b/wizards/com/sun/star/wizards/common/Desktop.java @@ -234,24 +234,19 @@ public class Desktop } /** - * Checks if the passed Element Name already exists in the list If yes it appends a - * suffix to make it unique + * Checks if the passed Element Name already exists in the list. If yes it appends a + * suffix to make it unique. * @return a unique Name not being in the passed list. */ public static String getUniqueName(String[] _slist, String _sElementName, String _sSuffixSeparator) { - int a = 2; - String scompname = _sElementName; - boolean bElementexists = true; - if (_slist == null) + if (_slist == null || _slist.length == 0) { return _sElementName; } - if (_slist.length == 0) - { - return _sElementName; - } - while (bElementexists) + String scompname = _sElementName; + int a = 2; + while (true) { for (int i = 0; i < _slist.length; i++) { @@ -262,7 +257,6 @@ public class Desktop } scompname = _sElementName + _sSuffixSeparator + a++; } - return PropertyNames.EMPTY_STRING; } |