summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star/wizards/common
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-10-14 09:03:36 +0200
committerNoel Grandin <noel@peralex.com>2015-10-14 09:55:09 +0200
commit97da76a17dd6addfd3213f196f4454e1d5cee417 (patch)
tree25e114558c1a0693f0d3bb6b67586b089a778e93 /wizards/com/sun/star/wizards/common
parentb4da5037e0cc2952446b2138d515e0c762172b25 (diff)
cid#1326131 'Constant' variable guards dead code
Change-Id: I832b2fc243404a6ae9796ad994e901880d3b9260
Diffstat (limited to 'wizards/com/sun/star/wizards/common')
-rw-r--r--wizards/com/sun/star/wizards/common/Desktop.java18
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;
}