summaryrefslogtreecommitdiff
path: root/comphelper/source/property/propagg.cxx
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2000-12-07 08:19:05 +0000
committerFrank Schönheit <fs@openoffice.org>2000-12-07 08:19:05 +0000
commit2e23576da2055fbf9aabd35eba9e72745060a84b (patch)
tree76e6f4ed73f8d5cd214dccd96dbbdbfea778c418 /comphelper/source/property/propagg.cxx
parentc51906d5786044b2440ac233ad71a3b8ea2bfbfc (diff)
fillHandles: assert if the name sequence is not sorted - prevents silent errors when calling setPropertyValues with a non-sorted sequence
Diffstat (limited to 'comphelper/source/property/propagg.cxx')
-rw-r--r--comphelper/source/property/propagg.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/comphelper/source/property/propagg.cxx b/comphelper/source/property/propagg.cxx
index 75ae26f8438e..adc4f0a3c6fc 100644
--- a/comphelper/source/property/propagg.cxx
+++ b/comphelper/source/property/propagg.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: propagg.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: fs $ $Date: 2000-11-03 15:14:10 $
+ * last change: $Author: fs $ $Date: 2000-12-07 09:19:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -234,6 +234,23 @@ sal_Int32 OPropertyArrayAggregationHelper::fillHandles(
const ::rtl::OUString* pReqProps = _rPropNames.getConstArray();
sal_Int32 nReqLen = _rPropNames.getLength();
+#ifdef _DEBUG
+ // assure that the sequence is sorted
+ {
+ const ::rtl::OUString* pLookup = _rPropNames.getConstArray();
+ const ::rtl::OUString* pEnd = _rPropNames.getConstArray() + _rPropNames.getLength() - 1;
+ for (; pLookup < pEnd; ++pLookup)
+ {
+ const ::rtl::OUString* pCompare = pLookup + 1;
+ const ::rtl::OUString* pCompareEnd = pEnd + 1;
+ for (; pCompare < pCompareEnd; ++pCompare)
+ {
+ OSL_ENSURE(pLookup->compareTo(*pCompare) < 0, "OPropertyArrayAggregationHelper::fillHandles : property names are not sorted!");
+ }
+ }
+ }
+#endif
+
const ::com::sun::star::beans::Property* pCur = m_aProperties.getConstArray();
const ::com::sun::star::beans::Property* pEnd = m_aProperties.getConstArray() + m_aProperties.getLength();