[EMAIL PROTECTED] wrote:
Author: younes
Date: Thu Jul 19 09:13:48 2007
New Revision: 19130

URL: http://www.lyx.org/trac/changeset/19130
Log:
Be on the safe side: replace static_cast<GuiWorkArea*> with 
dynamic_cast<GuiWorkArea*> in the Tab widget. We could well use tabs for other things 
than Work areas in the future...

@@ -835,7 +839,8 @@
 {
        if (d.tab_widget_->count() == 0)
                return 0;
-       return static_cast<GuiWorkArea *>(d.tab_widget_->currentWidget());
+       BOOST_ASSERT(dynamic_cast<GuiWorkArea const 
*>(d.tab_widget_->currentWidget()));
+       return dynamic_cast<GuiWorkArea const 
*>(d.tab_widget_->currentWidget());
 }

Assign the thing to a temporary pointer and BOOST_ASSERT that. Debug is slow enough already without having to do work twice.

Angus

Reply via email to