Index: trunk/src/conf_act.c =================================================================== --- trunk/src/conf_act.c (revision 2605) +++ trunk/src/conf_act.c (revision 2606) @@ -151,18 +151,10 @@ /*------------ get/chk (check flag actions for menus) ------------------*/ static const char GetStyle_syntax[] = "GetStyle()" ; -static const char GetStyle_help[] = "Return integer index (>=1) of the currently active style or 0 if no style is selected"; +static const char GetStyle_help[] = "Return integer index (>=0) of the currently active style or -1 if no style is selected (== custom style)"; static int ActionGetStyle(int argc, char **argv, Coord x, Coord y) { - STYLE_LOOP(PCB); - { - if (style->Thick == conf_core.design.line_thickness && - style->Diameter == conf_core.design.via_thickness && - style->Hole == conf_core.design.via_drilling_hole && style->Clearance == conf_core.design.clearance) - return n + 1; - } - END_LOOP; - return 0; + return pcb_route_style_lookup(&PCB->RouteStyle, conf_core.design.line_thickness, conf_core.design.via_thickness, conf_core.design.via_drilling_hole, conf_core.design.clearance, NULL); } static const char ChkMode_syntax[] = "ChkMode(expected_mode)" ; Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 2605) +++ trunk/src/plug_io.c (revision 2606) @@ -297,7 +297,7 @@ /* set route style to the first one, if the current one doesn't happen to match any. This way, "revert" won't change the route style. */ - if (!hid_get_flag("GetStyle()")) + if (hid_get_flag("GetStyle()") < 0) pcb_use_route_style_idx(&PCB->RouteStyle, 0); if (how == 0) { Index: trunk/src_plugins/hid_lesstif/styles.c =================================================================== --- trunk/src_plugins/hid_lesstif/styles.c (revision 2605) +++ trunk/src_plugins/hid_lesstif/styles.c (revision 2606) @@ -125,7 +125,7 @@ for (n = 0; n < num_style_buttons; n++) { for (j = 0; j < vtroutestyle_len(&PCB->RouteStyle); j++) - if (j != i - 1) + if (j != i) XmToggleButtonSetState(style_button_list[n].w[j], 0, 0); else XmToggleButtonSetState(style_button_list[n].w[j], 1, 0); @@ -132,7 +132,7 @@ } if (style_dialog) { for (j = 0; j < vtroutestyle_len(&PCB->RouteStyle); j++) - if (j != i - 1) + if (j != i) XmToggleButtonSetState(style_pb[j], 0, 0); else XmToggleButtonSetState(style_pb[j], 1, 0);