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

Jan Holesovsky kendy at collabora.com
Wed Jun 22 06:25:51 UTC 2016


 vcl/source/app/vclevent.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b4861b60b2f6d7ffd9efcd8e028e2578da4b464f
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Jun 22 08:24:30 2016 +0200

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

diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx
index da87732..4786fd6 100644
--- a/vcl/source/app/vclevent.cxx
+++ b/vcl/source/app/vclevent.cxx
@@ -49,9 +49,9 @@ void VclEventListeners::Call( VclSimpleEvent& rEvent ) const
     std::vector<Link<VclSimpleEvent&,void>> aCopy( m_aListeners );
     std::vector<Link<VclSimpleEvent&,void>>::iterator aIter( aCopy.begin() );
     std::vector<Link<VclSimpleEvent&,void>>::const_iterator aEnd( aCopy.end() );
-    if( dynamic_cast<const VclWindowEvent*>( &rEvent ) != nullptr )
+    if (VclWindowEvent* pWindowEvent = dynamic_cast<VclWindowEvent*>(&rEvent))
     {
-        VclPtr<vcl::Window> xWin((static_cast<VclWindowEvent*>(&rEvent))->GetWindow());
+        VclPtr<vcl::Window> xWin(pWindowEvent->GetWindow());
         while ( aIter != aEnd && xWin && ! xWin->IsDisposed() )
         {
             Link<VclSimpleEvent&,void> &rLink = *aIter;


More information about the Libreoffice-commits mailing list