summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2001-05-07 11:18:15 +0000
committerFrank Schönheit <fs@openoffice.org>2001-05-07 11:18:15 +0000
commit3772773ad7f9f910e3c682bdfb412b1ed842032a (patch)
tree3fa18993f7b0463c1e5478f4c36b992eda298379 /unotools
parente9e5e36cf1f07f4626f9cac982766e51151391f0 (diff)
adjusted getUniqueSetElementName
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/configitem.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx
index 999b08a3f2ae..d7bc0357c0e8 100644
--- a/unotools/source/config/configitem.cxx
+++ b/unotools/source/config/configitem.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: configitem.cxx,v $
*
- * $Revision: 1.26 $
+ * $Revision: 1.27 $
*
- * last change: $Author: fs $ $Date: 2001-05-07 10:59:16 $
+ * last change: $Author: fs $ $Date: 2001-05-07 12:18:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1141,15 +1141,14 @@ sal_Bool ConfigItem::getUniqueSetElementName( const ::rtl::OUString& _rSetNode,
const sal_uInt32 nPrime = 65521; // a prime number
const sal_uInt32 nPrimeLess1 = nPrime - 1;
sal_uInt32 nEngendering = (rand() % nPrimeLess1) + 1; // the engendering of the field
- sal_uInt32 nFirstElement = (rand() % nPrimeLess1) + 1; // the start element
// the element which will loop through the field
- sal_uInt32 nFieldElement = (nFirstElement * nEngendering) % nPrime;
+ sal_uInt32 nFieldElement = nEngendering;
::rtl::OUString sThisRoundTrial;
- for (; nFieldElement != nFirstElement; nFieldElement = (nFieldElement * nEngendering) % nPrime)
+ for (; 1 != nFieldElement; nFieldElement = (nFieldElement * nEngendering) % nPrime)
{
- ::rtl::OUString sThisRoundTrial = sNewElementName;
+ ::rtl::OUString sThisRoundTrial = _rName;
sThisRoundTrial += ::rtl::OUString::valueOf((sal_Int32)nFieldElement);
if (!xSetNode->hasByName(sThisRoundTrial))