[Libreoffice-commits] core.git: sw/source

Jan Holesovsky kendy at collabora.com
Thu Jul 14 09:30:27 UTC 2016


 sw/source/uibase/utlui/navipi.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 53d18f277227c957d9c7370d423e4cd2a69649bf
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Thu Jul 14 10:54:21 2016 +0200

    Simplify dynamic_cast followed by a static_cast.
    
    Change-Id: Id4ab82db5e0ac95e26299730797a6eac0f925fb8

diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 2d66ac1..31827ae 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -972,21 +972,21 @@ void SwNavigationPI::Notify( SfxBroadcaster& rBrdc, const SfxHint& rHint )
 {
     if(&rBrdc == m_pCreateView)
     {
-        if(dynamic_cast<const SfxSimpleHint*>(&rHint) && static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING)
+        const SfxSimpleHint* pHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+        if (pHint && pHint->GetId() == SFX_HINT_DYING)
         {
             m_pCreateView = nullptr;
         }
     }
     else
     {
-        if(dynamic_cast<const SfxEventHint*>(&rHint))
+        if (const SfxEventHint* pHint = dynamic_cast<const SfxEventHint*>(&rHint))
         {
-            if( m_pxObjectShell &&
-                        static_cast<const SfxEventHint&>( rHint).GetEventId() == SFX_EVENT_CLOSEAPP)
+            if (m_pxObjectShell && pHint->GetEventId() == SFX_EVENT_CLOSEAPP)
             {
                 DELETEZ(m_pxObjectShell);
             }
-            else if(static_cast<const SfxEventHint&>( rHint).GetEventId() == SFX_EVENT_OPENDOC)
+            else if (pHint->GetEventId() == SFX_EVENT_OPENDOC)
             {
 
                 SwView *pActView = GetCreateView();


More information about the Libreoffice-commits mailing list