Mercurial > hg > octave-terminal
changeset 13815:0aba6f90f5f8
maint: __init_fltk__.cc style fixes
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 04 Nov 2011 05:51:53 -0400 |
parents | a45535d630bd |
children | 7ee18dc46bbb |
files | src/DLD-FUNCTIONS/__init_fltk__.cc |
diffstat | 1 files changed, 188 insertions(+), 199 deletions(-) [+] |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/__init_fltk__.cc +++ b/src/DLD-FUNCTIONS/__init_fltk__.cc @@ -263,7 +263,7 @@ int n = 0; for (int t = 0; t < len; t++ ) { - const Fl_Menu_Item *m = static_cast<const Fl_Menu_Item*>(&(menubar->menu ()[t])); + const Fl_Menu_Item *m = static_cast<const Fl_Menu_Item*> (&(menubar->menu ()[t])); if ((m->label () != NULL) && m->visible ()) n++; } @@ -286,7 +286,7 @@ return menubar->visible (); } - int find_index_by_name (std::string findname) + int find_index_by_name (const std::string& findname) { // This function is derived from Greg Ercolano's function // int GetIndexByName(...), see: @@ -297,7 +297,7 @@ std::string menupath; for (int t = 0; t < menubar->size (); t++ ) { - Fl_Menu_Item *m = const_cast<Fl_Menu_Item*>(&(menubar->menu ()[t])); + Fl_Menu_Item *m = const_cast<Fl_Menu_Item*> (&(menubar->menu ()[t])); if (m->submenu ()) { // item has submenu @@ -358,7 +358,7 @@ { graphics_object kidgo = gh_manager::get_object (uimenu_childs (ii)); - if (kidgo.valid_object() && kidgo.isa ("uimenu")) + if (kidgo.valid_object () && kidgo.isa ("uimenu")) { uimenu_childs(k) = uimenu_childs(ii); pos(k++) = @@ -378,7 +378,7 @@ return retval; } - void delete_entry(uimenu::properties& uimenup) + void delete_entry (uimenu::properties& uimenup) { std::string fltk_label = uimenup.get_fltk_label (); int idx = find_index_by_name (fltk_label.c_str ()); @@ -392,7 +392,7 @@ std::string fltk_label = uimenup.get_fltk_label (); if (!fltk_label.empty ()) { - Fl_Menu_Item* item = const_cast<Fl_Menu_Item*>(menubar->find_item (fltk_label.c_str ())); + Fl_Menu_Item* item = const_cast<Fl_Menu_Item*> (menubar->find_item (fltk_label.c_str ())); if (item != NULL) { std::string acc = uimenup.get_accelerator (); @@ -410,14 +410,14 @@ std::string fltk_label = uimenup.get_fltk_label (); if (!fltk_label.empty ()) { - Fl_Menu_Item* item = const_cast<Fl_Menu_Item*>(menubar->find_item (fltk_label.c_str ())); + Fl_Menu_Item* item = const_cast<Fl_Menu_Item*> (menubar->find_item (fltk_label.c_str ())); if (item != NULL) { if (!uimenup.get_callback ().is_empty ()) - item->callback(static_cast<Fl_Callback*>(script_cb), //callback - static_cast<void*>(&uimenup)); //callback data + item->callback (static_cast<Fl_Callback*> (script_cb), + static_cast<void*> (&uimenup)); else - item->callback(NULL, static_cast<void*>(0)); + item->callback (NULL, static_cast<void*> (0)); } } } @@ -427,7 +427,7 @@ std::string fltk_label = uimenup.get_fltk_label (); if (!fltk_label.empty ()) { - Fl_Menu_Item* item = const_cast<Fl_Menu_Item*>(menubar->find_item (fltk_label.c_str ())); + Fl_Menu_Item* item = const_cast<Fl_Menu_Item*> (menubar->find_item (fltk_label.c_str ())); if (item != NULL) { if (uimenup.is_enable ()) @@ -443,7 +443,7 @@ std::string fltk_label = uimenup.get_fltk_label (); if (!fltk_label.empty ()) { - Fl_Menu_Item* item = const_cast<Fl_Menu_Item*>(menubar->find_item (fltk_label.c_str ())); + Fl_Menu_Item* item = const_cast<Fl_Menu_Item*> (menubar->find_item (fltk_label.c_str ())); if (item != NULL) { Matrix rgb = uimenup.get_foregroundcolor_rgb (); @@ -457,7 +457,7 @@ } } - void update_seperator (uimenu::properties& uimenup) + void update_seperator (const uimenu::properties& uimenup) { // Matlab places the separator before the current // menu entry, while fltk places it after. So we need to find @@ -466,17 +466,17 @@ if (!fltk_label.empty ()) { int itemflags = 0, idx; - int curr_idx = find_index_by_name(fltk_label.c_str ()); + int curr_idx = find_index_by_name (fltk_label.c_str ()); for (idx = curr_idx - 1; idx >= 0; idx--) { - Fl_Menu_Item* item = const_cast<Fl_Menu_Item*>(&menubar->menu () [idx]); + Fl_Menu_Item* item = const_cast<Fl_Menu_Item*> (&menubar->menu () [idx]); itemflags = item->flags; if (item->label () != NULL) break; } - if ((idx >= 0) && (idx < menubar->size ())) + if (idx >= 0 && idx < menubar->size ()) { if (uimenup.is_separator ()) { @@ -494,7 +494,8 @@ std::string fltk_label = uimenup.get_fltk_label (); if (!fltk_label.empty ()) { - Fl_Menu_Item* item = const_cast<Fl_Menu_Item*>(menubar->find_item (fltk_label.c_str ())); + Fl_Menu_Item* item + = const_cast<Fl_Menu_Item*> (menubar->find_item (fltk_label.c_str ())); if (item != NULL) { if (uimenup.is_visible ()) @@ -515,7 +516,8 @@ bool item_added = false; do { - const Fl_Menu_Item* item = menubar->find_item(fltk_label.c_str ()); + const Fl_Menu_Item* item + = menubar->find_item (fltk_label.c_str ()); if (item == NULL) { @@ -524,9 +526,9 @@ int flags = 0; if (len > 0) flags = FL_SUBMENU; - if ((len == 0) && (uimenup.is_checked ())) + if (len == 0 && uimenup.is_checked ()) flags += FL_MENU_TOGGLE + FL_MENU_VALUE; - menubar->add(fltk_label.c_str (), 0, 0, 0, flags); + menubar->add (fltk_label.c_str (), 0, 0, 0, flags); item_added = true; } else @@ -539,9 +541,9 @@ if (len > 0) { std::string valstr = fltk_label.substr (idx1 + 1, len - 1); - fltk_label.erase(idx1, len + 1); + fltk_label.erase (idx1, len + 1); val = atoi (valstr.c_str ()); - if ((val > 0) && (val < 99)) + if (val > 0 && val < 99) val++; } std::ostringstream valstream; @@ -573,7 +575,7 @@ graphics_object kgo = gh_manager::get_object (kids (len - (ii + 1))); if (kgo.valid_object ()) { - uimenu::properties& kprop = dynamic_cast<uimenu::properties&>(kgo.get_properties ()); + uimenu::properties& kprop = dynamic_cast<uimenu::properties&> (kgo.get_properties ()); add_to_menu (kprop); } } @@ -590,7 +592,7 @@ if (kgo.valid_object ()) { - uimenu::properties& kprop = dynamic_cast<uimenu::properties&>(kgo.get_properties ()); + uimenu::properties& kprop = dynamic_cast<uimenu::properties&> (kgo.get_properties ()); add_to_menu (kprop); } } @@ -610,18 +612,18 @@ if (kgo.valid_object ()) { - uimenu::properties kprop = dynamic_cast<uimenu::properties&>(kgo.get_properties ()); + uimenu::properties kprop = dynamic_cast<uimenu::properties&> (kgo.get_properties ()); remove_from_menu (kprop); } } - if (type.compare("uimenu") == 0) - delete_entry(dynamic_cast<uimenu::properties&>(prop)); - else if (type.compare("figure") == 0) + if (type.compare ("uimenu") == 0) + delete_entry (dynamic_cast<uimenu::properties&> (prop)); + else if (type.compare ("figure") == 0) menubar->clear (); } - ~fltk_uimenu() + ~fltk_uimenu (void) { delete menubar; } @@ -652,75 +654,46 @@ begin (); { - canvas = new - OpenGL_fltk (0, 0, ww , hh - status_h, number ()); + canvas = new OpenGL_fltk (0, 0, ww, hh - status_h, number ()); - uimenu = new - fltk_uimenu(0, 0, ww, menu_h); + uimenu = new fltk_uimenu (0, 0, ww, menu_h); uimenu->hide (); - bottom = new - Fl_Box (0, - hh - status_h, - ww, - status_h); + bottom = new Fl_Box (0, hh - status_h, ww, status_h); bottom->box(FL_FLAT_BOX); ndim = calc_dimensions (gh_manager::get_object (fp.get___myhandle__ ())); - autoscale = new - Fl_Button (0, - hh - status_h, - status_h, - status_h, - "A"); + autoscale = new Fl_Button (0, hh - status_h, status_h, status_h, "A"); autoscale->callback (button_callback, static_cast<void*> (this)); autoscale->tooltip ("Autoscale"); - togglegrid = new - Fl_Button (status_h, - hh - status_h, - status_h, - status_h, - "G"); + togglegrid = new Fl_Button (status_h, hh - status_h, status_h, + status_h, "G"); togglegrid->callback (button_callback, static_cast<void*> (this)); togglegrid->tooltip ("Toggle Grid"); - panzoom = new - Fl_Button (2 * status_h, - hh - status_h, - status_h, - status_h, - "P"); + panzoom = new Fl_Button (2 * status_h, hh - status_h, status_h, + status_h, "P"); panzoom->callback (button_callback, static_cast<void*> (this)); panzoom->tooltip ("Mouse Pan/Zoom"); - rotate = new - Fl_Button (3 * status_h, - hh - status_h, - status_h, - status_h, - "R"); + rotate = new Fl_Button (3 * status_h, hh - status_h, status_h, + status_h, "R"); rotate->callback (button_callback, static_cast<void*> (this)); rotate->tooltip ("Mouse Rotate"); if (ndim == 2) rotate->deactivate (); - help = new - Fl_Button (4 * status_h, - hh - status_h, - status_h, - status_h, - "?"); + help = new Fl_Button (4 * status_h, hh - status_h, status_h, + status_h, "?"); help->callback (button_callback, static_cast<void*> (this)); help->tooltip ("Help"); - status = new - Fl_Output (5 * status_h, - hh - status_h, - ww > 2*status_h ? ww - status_h : 0, - status_h, ""); + status = new Fl_Output (5 * status_h, hh - status_h, + ww > 2*status_h ? ww - status_h : 0, + status_h, ""); status->textcolor (FL_BLACK); status->color (FL_GRAY); @@ -807,7 +780,7 @@ } } - void uimenu_update(graphics_handle gh, int id) + void uimenu_update (const graphics_handle& gh, int id) { graphics_object uimenu_obj = gh_manager::get_object (gh); @@ -815,51 +788,60 @@ { uimenu::properties& uimenup = dynamic_cast<uimenu::properties&> (uimenu_obj.get_properties ()); - std::string fltk_label = uimenup.get_fltk_label(); - graphics_object fig = uimenu_obj.get_ancestor("figure"); + std::string fltk_label = uimenup.get_fltk_label (); + graphics_object fig = uimenu_obj.get_ancestor ("figure"); figure::properties& figp = dynamic_cast<figure::properties&> (fig.get_properties ()); - switch(id) + switch (id) { - case base_properties::ID_BEINGDELETED: - uimenu->remove_from_menu (uimenup); - break; - case base_properties::ID_VISIBLE: - uimenu->update_visible (uimenup); - break; - case uimenu::properties::ID_ACCELERATOR: - uimenu->update_accelerator (uimenup); - break; - case uimenu::properties::ID_CALLBACK: - uimenu->update_callback (uimenup); - break; - case uimenu::properties::ID_CHECKED: - uimenu->add_to_menu (figp);//rebuilding entire menu - break; - case uimenu::properties::ID_ENABLE: - uimenu->update_enable (uimenup); - break; - case uimenu::properties::ID_FOREGROUNDCOLOR: - uimenu->update_foregroundcolor (uimenup); - break; - case uimenu::properties::ID_LABEL: - uimenu->add_to_menu (figp);//rebuilding entire menu - break; - case uimenu::properties::ID_POSITION: - uimenu->add_to_menu (figp);//rebuilding entire menu - break; - case uimenu::properties::ID_SEPARATOR: - uimenu->update_seperator (uimenup); - break; + case base_properties::ID_BEINGDELETED: + uimenu->remove_from_menu (uimenup); + break; + + case base_properties::ID_VISIBLE: + uimenu->update_visible (uimenup); + break; + + case uimenu::properties::ID_ACCELERATOR: + uimenu->update_accelerator (uimenup); + break; + + case uimenu::properties::ID_CALLBACK: + uimenu->update_callback (uimenup); + break; + + case uimenu::properties::ID_CHECKED: + uimenu->add_to_menu (figp);//rebuilding entire menu + break; + + case uimenu::properties::ID_ENABLE: + uimenu->update_enable (uimenup); + break; + + case uimenu::properties::ID_FOREGROUNDCOLOR: + uimenu->update_foregroundcolor (uimenup); + break; + + case uimenu::properties::ID_LABEL: + uimenu->add_to_menu (figp);//rebuilding entire menu + break; + + case uimenu::properties::ID_POSITION: + uimenu->add_to_menu (figp);//rebuilding entire menu + break; + + case uimenu::properties::ID_SEPARATOR: + uimenu->update_seperator (uimenup); + break; } - if (uimenu->items_to_show ()) - show_menubar (); - else - hide_menubar (); + if (uimenu->items_to_show ()) + show_menubar (); + else + hide_menubar (); - mark_modified(); + mark_modified(); } } @@ -885,7 +867,7 @@ if (ndim == 3) rotate->activate (); - else if ((ndim == 2) && (gui_mode == rotate_zoom)) + else if (ndim == 2 && gui_mode == rotate_zoom) { rotate->deactivate (); gui_mode = pan_zoom; @@ -986,14 +968,14 @@ mark_modified (); } - void pixel2pos - (graphics_handle ax, int px, int py, double& xx, double& yy) const + void pixel2pos (const graphics_handle& ax, int px, int py, double& xx, + double& yy) const { pixel2pos ( gh_manager::get_object (ax), px, py, xx, yy); } - void pixel2pos - (graphics_object ax, int px, int py, double& xx, double& yy) const + void pixel2pos (graphics_object ax, int px, int py, double& xx, + double& yy) const { if (ax && ax.isa ("axes")) { @@ -1033,7 +1015,7 @@ return fp.get_currentaxes (); } - void pixel2status (graphics_handle ax, int px0, int py0, + void pixel2status (const graphics_handle& ax, int px0, int py0, int px1 = -1, int py1 = -1) { pixel2status (gh_manager::get_object (ax), px0, py0, px1, py1); @@ -1068,7 +1050,7 @@ cbuf.precision (4); cbuf.width (6); Matrix v (1,2,0); - v = ap.get("view").matrix_value(); + v = ap.get ("view").matrix_value (); cbuf << "[azimuth: " << v(0) << ", elevation: " << v(1) << "]"; status->value (cbuf.str ().c_str ()); @@ -1165,7 +1147,7 @@ void draw (void) { Matrix pos = fp.get_position ().matrix_value (); - Fl_Window::resize (pos(0), pos(1) , pos(2), pos(3) + status_h + menu_h); + Fl_Window::resize (pos(0), pos(1), pos(2), pos(3) + status_h + menu_h); return Fl_Window::draw (); } @@ -1181,7 +1163,7 @@ int retval = Fl_Window::handle (event); // We only handle events which are in the canvas area. - if (!Fl::event_inside(canvas)) + if (!Fl::event_inside (canvas)) return retval; if (!fp.is_beingdeleted ()) @@ -1363,9 +1345,9 @@ { axes::properties& ap = dynamic_cast<axes::properties&> (ax0.get_properties ()); - ap.set_xlimmode("auto"); - ap.set_ylimmode("auto"); - ap.set_zlimmode("auto"); + ap.set_xlimmode ("auto"); + ap.set_ylimmode ("auto"); + ap.set_zlimmode ("auto"); mark_modified (); } } @@ -1462,7 +1444,7 @@ instance->do_delete_window (idx); } - static void delete_window (std::string idx_str) + static void delete_window (const std::string& idx_str) { delete_window (str2idx (idx_str)); } @@ -1473,7 +1455,8 @@ instance->do_toggle_window_visibility (idx, is_visible); } - static void toggle_window_visibility (std::string idx_str, bool is_visible) + static void toggle_window_visibility (const std::string& idx_str, + bool is_visible) { toggle_window_visibility (str2idx (idx_str), is_visible); } @@ -1495,7 +1478,7 @@ instance->do_set_name (idx); } - static void set_name (std::string idx_str) + static void set_name (const std::string& idx_str) { set_name (str2idx (idx_str)); } @@ -1510,22 +1493,25 @@ return get_size (hnd2idx (gh)); } - static void print (const graphics_handle& gh , const std::string& cmd, const std::string& term) + static void print (const graphics_handle& gh, const std::string& cmd, + const std::string& term) { if (instance_ok ()) - instance->do_print (hnd2idx(gh), cmd, term); + instance->do_print (hnd2idx (gh), cmd, term); } - static void uimenu_update (const graphics_handle& figh, const graphics_handle& uimenuh, const int id) + static void uimenu_update (const graphics_handle& figh, + const graphics_handle& uimenuh, int id) { if (instance_ok ()) - instance->do_uimenu_update (hnd2idx(figh), uimenuh, id); + instance->do_uimenu_update (hnd2idx (figh), uimenuh, id); } - static void update_canvas (const graphics_handle& gh, const graphics_handle& ca) + static void update_canvas (const graphics_handle& gh, + const graphics_handle& ca) { if (instance_ok ()) - instance->do_update_canvas (hnd2idx(gh), ca); + instance->do_update_canvas (hnd2idx (gh), ca); } static void toggle_menubar_visibility (int fig_idx, bool menubar_is_figure) @@ -1534,7 +1520,8 @@ instance->do_toggle_menubar_visibility (fig_idx, menubar_is_figure); } - static void toggle_menubar_visibility (std::string fig_idx_str, bool menubar_is_figure) + static void toggle_menubar_visibility (const std::string& fig_idx_str, + bool menubar_is_figure) { toggle_menubar_visibility (str2idx (fig_idx_str), menubar_is_figure); } @@ -1579,7 +1566,7 @@ int w = pos(2); int h = pos(3); - idx2figprops (curr_index , fp); + idx2figprops (curr_index, fp); windows[curr_index++] = new plot_window (x, y, w, h, fp); } @@ -1587,8 +1574,9 @@ void do_delete_window (int idx) { - wm_iterator win; - if ((win = windows.find (idx)) != windows.end ()) + wm_iterator win = windows.find (idx); + + if (win != windows.end ()) { delete win->second; windows.erase (win); @@ -1597,8 +1585,9 @@ void do_toggle_window_visibility (int idx, bool is_visible) { - wm_iterator win; - if ((win = windows.find (idx)) != windows.end ()) + wm_iterator win = windows.find (idx); + + if (win != windows.end ()) { if (is_visible) win->second->show (); @@ -1611,8 +1600,9 @@ void do_toggle_menubar_visibility (int fig_idx, bool menubar_is_figure) { - wm_iterator win; - if ((win = windows.find (fig_idx)) != windows.end ()) + wm_iterator win = windows.find (fig_idx); + + if (win != windows.end ()) { if (menubar_is_figure) win->second->show_menubar (); @@ -1625,28 +1615,27 @@ void do_mark_modified (int idx) { - wm_iterator win; - if ((win = windows.find (idx)) != windows.end ()) - { - win->second->mark_modified (); - } + wm_iterator win = windows.find (idx); + + if (win != windows.end ()) + win->second->mark_modified (); } void do_set_name (int idx) { - wm_iterator win; - if ((win = windows.find (idx)) != windows.end ()) - { - win->second->set_name (); - } + wm_iterator win = windows.find (idx); + + if (win != windows.end ()) + win->second->set_name (); } Matrix do_get_size (int idx) { Matrix sz (1, 2, 0.0); - wm_iterator win; - if ((win = windows.find (idx)) != windows.end ()) + wm_iterator win = windows.find (idx); + + if (win != windows.end ()) { sz(0) = win->second->w (); sz(1) = win->second->h (); @@ -1657,26 +1646,25 @@ void do_print (int idx, const std::string& cmd, const std::string& term) { - wm_iterator win; - if ((win = windows.find (idx)) != windows.end ()) - { - win->second->print (cmd, term); - } + wm_iterator win = windows.find (idx); + + if (win != windows.end ()) + win->second->print (cmd, term); } - void do_uimenu_update (int idx, graphics_handle gh, int id) + void do_uimenu_update (int idx, const graphics_handle& gh, int id) { - wm_iterator win; - if ((win = windows.find (idx)) != windows.end ()) - { - win->second->uimenu_update (gh, id); - } + wm_iterator win = windows.find (idx); + + if (win != windows.end ()) + win->second->uimenu_update (gh, id); } - void do_update_canvas (int idx, graphics_handle ca) + void do_update_canvas (int idx, const graphics_handle& ca) { - wm_iterator win; - if ((win = windows.find (idx)) != windows.end ()) + wm_iterator win = windows.find (idx); + + if (win != windows.end ()) { if (ca.ok ()) win->second->show_canvas (); @@ -1685,7 +1673,7 @@ } } - static int str2idx (const caseless_str clstr) + static int str2idx (const caseless_str& clstr) { int ind; if (clstr.find (fltk_idx_header,0) == 0) @@ -1803,7 +1791,7 @@ } } - void uimenu_set_fltk_label(graphics_object uimenu_obj) + void uimenu_set_fltk_label (graphics_object uimenu_obj) { if (uimenu_obj.valid_object ()) { @@ -1813,14 +1801,14 @@ graphics_object go = gh_manager::get_object (uimenu_obj.get_parent ()); if (go.isa ("uimenu")) fltk_label = dynamic_cast<const uimenu::properties&> (go.get_properties ()).get_fltk_label () - + "/" - + fltk_label; + + "/" + + fltk_label; else if (go.isa ("figure")) ; else - error("unexpected parent object\n"); + error ("unexpected parent object\n"); - uimenup.set_fltk_label(fltk_label); + uimenup.set_fltk_label (fltk_label); } } @@ -1837,19 +1825,25 @@ switch (id) { - case base_properties::ID_VISIBLE: - figure_manager::toggle_window_visibility (ov.string_value (), fp.is_visible ()); - break; - case figure::properties::ID_MENUBAR: - figure_manager::toggle_menubar_visibility (ov.string_value (), fp.menubar_is("figure")); - break; - case figure::properties::ID_CURRENTAXES: - figure_manager::update_canvas (go.get_handle (), fp.get_currentaxes ()); - break; - case figure::properties::ID_NAME: - case figure::properties::ID_NUMBERTITLE: - figure_manager::set_name (ov.string_value ()); - break; + case base_properties::ID_VISIBLE: + figure_manager::toggle_window_visibility + (ov.string_value (), fp.is_visible ()); + break; + + case figure::properties::ID_MENUBAR: + figure_manager::toggle_menubar_visibility + (ov.string_value (), fp.menubar_is ("figure")); + break; + + case figure::properties::ID_CURRENTAXES: + figure_manager::update_canvas + (go.get_handle (), fp.get_currentaxes ()); + break; + + case figure::properties::ID_NAME: + case figure::properties::ID_NUMBERTITLE: + figure_manager::set_name (ov.string_value ()); + break; } } } @@ -1955,8 +1949,7 @@ Fl::wait (fltk_maxtime); } - octave_value retval; - return retval; + return octave_value (); } DEFUN_DLD (__fltk_maxtime__, args, ,"") @@ -1974,13 +1967,12 @@ return retval; } -/* FIXME: This function should be abstracted and made potentially available - to all graphics toolkits. This suggests putting it in graphics.cc - as is done for drawnow() and having the master mouse_wheel_zoom - function call fltk_mouse_wheel_zoom. The same should be done for - gui_mode and fltk_gui_mode. For now (2011.01.30), just - changing function names and docstrings. -*/ +// FIXME -- This function should be abstracted and made potentially +// available to all graphics toolkits. This suggests putting it in +// graphics.cc as is done for drawnow() and having the master +// mouse_wheel_zoom function call fltk_mouse_wheel_zoom. The same +// should be done for gui_mode and fltk_gui_mode. For now (2011.01.30), +// just changing function names and docstrings. DEFUN_DLD (mouse_wheel_zoom, args, , "-*- texinfo -*-\n\ @@ -2035,7 +2027,6 @@ else mode_str = "none"; - bool failed = false; if (args.length () == 1) @@ -2060,9 +2051,7 @@ if (failed) error ("MODE must be one of the strings: \"2D\", \"3D\", or \"none\""); - - return octave_value(mode_str); + return octave_value (mode_str); } - #endif