diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-09-09 22:16:31 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-09-11 23:22:50 +0200 |
commit | 1ed454c71db35d10287fb00a9ed23d4e184e704f (patch) | |
tree | 1f69702a9dc404e4c1b0f960ff0d09088df96da1 | |
parent | d22a4d945ccf1456fbdb2c39802d956afa583a2a (diff) |
Make GetProperty more clear
Change-Id: I23ba7950364fa402f1337e8557c3cf8cd9c810cc
-rw-r--r-- | oox/source/export/drawingml.cxx | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index caf6d0402df9..02bfedd59d90 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -118,32 +118,37 @@ void DrawingML::ResetCounters() maWdpCache.clear(); } -bool DrawingML::GetProperty( Reference< XPropertySet > rXPropSet, const OUString& aName ) +bool DrawingML::GetProperty( Reference< XPropertySet > rXPropertySet, const OUString& aName ) { - bool bRetValue = false; - - try { - mAny = rXPropSet->getPropertyValue( aName ); - if ( mAny.hasValue() ) - bRetValue = true; - } catch( const Exception& ) { /* printf ("exception when trying to get value of property: %s\n", USS(aName)); */ } - - return bRetValue; + try + { + mAny = rXPropertySet->getPropertyValue(aName); + if (mAny.hasValue()) + return true; + } + catch( const Exception& ) + { + /* printf ("exception when trying to get value of property: %s\n", USS(aName)); */ + } + return false; } -bool DrawingML::GetPropertyAndState( Reference< XPropertySet > rXPropSet, Reference< XPropertyState > rXPropState, const OUString& aName, PropertyState& eState ) +bool DrawingML::GetPropertyAndState( Reference< XPropertySet > rXPropertySet, Reference< XPropertyState > rXPropertyState, const OUString& aName, PropertyState& eState ) { - bool bRetValue = false; - - try { - mAny = rXPropSet->getPropertyValue( aName ); - if ( mAny.hasValue() ) { - bRetValue = true; - eState = rXPropState->getPropertyState( aName ); + try + { + mAny = rXPropertySet->getPropertyValue(aName); + if (mAny.hasValue()) + { + eState = rXPropertyState->getPropertyState(aName); + return true; } - } catch( const Exception& ) { /* printf ("exception when trying to get value of property: %s\n", USS(aName)); */ } - - return bRetValue; + } + catch( const Exception& ) + { + /* printf ("exception when trying to get value of property: %s\n", USS(aName)); */ + } + return false; } void DrawingML::WriteColor( sal_uInt32 nColor, sal_Int32 nAlpha ) |