summaryrefslogtreecommitdiff
path: root/sw/source/uibase/utlui
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2016-06-24 09:19:32 +0200
committerJan Holesovsky <kendy@collabora.com>2016-06-24 09:52:31 +0200
commitdcdcbfef61b86688eb26a3382532e324d122d747 (patch)
tree52faa227bd76e72fc5c2b8e71ba9313ebad6f381 /sw/source/uibase/utlui
parent25dafb5f83b7d3f1123690f35e540cec8df38d92 (diff)
Simplify dynamic_cast followed by a static_cast.
Change-Id: I50ffe014c37c100714d50c0568551ee4021cd9eb
Diffstat (limited to 'sw/source/uibase/utlui')
-rw-r--r--sw/source/uibase/utlui/zoomctrl.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/sw/source/uibase/utlui/zoomctrl.cxx b/sw/source/uibase/utlui/zoomctrl.cxx
index 5da5c9cd4664..c35d37de7084 100644
--- a/sw/source/uibase/utlui/zoomctrl.cxx
+++ b/sw/source/uibase/utlui/zoomctrl.cxx
@@ -43,10 +43,11 @@ SwZoomControl::~SwZoomControl()
void SwZoomControl::StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState )
{
- if(SfxItemState::DEFAULT == eState && dynamic_cast< const SfxStringItem *>( pState ) != nullptr)
+ const SfxStringItem* pItem = nullptr;
+ if (SfxItemState::DEFAULT == eState && (pItem = dynamic_cast<const SfxStringItem*>(pState)))
{
- sPreviewZoom = static_cast<const SfxStringItem*>(pState)->GetValue();
- GetStatusBar().SetItemText( GetId(), sPreviewZoom );
+ sPreviewZoom = pItem->GetValue();
+ GetStatusBar().SetItemText(GetId(), sPreviewZoom);
}
else
{
@@ -57,15 +58,15 @@ void SwZoomControl::StateChanged( sal_uInt16 nSID, SfxItemState eState,
void SwZoomControl::Paint( const UserDrawEvent& rUsrEvt )
{
- if(sPreviewZoom.isEmpty())
+ if (sPreviewZoom.isEmpty())
SvxZoomStatusBarControl::Paint(rUsrEvt);
else
- GetStatusBar().SetItemText( GetId(), sPreviewZoom );
+ GetStatusBar().SetItemText(GetId(), sPreviewZoom);
}
void SwZoomControl::Command( const CommandEvent& rCEvt )
{
- if(sPreviewZoom.isEmpty())
+ if (sPreviewZoom.isEmpty())
SvxZoomStatusBarControl::Command(rCEvt);
}