diff options
author | Noel Grandin <noel@peralex.com> | 2015-01-17 13:12:52 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-03-11 10:16:52 +0200 |
commit | 82c37453482e6b8bd6ab7b7e96b1257a1d5b0699 (patch) | |
tree | 9620e5eff60e7cc5c3b3792a99793e687d78cd80 /forms/source | |
parent | d26052bdb267f042256c3fac34ebf4697dbc3ceb (diff) |
SfxItemHandle is only used in one place, so inline it
Change-Id: Ie54e0699312b6c072d2b162a068cffdf960be4d0
Diffstat (limited to 'forms/source')
-rw-r--r-- | forms/source/richtext/rtattributes.hxx | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/forms/source/richtext/rtattributes.hxx b/forms/source/richtext/rtattributes.hxx index 4ad754f18344..85f2c742dc76 100644 --- a/forms/source/richtext/rtattributes.hxx +++ b/forms/source/richtext/rtattributes.hxx @@ -45,7 +45,7 @@ namespace frm struct AttributeState { private: - SfxItemHandle* pItemHandle; + SfxPoolItem *pItemHandleItem; public: AttributeCheckState eSimpleState; @@ -64,19 +64,19 @@ namespace frm }; inline AttributeState::AttributeState( ) - :pItemHandle( NULL ) + :pItemHandleItem ( NULL ) ,eSimpleState( eIndetermined ) { } inline AttributeState::AttributeState( AttributeCheckState _eCheckState ) - :pItemHandle( NULL ) + :pItemHandleItem ( NULL ) ,eSimpleState( _eCheckState ) { } inline AttributeState::AttributeState( const AttributeState& _rSource ) - :pItemHandle( NULL ) + :pItemHandleItem ( NULL ) ,eSimpleState( eIndetermined ) { operator=( _rSource ); @@ -84,7 +84,7 @@ namespace frm inline AttributeState::~AttributeState( ) { - delete(pItemHandle); +// delete(pItemHandle); } inline AttributeState& AttributeState::operator=( const AttributeState& _rSource ) @@ -99,17 +99,17 @@ namespace frm inline const SfxPoolItem* AttributeState::getItem() const { - return pItemHandle ? &pItemHandle->GetItem() : NULL; + return pItemHandleItem; } inline void AttributeState::setItem( const SfxPoolItem* _pItem ) { - if ( pItemHandle ) - delete pItemHandle; + if ( pItemHandleItem ) + delete pItemHandleItem; if ( _pItem ) - pItemHandle = new SfxItemHandle( *const_cast< SfxPoolItem* >( _pItem ) ); + pItemHandleItem = _pItem->Clone(); else - pItemHandle = NULL; + pItemHandleItem = NULL; } inline bool AttributeState::operator==( const AttributeState& _rRHS ) @@ -117,16 +117,16 @@ namespace frm if ( eSimpleState != _rRHS.eSimpleState ) return false; - if ( pItemHandle && !_rRHS.pItemHandle ) + if ( pItemHandleItem && !_rRHS.pItemHandleItem ) return false; - if ( !pItemHandle && _rRHS.pItemHandle ) + if ( !pItemHandleItem && _rRHS.pItemHandleItem ) return false; - if ( !pItemHandle && !_rRHS.pItemHandle ) + if ( !pItemHandleItem && !_rRHS.pItemHandleItem ) return true; - return ( pItemHandle->GetItem() == _rRHS.pItemHandle->GetItem() ); + return pItemHandleItem == _rRHS.pItemHandleItem; } class IMultiAttributeDispatcher |