From 45e29fb694bf79ccbde2271dd62e941e2c5b325c Mon Sep 17 00:00:00 2001 From: Bart Hakvoort Date: Sat, 24 Dec 2005 13:31:09 +0000 Subject: [PATCH] replaced C-style cast with static_cast removed unnecessary 'int * src/TreeView_Detail.cc: replaced C-style cast with static_cast * src/VBox_VisualDisk.cc: removed unnecessary 'int ext_length' --- ChangeLog | 5 +++++ src/TreeView_Detail.cc | 4 ++-- src/VBox_VisualDisk.cc | 7 ++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19253b5e..b2ee8792 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-12-24 Bart Hakvoort + + * src/TreeView_Detail.cc: replaced C-style cast with static_cast + * src/VBox_VisualDisk.cc: removed unnecessary 'int ext_length' + 2005-12-24 Bart Hakvoort * include/TreeView_Detail.h, diff --git a/src/TreeView_Detail.cc b/src/TreeView_Detail.cc index 3a01dfc5..86565dda 100644 --- a/src/TreeView_Detail.cc +++ b/src/TreeView_Detail.cc @@ -122,7 +122,7 @@ void TreeView_Detail::create_row( const Gtk::TreeRow & treerow, const Partition treerow[ treeview_detail_columns .status_icon ] = render_icon( Gtk::Stock::DIALOG_AUTHENTICATION, Gtk::ICON_SIZE_BUTTON ); else if ( partition .error != "" ) treerow[ treeview_detail_columns .status_icon ] = render_icon( Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_BUTTON ); - + treerow[ treeview_detail_columns .partition ] = partition .partition; treerow[ treeview_detail_columns .color ] = Utils::get_color_as_pixbuf( partition .filesystem, 16, 16 ) ; @@ -171,7 +171,7 @@ void TreeView_Detail::on_selection_changed() { if ( ! block && treeselection ->get_selected() != 0 ) { - row = (Gtk::TreeRow) * treeselection ->get_selected() ; + row = static_cast( * treeselection ->get_selected() ) ; signal_partition_selected .emit( row[ treeview_detail_columns .partition_struct ], true ) ; } } diff --git a/src/VBox_VisualDisk.cc b/src/VBox_VisualDisk.cc index ef9e6cba..50bf8890 100644 --- a/src/VBox_VisualDisk.cc +++ b/src/VBox_VisualDisk.cc @@ -138,11 +138,8 @@ int VBox_VisualDisk::calc_length( std::vector & visual_partiti visual_partitions[ t ] .length = Utils::Round( length_px * visual_partitions[ t ] .fraction ) ; if ( visual_partitions[ t ] .logicals .size() > 0 ) - { - int ext_length = calc_length( visual_partitions[ t ] .logicals, visual_partitions[ t ] .length - (2 * BORDER) ) ; - - visual_partitions[ t ] .length = ext_length + (2 * BORDER) ; - } + visual_partitions[ t ] .length = + calc_length( visual_partitions[ t ] .logicals, visual_partitions[ t ] .length - (2 * BORDER) ) + (2 * BORDER) ; else if ( visual_partitions[ t ] .length < MIN_SIZE ) visual_partitions[ t ] .length = MIN_SIZE ;