Kaydet (Commit) 5b7b2c86 authored tarafından Tamás Zolnai's avatar Tamás Zolnai

GeneralFunction is not an enum anymore

Change-Id: Iaf34d31947fc1b85a42c8924561b756d92873be7
Reviewed-on: https://gerrit.libreoffice.org/31103Reviewed-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
üst 7637a20a
......@@ -154,6 +154,8 @@ public:
AnyToInterface( const css::uno::Any& rAny );
static bool GetBoolProperty( const css::uno::Reference< css::beans::XPropertySet>& xProp,
const OUString& rName, bool bDefault = false );
static sal_Int16 GetShortProperty( const css::uno::Reference< css::beans::XPropertySet>& xProp,
const OUString& rName, sal_Int16 nDefault );
static sal_Int32 GetLongProperty( const css::uno::Reference< css::beans::XPropertySet>& xProp,
const OUString& rName );
static sal_Int32 GetEnumProperty( const css::uno::Reference< css::beans::XPropertySet>& xProp,
......
......@@ -2195,7 +2195,7 @@ void lcl_FillOldFields( ScPivotFieldVector& rFields,
PivotFunc nMask = PivotFunc::NONE;
if ( nOrient == sheet::DataPilotFieldOrientation_DATA )
{
sal_Int16 eFunc = (sal_Int16)ScUnoHelpFunctions::GetEnumProperty(
sal_Int16 eFunc = ScUnoHelpFunctions::GetShortProperty(
xDimProp, SC_UNO_DP_FUNCTION2,
sheet::GeneralFunction2::NONE );
if ( eFunc == sheet::GeneralFunction2::AUTO )
......
......@@ -1588,7 +1588,7 @@ void ScDPOutput::GetDataDimensionNames(
// Generate "given name" the same way as in dptabres.
//TODO: Should use a stored name when available
sal_Int16 eFunc = (sal_Int16)ScUnoHelpFunctions::GetEnumProperty(
sal_Int16 eFunc = ScUnoHelpFunctions::GetShortProperty(
xDimProp, SC_UNO_DP_FUNCTION2,
sheet::GeneralFunction2::NONE );
rGivenName = lcl_GetDataFieldName( rSourceName, eFunc );
......
......@@ -1869,7 +1869,7 @@ void SAL_CALL ScDataPilotFieldObj::setPropertyValue( const OUString& aPropertyNa
}
else if ( aPropertyName == SC_UNONAME_FUNCTION2 )
{
sal_Int16 eFunction = (sal_Int16) ScUnoHelpFunctions::GetEnumFromAny( aValue );
sal_Int16 eFunction = ScUnoHelpFunctions::GetInt16FromAny( aValue );
setFunction( eFunction );
}
else if ( aPropertyName == SC_UNONAME_SUBTOTALS )
......
......@@ -56,6 +56,24 @@ bool ScUnoHelpFunctions::GetBoolProperty( const uno::Reference<beans::XPropertyS
return bRet;
}
sal_Int16 ScUnoHelpFunctions::GetShortProperty( const css::uno::Reference< css::beans::XPropertySet>& xProp,
const OUString& rName, sal_Int16 nDefault )
{
sal_Int16 nRet = nDefault;
if ( xProp.is() )
{
try
{
xProp->getPropertyValue( rName ) >>= nRet;
}
catch(uno::Exception&)
{
// keep default
}
}
return nRet;
}
sal_Int32 ScUnoHelpFunctions::GetLongProperty( const uno::Reference<beans::XPropertySet>& xProp,
const OUString& rName )
{
......
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