Kaydet (Commit) 5d8474ba authored tarafından Noel Grandin's avatar Noel Grandin

convert PropertyOrigin to scoped enum

Change-Id: I26c9929be8aad02030722508334e66f5028ffb37
üst dc1f1cde
...@@ -146,7 +146,7 @@ OPropertyArrayAggregationHelper::OPropertyArrayAggregationHelper( ...@@ -146,7 +146,7 @@ OPropertyArrayAggregationHelper::OPropertyArrayAggregationHelper(
OPropertyArrayAggregationHelper::PropertyOrigin OPropertyArrayAggregationHelper::classifyProperty( const OUString& _rName ) OPropertyArrayAggregationHelper::PropertyOrigin OPropertyArrayAggregationHelper::classifyProperty( const OUString& _rName )
{ {
PropertyOrigin eOrigin = UNKNOWN_PROPERTY; PropertyOrigin eOrigin = PropertyOrigin::Unknown;
// look up the name // look up the name
const Property* pPropertyDescriptor = lcl_findPropertyByName( m_aProperties, _rName ); const Property* pPropertyDescriptor = lcl_findPropertyByName( m_aProperties, _rName );
if ( pPropertyDescriptor ) if ( pPropertyDescriptor )
...@@ -156,7 +156,7 @@ OPropertyArrayAggregationHelper::PropertyOrigin OPropertyArrayAggregationHelper: ...@@ -156,7 +156,7 @@ OPropertyArrayAggregationHelper::PropertyOrigin OPropertyArrayAggregationHelper:
OSL_ENSURE( m_aPropertyAccessors.end() != aPos, "OPropertyArrayAggregationHelper::classifyProperty: should have this handle in my map!" ); OSL_ENSURE( m_aPropertyAccessors.end() != aPos, "OPropertyArrayAggregationHelper::classifyProperty: should have this handle in my map!" );
if ( m_aPropertyAccessors.end() != aPos ) if ( m_aPropertyAccessors.end() != aPos )
{ {
eOrigin = aPos->second.bAggregate ? AGGREGATE_PROPERTY : DELEGATOR_PROPERTY; eOrigin = aPos->second.bAggregate ? PropertyOrigin::Aggregate : PropertyOrigin::Delegator;
} }
} }
return eOrigin; return eOrigin;
...@@ -660,12 +660,12 @@ void SAL_CALL OPropertySetAggregationHelper::setPropertyValues( ...@@ -660,12 +660,12 @@ void SAL_CALL OPropertySetAggregationHelper::setPropertyValues(
for ( sal_Int32 i = 0; i < nLen; ++i, ++pNames ) for ( sal_Int32 i = 0; i < nLen; ++i, ++pNames )
{ {
OPropertyArrayAggregationHelper::PropertyOrigin ePropOrg = rPH.classifyProperty( *pNames ); OPropertyArrayAggregationHelper::PropertyOrigin ePropOrg = rPH.classifyProperty( *pNames );
if ( OPropertyArrayAggregationHelper::UNKNOWN_PROPERTY == ePropOrg ) if ( OPropertyArrayAggregationHelper::PropertyOrigin::Unknown == ePropOrg )
throw WrappedTargetException( OUString(), static_cast< XMultiPropertySet* >( this ), makeAny( UnknownPropertyException( ) ) ); throw WrappedTargetException( OUString(), static_cast< XMultiPropertySet* >( this ), makeAny( UnknownPropertyException( ) ) );
// due to a flaw in the API design, this method is not allowed to throw an UnknownPropertyException // due to a flaw in the API design, this method is not allowed to throw an UnknownPropertyException
// so we wrap it into a WrappedTargetException // so we wrap it into a WrappedTargetException
if ( OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY == ePropOrg ) if ( OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate == ePropOrg )
++nAggCount; ++nAggCount;
} }
...@@ -705,7 +705,7 @@ void SAL_CALL OPropertySetAggregationHelper::setPropertyValues( ...@@ -705,7 +705,7 @@ void SAL_CALL OPropertySetAggregationHelper::setPropertyValues(
for ( sal_Int32 i = 0; i < nLen; ++i, ++pNames, ++pValues ) for ( sal_Int32 i = 0; i < nLen; ++i, ++pNames, ++pValues )
{ {
if ( OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY == rPH.classifyProperty( *pNames ) ) if ( OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate == rPH.classifyProperty( *pNames ) )
{ {
*pAggNames++ = *pNames; *pAggNames++ = *pNames;
*pAggValues++ = *pValues; *pAggValues++ = *pValues;
......
...@@ -156,11 +156,11 @@ public: ...@@ -156,11 +156,11 @@ public:
bool getPropertyByHandle( sal_Int32 _nHandle, css::beans::Property& _rProperty ) const; bool getPropertyByHandle( sal_Int32 _nHandle, css::beans::Property& _rProperty ) const;
enum PropertyOrigin enum class PropertyOrigin
{ {
AGGREGATE_PROPERTY, Aggregate,
DELEGATOR_PROPERTY, Delegator,
UNKNOWN_PROPERTY Unknown
}; };
/** prefer this one over the XPropertySetInfo of the aggregate! /** prefer this one over the XPropertySetInfo of the aggregate!
......
...@@ -208,20 +208,20 @@ cppu::IPropertyArrayHelper& OShape::getInfoHelper() ...@@ -208,20 +208,20 @@ cppu::IPropertyArrayHelper& OShape::getInfoHelper()
void SAL_CALL OShape::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException, std::exception) void SAL_CALL OShape::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
{ {
getInfoHelper(); getInfoHelper();
if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY ) if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate )
m_aProps.aComponent.m_xProperty->setPropertyValue( aPropertyName,aValue); m_aProps.aComponent.m_xProperty->setPropertyValue( aPropertyName,aValue);
// can be in both // can be in both
if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY ) if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator )
ShapePropertySet::setPropertyValue( aPropertyName, aValue ); ShapePropertySet::setPropertyValue( aPropertyName, aValue );
} }
uno::Any SAL_CALL OShape::getPropertyValue( const OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception) uno::Any SAL_CALL OShape::getPropertyValue( const OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
{ {
getInfoHelper(); getInfoHelper();
if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY ) if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate )
return m_aProps.aComponent.m_xProperty->getPropertyValue( PropertyName); return m_aProps.aComponent.m_xProperty->getPropertyValue( PropertyName);
// can be in both // can be in both
if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY ) if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator )
return ShapePropertySet::getPropertyValue( PropertyName); return ShapePropertySet::getPropertyValue( PropertyName);
return uno::Any(); return uno::Any();
} }
...@@ -229,40 +229,40 @@ uno::Any SAL_CALL OShape::getPropertyValue( const OUString& PropertyName ) throw ...@@ -229,40 +229,40 @@ uno::Any SAL_CALL OShape::getPropertyValue( const OUString& PropertyName ) throw
void SAL_CALL OShape::addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception) void SAL_CALL OShape::addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
{ {
getInfoHelper(); getInfoHelper();
if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY || aPropertyName.isEmpty() ) if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate || aPropertyName.isEmpty() )
m_aProps.aComponent.m_xProperty->addPropertyChangeListener( aPropertyName, xListener); m_aProps.aComponent.m_xProperty->addPropertyChangeListener( aPropertyName, xListener);
// can be in both // can be in both
if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || aPropertyName.isEmpty() ) if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator || aPropertyName.isEmpty() )
ShapePropertySet::addPropertyChangeListener( aPropertyName, xListener ); ShapePropertySet::addPropertyChangeListener( aPropertyName, xListener );
} }
void SAL_CALL OShape::removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception) void SAL_CALL OShape::removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
{ {
getInfoHelper(); getInfoHelper();
if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY || aPropertyName.isEmpty() ) if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate || aPropertyName.isEmpty() )
m_aProps.aComponent.m_xProperty->removePropertyChangeListener( aPropertyName, aListener ); m_aProps.aComponent.m_xProperty->removePropertyChangeListener( aPropertyName, aListener );
// can be in both // can be in both
if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || aPropertyName.isEmpty() ) if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator || aPropertyName.isEmpty() )
ShapePropertySet::removePropertyChangeListener( aPropertyName, aListener ); ShapePropertySet::removePropertyChangeListener( aPropertyName, aListener );
} }
void SAL_CALL OShape::addVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception) void SAL_CALL OShape::addVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
{ {
getInfoHelper(); getInfoHelper();
if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY || PropertyName.isEmpty() ) if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate || PropertyName.isEmpty() )
m_aProps.aComponent.m_xProperty->addVetoableChangeListener( PropertyName, aListener ); m_aProps.aComponent.m_xProperty->addVetoableChangeListener( PropertyName, aListener );
// can be in both // can be in both
if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || PropertyName.isEmpty() ) if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator || PropertyName.isEmpty() )
ShapePropertySet::addVetoableChangeListener( PropertyName, aListener ); ShapePropertySet::addVetoableChangeListener( PropertyName, aListener );
} }
void SAL_CALL OShape::removeVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception) void SAL_CALL OShape::removeVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
{ {
getInfoHelper(); getInfoHelper();
if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY || PropertyName.isEmpty() ) if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate || PropertyName.isEmpty() )
m_aProps.aComponent.m_xProperty->removeVetoableChangeListener( PropertyName, aListener ); m_aProps.aComponent.m_xProperty->removeVetoableChangeListener( PropertyName, aListener );
// can be in both // can be in both
if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || PropertyName.isEmpty() ) if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator || PropertyName.isEmpty() )
ShapePropertySet::removeVetoableChangeListener( PropertyName, aListener ); ShapePropertySet::removeVetoableChangeListener( PropertyName, aListener );
} }
......
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