Kaydet (Commit) b4861b60 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

Simplify dynamic_cast followed by a static_cast.

Change-Id: Iec55b1d2e290e2bcc0286225b6f731314f058625
üst 336beb8b
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment