diff options
Diffstat (limited to 'sd/source/ui/unoidl/unopback.cxx')
-rw-r--r-- | sd/source/ui/unoidl/unopback.cxx | 114 |
1 files changed, 55 insertions, 59 deletions
diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx index 41e973cf8246..764fb7ed5d9d 100644 --- a/sd/source/ui/unoidl/unopback.cxx +++ b/sd/source/ui/unoidl/unopback.cxx @@ -210,49 +210,47 @@ void SAL_CALL SdUnoPageBackground::setPropertyValue( const OUString& aPropertyNa { throw beans::UnknownPropertyException( aPropertyName, static_cast<cppu::OWeakObject*>(this)); } - else + + if( mpSet ) { - if( mpSet ) + if( pEntry->nWID == OWN_ATTR_FILLBMP_MODE ) { - if( pEntry->nWID == OWN_ATTR_FILLBMP_MODE ) + drawing::BitmapMode eMode; + if( aValue >>= eMode ) { - drawing::BitmapMode eMode; - if( aValue >>= eMode ) - { - mpSet->Put( XFillBmpStretchItem( eMode == drawing::BitmapMode_STRETCH ) ); - mpSet->Put( XFillBmpTileItem( eMode == drawing::BitmapMode_REPEAT ) ); - return; - } - throw lang::IllegalArgumentException(); + mpSet->Put( XFillBmpStretchItem( eMode == drawing::BitmapMode_STRETCH ) ); + mpSet->Put( XFillBmpTileItem( eMode == drawing::BitmapMode_REPEAT ) ); + return; } + throw lang::IllegalArgumentException(); + } - SfxItemPool& rPool = *mpSet->GetPool(); - SfxItemSet aSet( rPool, {{pEntry->nWID, pEntry->nWID}}); - aSet.Put( *mpSet ); - - if( !aSet.Count() ) - aSet.Put( rPool.GetDefaultItem( pEntry->nWID ) ); + SfxItemPool& rPool = *mpSet->GetPool(); + SfxItemSet aSet( rPool, {{pEntry->nWID, pEntry->nWID}}); + aSet.Put( *mpSet ); - if( pEntry->nMemberId == MID_NAME && ( pEntry->nWID == XATTR_FILLBITMAP || pEntry->nWID == XATTR_FILLGRADIENT || pEntry->nWID == XATTR_FILLHATCH || pEntry->nWID == XATTR_FILLFLOATTRANSPARENCE ) ) - { - OUString aName; - if(!(aValue >>= aName )) - throw lang::IllegalArgumentException(); + if( !aSet.Count() ) + aSet.Put( rPool.GetDefaultItem( pEntry->nWID ) ); - SvxShape::SetFillAttribute( pEntry->nWID, aName, aSet ); - } - else - { - SvxItemPropertySet_setPropertyValue( pEntry, aValue, aSet ); - } + if( pEntry->nMemberId == MID_NAME && ( pEntry->nWID == XATTR_FILLBITMAP || pEntry->nWID == XATTR_FILLGRADIENT || pEntry->nWID == XATTR_FILLHATCH || pEntry->nWID == XATTR_FILLFLOATTRANSPARENCE ) ) + { + OUString aName; + if(!(aValue >>= aName )) + throw lang::IllegalArgumentException(); - mpSet->Put( aSet ); + SvxShape::SetFillAttribute( pEntry->nWID, aName, aSet ); } else { - if(pEntry && pEntry->nWID) - mpPropSet->setPropertyValue( pEntry, aValue ); + SvxItemPropertySet_setPropertyValue( pEntry, aValue, aSet ); } + + mpSet->Put( aSet ); + } + else + { + if(pEntry && pEntry->nWID) + mpPropSet->setPropertyValue( pEntry, aValue ); } } @@ -267,44 +265,42 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyValue( const OUString& Propert { throw beans::UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this)); } - else + + if( mpSet ) { - if( mpSet ) + if( pEntry->nWID == OWN_ATTR_FILLBMP_MODE ) { - if( pEntry->nWID == OWN_ATTR_FILLBMP_MODE ) - { - const XFillBmpStretchItem* pStretchItem = mpSet->GetItem<XFillBmpStretchItem>(XATTR_FILLBMP_STRETCH); - const XFillBmpTileItem* pTileItem = mpSet->GetItem<XFillBmpTileItem>(XATTR_FILLBMP_TILE); + const XFillBmpStretchItem* pStretchItem = mpSet->GetItem<XFillBmpStretchItem>(XATTR_FILLBMP_STRETCH); + const XFillBmpTileItem* pTileItem = mpSet->GetItem<XFillBmpTileItem>(XATTR_FILLBMP_TILE); - if( pStretchItem && pTileItem ) - { - if( pTileItem->GetValue() ) - aAny <<= drawing::BitmapMode_REPEAT; - else if( pStretchItem->GetValue() ) - aAny <<= drawing::BitmapMode_STRETCH; - else - aAny <<= drawing::BitmapMode_NO_REPEAT; - } - } - else + if( pStretchItem && pTileItem ) { - SfxItemPool& rPool = *mpSet->GetPool(); - SfxItemSet aSet( rPool, {{pEntry->nWID, pEntry->nWID}}); - aSet.Put( *mpSet ); - - if( !aSet.Count() ) - aSet.Put( rPool.GetDefaultItem( pEntry->nWID ) ); - - // get value from ItemSet - aAny = SvxItemPropertySet_getPropertyValue( pEntry, aSet ); + if( pTileItem->GetValue() ) + aAny <<= drawing::BitmapMode_REPEAT; + else if( pStretchItem->GetValue() ) + aAny <<= drawing::BitmapMode_STRETCH; + else + aAny <<= drawing::BitmapMode_NO_REPEAT; } } else { - if(pEntry && pEntry->nWID) - aAny = mpPropSet->getPropertyValue( pEntry ); + SfxItemPool& rPool = *mpSet->GetPool(); + SfxItemSet aSet( rPool, {{pEntry->nWID, pEntry->nWID}}); + aSet.Put( *mpSet ); + + if( !aSet.Count() ) + aSet.Put( rPool.GetDefaultItem( pEntry->nWID ) ); + + // get value from ItemSet + aAny = SvxItemPropertySet_getPropertyValue( pEntry, aSet ); } } + else + { + if(pEntry && pEntry->nWID) + aAny = mpPropSet->getPropertyValue( pEntry ); + } return aAny; } |