Kaydet (Commit) 818b84eb authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane

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
üst 1b2debf8
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment