diff options
author | Jan Holesovsky <kendy@collabora.com> | 2016-06-24 09:24:09 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2016-06-24 09:52:31 +0200 |
commit | 0c6806b03ac6dc6d5fde8bbede57985a2cad271f (patch) | |
tree | 68b20bce4607cb7bb9356ae5e799435b465b93b9 /sw/source/uibase/utlui | |
parent | dcdcbfef61b86688eb26a3382532e324d122d747 (diff) |
I suspect the condition was wrong here, change the logic slightly.
Change-Id: I232d81bce275ba08de5872d69856fe691f80d50c
Diffstat (limited to 'sw/source/uibase/utlui')
-rw-r--r-- | sw/source/uibase/utlui/tmplctrl.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sw/source/uibase/utlui/tmplctrl.cxx b/sw/source/uibase/utlui/tmplctrl.cxx index f5f2e56968da..3578e5fae214 100644 --- a/sw/source/uibase/utlui/tmplctrl.cxx +++ b/sw/source/uibase/utlui/tmplctrl.cxx @@ -74,13 +74,14 @@ SwTemplateControl::~SwTemplateControl() void SwTemplateControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) { - if( eState != SfxItemState::DEFAULT || dynamic_cast< const SfxVoidItem *>( pState ) != nullptr ) - GetStatusBar().SetItemText( GetId(), OUString() ); - else if ( dynamic_cast< const SfxStringItem *>( pState ) != nullptr ) + const SfxStringItem* pItem = nullptr; + if (SfxItemState::DEFAULT == eState && (pItem = dynamic_cast<const SfxStringItem*>(pState))) { - sTemplate = static_cast<const SfxStringItem*>(pState)->GetValue(); - GetStatusBar().SetItemText( GetId(), sTemplate ); + sTemplate = pItem->GetValue(); + GetStatusBar().SetItemText(GetId(), sTemplate); } + else + GetStatusBar().SetItemText(GetId(), OUString()); } void SwTemplateControl::Paint( const UserDrawEvent& ) |