throw more useful exception from OPropertySetHelper::getPropertyValue
Change-Id: I90e7ab5763bf368cec795a8c39ece17579dd851d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172905 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
This commit is contained in:
@@ -273,6 +273,8 @@ Any OPropertySetHelper::getPropertyValue(
|
||||
IPropertyArrayHelper & rPH = getInfoHelper();
|
||||
// map the name to the handle
|
||||
sal_Int32 nHandle = rPH.getHandleByName( rPropertyName );
|
||||
if (nHandle == -1)
|
||||
throw UnknownPropertyException(rPropertyName);
|
||||
// call the method of the XFastPropertySet interface
|
||||
return getFastPropertyValue( nHandle );
|
||||
}
|
||||
@@ -545,8 +547,8 @@ void OPropertySetHelper::setFastPropertyValue( sal_Int32 nHandle, const Any& rVa
|
||||
|
||||
// XFastPropertySet
|
||||
Any OPropertySetHelper::getFastPropertyValue( sal_Int32 nHandle )
|
||||
|
||||
{
|
||||
assert(nHandle != -1 && "passing -1 here indicates that the caller knows this is not a valid handle");
|
||||
IPropertyArrayHelper & rInfo = getInfoHelper();
|
||||
if( !rInfo.fillPropertyMembersByHandle( nullptr, nullptr, nHandle ) )
|
||||
// unknown property
|
||||
|
||||
Reference in New Issue
Block a user