summaryrefslogtreecommitdiff
path: root/toolkit/source/controls/unocontrolmodel.cxx
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2007-02-14 14:34:48 +0000
committerKurt Zenker <kz@openoffice.org>2007-02-14 14:34:48 +0000
commit124412dc4f2c091a585b53a4babfa13c2247ac36 (patch)
tree82f56470a1998b9bc48d5a21690d282933f79093 /toolkit/source/controls/unocontrolmodel.cxx
parent378127cf8dd6e2b7d0922ea5c2ca77f314f93302 (diff)
INTEGRATION: CWS fmtfield_SRC680 (1.52.42); FILE MERGED
2007/02/12 14:29:19 fs 1.52.42.1: #i74443# +ImplEnsureHabdleOrder
Diffstat (limited to 'toolkit/source/controls/unocontrolmodel.cxx')
-rw-r--r--toolkit/source/controls/unocontrolmodel.cxx36
1 files changed, 34 insertions, 2 deletions
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index 24d736a77c46..398dbf1d7b15 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: unocontrolmodel.cxx,v $
*
- * $Revision: 1.52 $
+ * $Revision: 1.53 $
*
- * last change: $Author: vg $ $Date: 2006-11-21 17:03:42 $
+ * last change: $Author: kz $ $Date: 2007-02-14 15:34:48 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -1498,3 +1498,35 @@ void UnoControlModel::ImplNormalizePropertySequence( const sal_Int32, sal_Int32*
{
// nothing to do here
}
+
+void UnoControlModel::ImplEnsureHandleOrder( const sal_Int32 _nCount, sal_Int32* _pHandles,
+ uno::Any* _pValues, sal_Int32 _nFirstHandle, sal_Int32 _nSecondHandle ) const
+{
+ for ( sal_Int32 i=0; i < _nCount; ++_pHandles, ++_pValues, ++i )
+ {
+ if ( _nSecondHandle == *_pHandles )
+ {
+ sal_Int32* pLaterHandles = _pHandles + 1;
+ uno::Any* pLaterValues = _pValues + 1;
+ for ( sal_Int32 j = i + 1; j < _nCount; ++j, ++pLaterHandles, ++pLaterValues )
+ {
+ if ( _nFirstHandle == *pLaterHandles )
+ {
+ // indeed it is -> exchange the both places in the sequences
+ sal_Int32 nHandle( *_pHandles );
+ *_pHandles = *pLaterHandles;
+ *pLaterHandles = nHandle;
+
+ uno::Any aValue( *_pValues );
+ *_pValues = *pLaterValues;
+ *pLaterValues = aValue;
+
+ break;
+ // this will leave the inner loop, and continue with the outer loop.
+ // Note that this means we will encounter the _nSecondHandle handle, again, once we reached
+ // (in the outer loop) the place where we just put it.
+ }
+ }
+ }
+ }
+}