diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-02-15 10:07:30 +0100 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2013-02-19 12:35:01 +0100 |
commit | 818b84eb1573b55961cba56baca857806c0e8c8b (patch) | |
tree | 75675b11fa4b555fae0f858ef4908f62bc3da296 /extensions | |
parent | 1b2debf80af5807421a0e9dd3def02fd0213aec9 (diff) |
property browser: respect property ordering
Consider the following situation:
Property Name Property Order Index
------------- --------------------
propA4 4
propB5 5
propB4 4
And the loop goes over these properties in this order.
propB4 should be before propB5, but with the old code,
propB4 would be pushed after propB5: it asks for position
4, but as positions 4 and 5 are already occupied, it gets
pushed to position 6.
Remaining difficulty: properties from different
property index ordering series will be interleaved.
This should be solved at object model level;
ideally property order index should be unique,
at least within an object.
Change-Id: Ie235a4b22155df97df139f1dc354247845626620
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/propctrlr/propcontroller.cxx | 4 | ||||
-rw-r--r-- | extensions/source/propctrlr/propcontroller.hxx | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx index cf69ca6621c2..6bb6024c0d45 100644 --- a/extensions/source/propctrlr/propcontroller.cxx +++ b/extensions/source/propctrlr/propcontroller.cxx @@ -1098,9 +1098,7 @@ namespace pcr sal_Int32 nRelativePropertyOrder = sourceProps - aProperties.begin(); if ( m_xModel.is() ) nRelativePropertyOrder = m_xModel->getPropertyOrderIndex( sourceProps->Name ); - while ( m_aProperties.find( nRelativePropertyOrder ) != m_aProperties.end() ) - ++nRelativePropertyOrder; - m_aProperties[ nRelativePropertyOrder ] = *sourceProps; + m_aProperties.insert(OrderedPropertyMap::value_type(nRelativePropertyOrder, *sourceProps)); } // be notified when one of our inspectees dies diff --git a/extensions/source/propctrlr/propcontroller.hxx b/extensions/source/propctrlr/propcontroller.hxx index db77bb0c410a..85407096c8b9 100644 --- a/extensions/source/propctrlr/propcontroller.hxx +++ b/extensions/source/propctrlr/propcontroller.hxx @@ -101,7 +101,7 @@ namespace pcr ,public IPropertyExistenceCheck { private: - typedef ::std::map< sal_Int32, ::com::sun::star::beans::Property > OrderedPropertyMap; + typedef ::std::multimap< sal_Int32, ::com::sun::star::beans::Property > OrderedPropertyMap; typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > > InterfaceArray; |