Commit f18fdd10 authored by jean-pierre charras's avatar jean-pierre charras

fixed issue for negative numbers starting by "-" in dialogs (read as 0)

dixed very minor compil warnings
parents 6e6910da 9e3a0424
......@@ -456,6 +456,7 @@ void BASE_SCREEN::AddGrid( const wxRealPoint& size, UserUnitType aUnit, int id )
y = size.y / 25.4;
break;
default:
case INCHES:
case UNSCALED_UNITS:
x = size.x;
......
......@@ -367,7 +367,7 @@ wxString ReturnStringFromValue( UserUnitType aUnit, int aValue, int aInternal_Un
case MILLIMETRES:
StringValue += _( " mm" );
break;
case UNSCALED_UNITS:
break;
}
......@@ -402,7 +402,8 @@ int ReturnValueFromString( UserUnitType aUnit, const wxString& TextValue,
while( brk_point < buf.Len() )
{
wxChar ch = buf[brk_point];
if( !( (ch >= '0' && ch <='9') || (ch == decimal_point) ) )
if( !( (ch >= '0' && ch <='9') || (ch == decimal_point)
|| (ch == '-') || (ch == '+') ) )
{
break;
}
......@@ -506,6 +507,7 @@ int From_User_Unit( UserUnitType aUnit, double val, int internal_unit_value )
value = val * internal_unit_value;
break;
default:
case UNSCALED_UNITS:
value = val;
}
......
......@@ -143,6 +143,8 @@ int GRMapY( int y )
#define WHEN_INSIDE
#if defined( USE_WX_ZOOM )
// currently only used if USE_WX_ZOOM is defined.
/**
* Test if any part of a line falls within the bounds of a rectangle.
*
......@@ -373,6 +375,8 @@ static bool clipLine( EDA_Rect* aClipBox, int& x1, int& y1, int& x2, int& y2 )
return true;
}
#endif // if defined( USE_WX_ZOOM )
/**
* Function clip_line
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment