diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-12-14 17:29:37 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-12-14 17:29:37 +0100 |
commit | f88576cb1985ea5abccaadb5624c39a99795d7d8 (patch) | |
tree | 1c597e7fec7133ff3e33fdd1e6fa375de73a367d /sw | |
parent | 1c035f1b0eb6f5e5fbb6c54bf2eea9a6c983eb8f (diff) |
Move var decl to where it gets actually used
Change-Id: I8f9e74f7fbbff055c67cafba5d534db4635e5399
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/access/accframebase.cxx | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx index dcd7e577e0e6..541ac25caba2 100644 --- a/sw/source/core/access/accframebase.cxx +++ b/sw/source/core/access/accframebase.cxx @@ -215,33 +215,35 @@ SwAccessibleFrameBase::~SwAccessibleFrameBase() void SwAccessibleFrameBase::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ; - const SwFlyFrame *pFlyFrame = static_cast< const SwFlyFrame * >( GetFrame() ); switch( nWhich ) { case RES_NAME_CHANGED: - if( pFlyFrame ) { - const SwFrameFormat *pFrameFormat = pFlyFrame->GetFormat(); - assert(pFrameFormat == GetRegisteredIn() && "invalid frame"); + const SwFlyFrame *pFlyFrame = static_cast< const SwFlyFrame * >( GetFrame() ); + if( pFlyFrame ) + { + const SwFrameFormat *pFrameFormat = pFlyFrame->GetFormat(); + assert(pFrameFormat == GetRegisteredIn() && "invalid frame"); - const OUString sOldName( GetName() ); - assert( !pOld || - static_cast<const SwStringMsgPoolItem *>(pOld)->GetString() == GetName()); + const OUString sOldName( GetName() ); + assert( !pOld || + static_cast<const SwStringMsgPoolItem *>(pOld)->GetString() == GetName()); - SetName( pFrameFormat->GetName() ); - assert( !pNew || - static_cast<const SwStringMsgPoolItem *>(pNew)->GetString() == GetName()); + SetName( pFrameFormat->GetName() ); + assert( !pNew || + static_cast<const SwStringMsgPoolItem *>(pNew)->GetString() == GetName()); - if( sOldName != GetName() ) - { - AccessibleEventObject aEvent; - aEvent.EventId = AccessibleEventId::NAME_CHANGED; - aEvent.OldValue <<= sOldName; - aEvent.NewValue <<= GetName(); - FireAccessibleEvent( aEvent ); + if( sOldName != GetName() ) + { + AccessibleEventObject aEvent; + aEvent.EventId = AccessibleEventId::NAME_CHANGED; + aEvent.OldValue <<= sOldName; + aEvent.NewValue <<= GetName(); + FireAccessibleEvent( aEvent ); + } } + break; } - break; case RES_OBJECTDYING: // mba: it seems that this class intentionally does not call code in base class SwClient if( pOld && ( GetRegisteredIn() == static_cast< SwModify *>( static_cast< const SwPtrMsgPoolItem * >( pOld )->pObject ) ) ) |