Converted all ASSERTs to REQUIREs
This commit is contained in:
parent
b75e6a982b
commit
33afd58b8e
10 changed files with 26 additions and 26 deletions
|
|
@ -44,7 +44,7 @@ NameChooser::NameChooser(Window &parent, Glib::ustring title,
|
|||
hBox.set_spacing(BoxSpacing);
|
||||
|
||||
VBox* const v_box = get_vbox();
|
||||
ASSERT(v_box != NULL);
|
||||
REQUIRE(v_box != NULL);
|
||||
v_box->pack_start(hBox);
|
||||
|
||||
// Configure the dialog
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ Render::Render(Window &parent) :
|
|||
videoFrame(_("Video"))
|
||||
{
|
||||
VBox *v_box = get_vbox();
|
||||
ASSERT(v_box != NULL);
|
||||
REQUIRE(v_box != NULL);
|
||||
|
||||
// The Output File Row
|
||||
outputFileHBox.pack_start(outputFileLabel, PACK_SHRINK);
|
||||
|
|
|
|||
|
|
@ -61,17 +61,17 @@ GdkDisplayer::put( void *image )
|
|||
video_x, video_y, video_width, video_height );
|
||||
|
||||
GdkWindow *window = drawingArea->get_window()->gobj();
|
||||
ASSERT(window != NULL);
|
||||
REQUIRE(window != NULL);
|
||||
|
||||
GdkGC *gc = gdk_gc_new( window );
|
||||
ASSERT(gc != NULL);
|
||||
REQUIRE(gc != NULL);
|
||||
|
||||
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data( (const guchar*)image, GDK_COLORSPACE_RGB, FALSE, 8,
|
||||
preferredWidth(), preferredHeight(), preferredWidth() * 3, NULL, NULL );
|
||||
ASSERT(pixbuf != NULL);
|
||||
REQUIRE(pixbuf != NULL);
|
||||
|
||||
GdkPixbuf *scaled_image = gdk_pixbuf_scale_simple( pixbuf, video_width, video_height, GDK_INTERP_NEAREST );
|
||||
ASSERT(scaled_image != NULL);
|
||||
REQUIRE(scaled_image != NULL);
|
||||
|
||||
gdk_draw_pixbuf( window, gc, scaled_image, 0, 0, video_x, video_y, -1, -1, GDK_RGB_DITHER_NORMAL, 0, 0 );
|
||||
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ void
|
|||
XvDisplayer::put( void *image )
|
||||
{
|
||||
REQUIRE(image != NULL);
|
||||
ASSERT(drawingArea != NULL);
|
||||
REQUIRE(drawingArea != NULL);
|
||||
|
||||
if(xvImage != NULL)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ void
|
|||
TimelinePanel::on_zoom_in()
|
||||
{
|
||||
TimelineWidget *const widget = get_current_page();
|
||||
ASSERT(widget != NULL);
|
||||
REQUIRE(widget != NULL);
|
||||
|
||||
widget->get_view_window().zoom_view(ZoomToolSteps);
|
||||
update_zoom_buttons();
|
||||
|
|
@ -170,7 +170,7 @@ void
|
|||
TimelinePanel::on_zoom_out()
|
||||
{
|
||||
TimelineWidget *const widget = get_current_page();
|
||||
ASSERT(widget != NULL);
|
||||
REQUIRE(widget != NULL);
|
||||
|
||||
widget->get_view_window().zoom_view(-ZoomToolSteps);
|
||||
update_zoom_buttons();
|
||||
|
|
@ -201,7 +201,7 @@ TimelinePanel::on_playback_period_drag_released()
|
|||
// real backend
|
||||
|
||||
TimelineWidget *const widget = get_current_page();
|
||||
ASSERT(widget != NULL);
|
||||
REQUIRE(widget != NULL);
|
||||
|
||||
widget->set_playback_point(widget->get_playback_period_start());
|
||||
//----- END TEST CODE
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ TimelineWidget::update_tracks()
|
|||
create_timeline_tracks();
|
||||
|
||||
// Update the header container
|
||||
ASSERT(headerContainer != NULL);
|
||||
REQUIRE(headerContainer != NULL);
|
||||
headerContainer->show_all_children();
|
||||
headerContainer->update_headers();
|
||||
|
||||
|
|
@ -308,7 +308,7 @@ TimelineWidget::update_tracks()
|
|||
BOOST_FOREACH(shared_ptr<model::Track> track,
|
||||
sequence->get_child_tracks())
|
||||
{
|
||||
ASSERT(track);
|
||||
REQUIRE(track);
|
||||
totalHeight += measure_branch_height(track);
|
||||
}
|
||||
}
|
||||
|
|
@ -456,7 +456,7 @@ TimelineWidget::lookup_model_track(
|
|||
void
|
||||
TimelineWidget::update_scroll()
|
||||
{
|
||||
ASSERT(body != NULL);
|
||||
REQUIRE(body != NULL);
|
||||
const Allocation body_allocation = body->get_allocation();
|
||||
|
||||
//----- Horizontal Scroll ------//
|
||||
|
|
@ -511,7 +511,7 @@ TimelineWidget::measure_branch_height(
|
|||
BOOST_FOREACH( shared_ptr<model::Track> child,
|
||||
model_track->get_child_tracks() )
|
||||
{
|
||||
ASSERT(child != NULL);
|
||||
REQUIRE(child);
|
||||
height += measure_branch_height(child);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ TimelineBody::draw_track_recursive(Cairo::RefPtr<Cairo::Context> cr,
|
|||
lookup_timeline_track(model_track);
|
||||
|
||||
const int height = timeline_track->get_height();
|
||||
ASSERT(height >= 0);
|
||||
REQUIRE(height >= 0);
|
||||
|
||||
// Draw the track background
|
||||
cr->rectangle(0, 0, view_width, height);
|
||||
|
|
@ -453,7 +453,7 @@ shared_ptr<timeline::Track> TimelineBody::track_from_branch(
|
|||
lookup_timeline_track(model_track);
|
||||
|
||||
const int height = timeline_track->get_height();
|
||||
ASSERT(height >= 0);
|
||||
REQUIRE(height >= 0);
|
||||
|
||||
// Does the point fall in this track?
|
||||
if(offset <= y && y < offset + height)
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ TimelineHeaderContainer::forall_vfunc(gboolean /* include_internals */,
|
|||
|
||||
BOOST_FOREACH( shared_ptr<model::Track> track, get_tracks() )
|
||||
{
|
||||
ASSERT(track != NULL);
|
||||
REQUIRE(track);
|
||||
forall_vfunc_recursive(track, callback, callback_data);
|
||||
}
|
||||
}
|
||||
|
|
@ -275,7 +275,7 @@ TimelineHeaderContainer::on_expose_event(GdkEventExpose *event)
|
|||
BOOST_FOREACH( shared_ptr<model::Track> model_track,
|
||||
get_tracks() )
|
||||
{
|
||||
ASSERT(model_track != NULL);
|
||||
REQUIRE(model_track);
|
||||
|
||||
draw_header_decoration(model_track,
|
||||
Gdk::Rectangle(0, 0,
|
||||
|
|
@ -354,7 +354,7 @@ TimelineHeaderContainer::layout_headers_recursive(
|
|||
offset, // y
|
||||
max( header_width - indent, 0 ), // width
|
||||
track_height); // height
|
||||
ASSERT(header_box.get_height() >= 0);
|
||||
REQUIRE(header_box.get_height() >= 0);
|
||||
|
||||
// Cache the bounding box
|
||||
headerBoxes[timeline_track] = header_box;
|
||||
|
|
@ -448,14 +448,14 @@ TimelineHeaderContainer::draw_header_decoration(
|
|||
REQUIRE(clip_rect.get_height() > 0);
|
||||
|
||||
Glib::RefPtr<Style> style = get_style();
|
||||
ASSERT(style);
|
||||
REQUIRE(style);
|
||||
|
||||
shared_ptr<timeline::Track> timeline_track =
|
||||
lookup_timeline_track(model_track);
|
||||
|
||||
// Get the cached header box
|
||||
weak_ptr<timeline::Track> ptr(timeline_track);
|
||||
ASSERT(contains(headerBoxes, ptr));
|
||||
REQUIRE(contains(headerBoxes, ptr));
|
||||
const Gdk::Rectangle &box = headerBoxes[timeline_track];
|
||||
|
||||
// Paint the box, if it will be visible
|
||||
|
|
@ -543,7 +543,7 @@ TimelineHeaderContainer::get_expander_button_rectangle(
|
|||
{
|
||||
REQUIRE(track != NULL);
|
||||
weak_ptr<timeline::Track> ptr(track);
|
||||
ASSERT(contains(headerBoxes, ptr));
|
||||
REQUIRE(contains(headerBoxes, ptr));
|
||||
|
||||
const Gdk::Rectangle &box = headerBoxes[track];
|
||||
return Gdk::Rectangle(
|
||||
|
|
|
|||
|
|
@ -110,8 +110,8 @@ Track::on_remove_track()
|
|||
{
|
||||
shared_ptr<model::Track> model_track =
|
||||
timelineWidget.lookup_model_track(this);
|
||||
ASSERT(model_track);
|
||||
ASSERT(timelineWidget.sequence);
|
||||
REQUIRE(model_track);
|
||||
REQUIRE(timelineWidget.sequence);
|
||||
|
||||
timelineWidget.sequence->get_child_track_list().remove(model_track);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,13 +141,13 @@ WorkspaceWindow::create_ui()
|
|||
|
||||
//----- Set up the Menu Bar -----//
|
||||
Gtk::Widget* menu_bar = uiManager->get_widget("/MenuBar");
|
||||
ASSERT(menu_bar != NULL);
|
||||
REQUIRE(menu_bar != NULL);
|
||||
baseContainer.pack_start(*menu_bar, Gtk::PACK_SHRINK);
|
||||
|
||||
//----- Set up the Tool Bar -----//
|
||||
Gtk::Toolbar* toolbar = dynamic_cast<Gtk::Toolbar*>(
|
||||
uiManager->get_widget("/ToolBar"));
|
||||
ASSERT(toolbar != NULL);
|
||||
REQUIRE(toolbar != NULL);
|
||||
toolbar->set_toolbar_style(TOOLBAR_ICONS);
|
||||
baseContainer.pack_start(*toolbar, Gtk::PACK_SHRINK);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue