Resort pProperties when really needed (cppuhelper)
so not when pProperties[i-1].Name == pProperties[i].Name and call getConstArray() only if there have been a sort Found when testing tdf#125941 when editing table: $8 = uno::Sequence of length 29 = { {Name = "AutoIncrementCreation", Handle = 49, Type = uno::Type "string", Attributes = 0}, {Name = "CatalogName", Handle = 30, Type = uno::Type "string", Attributes = 0}, {Name = "CatalogName", Handle = 30, Type = uno::Type "string", Attributes = 0}, {Name = "DefaultValue", Handle = 20, Type = uno::Type "string", Attributes = 0}, {Name = "DefaultValue", Handle = 20, Type = uno::Type "string", Attributes = 0}, {Name = "Description", Handle = 19, Type = uno::Type "string", Attributes = 0}, {Name = "Description", Handle = 19, Type = uno::Type "string", Attributes = 0}, ... Change-Id: I645f7d24d552222cf520e346f4505f5a14979a30 Reviewed-on: https://gerrit.libreoffice.org/74124 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
committed by
Noel Grandin
parent
f74f7899fa
commit
3148b506a5
@@ -977,7 +977,7 @@ void OPropertyArrayHelper::init( sal_Bool bSorted )
|
|||||||
|
|
||||||
for( i = 1; i < nElements; i++ )
|
for( i = 1; i < nElements; i++ )
|
||||||
{
|
{
|
||||||
if( pProperties[i-1].Name >= pProperties[i].Name )
|
if( pProperties[i-1].Name > pProperties[i].Name )
|
||||||
{
|
{
|
||||||
if (bSorted) {
|
if (bSorted) {
|
||||||
OSL_FAIL( "Property array is not sorted" );
|
OSL_FAIL( "Property array is not sorted" );
|
||||||
@@ -985,11 +985,10 @@ void OPropertyArrayHelper::init( sal_Bool bSorted )
|
|||||||
// not sorted
|
// not sorted
|
||||||
qsort( aInfos.getArray(), nElements, sizeof( Property ),
|
qsort( aInfos.getArray(), nElements, sizeof( Property ),
|
||||||
compare_Property_Impl );
|
compare_Property_Impl );
|
||||||
|
pProperties = aInfos.getConstArray();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// may be that the array is resorted
|
|
||||||
pProperties = aInfos.getConstArray();
|
|
||||||
for( i = 0; i < nElements; i++ )
|
for( i = 0; i < nElements; i++ )
|
||||||
if( pProperties[i].Handle != i )
|
if( pProperties[i].Handle != i )
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user