diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-07-16 21:38:16 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-07-16 21:38:16 +0000 |
| commit | d80050f0b63965cb3b2b70317cae4981c688708e (patch) | |
| tree | c7f8bd2cfe10bc82b5c71bd39d865a7e25324a43 /src/ui | |
| parent | update to latest 2geom (rev1497) (diff) | |
| download | inkscape-d80050f0b63965cb3b2b70317cae4981c688708e.tar.gz inkscape-d80050f0b63965cb3b2b70317cae4981c688708e.zip | |
fix combo enum, to handle enums of all types (not only the ones that range from 0..10)
(bzr r6333)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/filter-effects-dialog.cpp | 12 | ||||
| -rw-r--r-- | src/ui/widget/combo-enums.h | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index 1ded9e255..2cec40860 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -1467,7 +1467,7 @@ int FilterEffectsDialog::PrimitiveList::init_text() _vertical_layout = Pango::Layout::create(context); int maxfont = 0; - for(int i = 0; i < FPInputConverter.end; ++i) { + for(unsigned int i = 0; i < FPInputConverter._length; ++i) { _vertical_layout->set_text(_(FPInputConverter.get_label((FilterPrimitiveInput)i).c_str())); int fontw, fonth; _vertical_layout->get_pixel_size(fontw, fonth); @@ -1591,8 +1591,8 @@ bool FilterEffectsDialog::PrimitiveList::on_expose_signal(GdkEventExpose* e) int vis_x, vis_y; tree_to_widget_coords(vis.get_x(), vis.get_y(), vis_x, vis_y); - text_start_x = rct.get_x() + rct.get_width() - _connection_cell.get_text_width() * (FPInputConverter.end + 1) + 1; - for(int i = 0; i < FPInputConverter.end; ++i) { + text_start_x = rct.get_x() + rct.get_width() - _connection_cell.get_text_width() * (FPInputConverter._length + 1) + 1; + for(unsigned int i = 0; i < FPInputConverter._length; ++i) { _vertical_layout->set_text(_(FPInputConverter.get_label((FilterPrimitiveInput)i).c_str())); const int x = text_start_x + _connection_cell.get_text_width() * (i + 1); get_bin_window()->draw_rectangle(get_style()->get_bg_gc(Gtk::STATE_NORMAL), true, x, vis_y, _connection_cell.get_text_width(), vis.get_height()); @@ -1898,13 +1898,13 @@ bool FilterEffectsDialog::PrimitiveList::on_button_release_event(GdkEventButton* Gdk::Rectangle rct; get_cell_area(path, *col, rct); const int twidth = _connection_cell.get_text_width(); - const int sources_x = rct.get_width() - twidth * FPInputConverter.end; + const int sources_x = rct.get_width() - twidth * FPInputConverter._length; if(cx > sources_x) { int src = (cx - sources_x) / twidth; if(src < 0) src = 0; - else if(src >= FPInputConverter.end) - src = FPInputConverter.end - 1; + else if(src >= FPInputConverter._length) + src = FPInputConverter._length - 1; result = FPInputConverter.get_key((FilterPrimitiveInput)src); in_val = result.c_str(); } diff --git a/src/ui/widget/combo-enums.h b/src/ui/widget/combo-enums.h index cab93f557..11640f3ca 100644 --- a/src/ui/widget/combo-enums.h +++ b/src/ui/widget/combo-enums.h @@ -37,7 +37,7 @@ public: pack_start(_columns.label); // Initialize list - for(int i = 0; i < _converter.end; ++i) { + for(int i = 0; i < _converter._length; ++i) { Gtk::TreeModel::Row row = *_model->append(); const Util::EnumData<E>* data = &_converter.data(i); row[_columns.data] = data; @@ -57,7 +57,7 @@ public: pack_start(_columns.label); // Initialize list - for(int i = 0; i < _converter.end; ++i) { + for(unsigned int i = 0; i < _converter._length; ++i) { Gtk::TreeModel::Row row = *_model->append(); const Util::EnumData<E>* data = &_converter.data(i); row[_columns.data] = data; @@ -76,7 +76,7 @@ public: setProgrammatically = true; const gchar* val = attribute_value(o); if(val) - set_active(_converter.get_id_from_key(val)); + set_active_by_id(_converter.get_id_from_key(val)); else set_active(get_default()->as_uint()); } |
