diff options
author | Frank Schönheit <fs@openoffice.org> | 2002-05-16 04:55:33 +0000 |
---|---|---|
committer | Frank Schönheit <fs@openoffice.org> | 2002-05-16 04:55:33 +0000 |
commit | f13063ad77d73ad90041863b78b584de47363ce5 (patch) | |
tree | d13d7ef48255881cbc4a62725b249f044f2b64d2 /toolkit/source/controls | |
parent | b3c7122525d9938f9f2e5a19950b9cb8fcdf98f6 (diff) |
#99314# ImplNormalizePropertySequence: take care for dependency between StringItemList and SelectedItems
Diffstat (limited to 'toolkit/source/controls')
-rw-r--r-- | toolkit/source/controls/unocontrols.cxx | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 77e8a7d08653..141b034e2011 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unocontrols.cxx,v $ * - * $Revision: 1.51 $ + * $Revision: 1.52 $ * - * last change: $Author: fs $ $Date: 2002-03-05 17:08:05 $ + * last change: $Author: fs $ $Date: 2002-05-16 05:55:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2503,6 +2503,47 @@ void UnoControlListBoxModel::ImplPropertyChanged( sal_uInt16 nPropId ) aAny <<= aSeq; setPropertyValue( GetPropertyName( BASEPROPERTY_SELECTEDITEMS ), aAny ); } + + UnoControlModel::ImplPropertyChanged( nPropId ); +} + +void UnoControlListBoxModel::ImplNormalizePropertySequence( const sal_Int32 _nCount, sal_Int32* _pHandles, + uno::Any* _pValues, sal_Int32* _pValidHandles ) const SAL_THROW(()) +{ + // dependencies we know: + // BASEPROPERTY_STRINGITEMLIST->BASEPROPERTY_SELECTEDITEMS + // a more generic approach when it is needed would be nice .... + + for ( sal_Int32 i=0; i < _nCount; ++_pHandles, ++_pValues, ++i ) + { + if ( BASEPROPERTY_SELECTEDITEMS == *_pHandles ) + { + // look if the property SelectedItems depends on is _behind_ SelectedItems + sal_Int32* pLaterHandles = _pHandles + 1; + uno::Any* pLaterValues = _pValues + 1; + for ( sal_Int32 j = i + 1; j < _nCount; ++j, ++pLaterHandles, ++pLaterValues ) + { + if ( BASEPROPERTY_STRINGITEMLIST == *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 SelectedItems handle, again, once we reached + // (in the outer loop) the place where we just put it. + } + } + } + } + + UnoControlModel::ImplNormalizePropertySequence( _nCount, _pHandles, _pValues, _pValidHandles ); } // ---------------------------------------------------- |