Commit 429e4476 authored by Claes Sjofors's avatar Claes Sjofors

Build error msg for java graph names starting with digit

parent f768effb
......@@ -50,6 +50,7 @@ no_propagate <Don't propagate event handling> /info
isbaseclass <Is baseclass> /info
fileopen <Unable to open file> /error
needconv <Unable to save, graph needs conversion> /error
javanamesyntax <Java name syntax error> /error
......@@ -705,12 +705,20 @@ void wb_build::xttgraph( pwr_tOid oid)
else {
Ge *gectx = m_wnav->ge_new( action);
strcpy( cmd, "export java");
gectx->command( cmd);
delete gectx;
m_sts = gectx->command( cmd);
if ( evenSts()) {
msg_GetMsg( m_sts, cmd, sizeof(cmd));
MsgWindow::message('E', cmd, msgw_ePop_Yes, oid);
m_sts = PWRB__NOBUILT;
delete gectx;
return;
}
sprintf( cmd, "Build: XttGraph Export java %s", action);
MsgWindow::message('I', cmd, msgw_ePop_No, oid);
delete gectx;
m_sts = PWRB__SUCCESS;
}
}
......@@ -773,7 +781,8 @@ void wb_build::webgraph( pwr_tOid oid)
java_name[0] = toupper(java_name[0]);
// Get the .pwg file for this javaname
sprintf( name, "$pwrp_pop/%s.pwg", cdh_Low(java_name));
strcpy( graph_name, cdh_Low(java_name));
sprintf( name, "$pwrp_pop/%s.pwg", graph_name);
dcli_translate_filename( name, name);
m_sts = dcli_file_time( name, &src_time);
......@@ -826,7 +835,14 @@ void wb_build::webgraph( pwr_tOid oid)
else {
Ge *gectx = m_wnav->ge_new( graph_name);
strcpy( cmd, "export java");
gectx->command( cmd);
m_sts = gectx->command( cmd);
if ( evenSts()) {
msg_GetMsg( m_sts, cmd, sizeof(cmd));
MsgWindow::message('E', cmd, msgw_ePop_Yes, oid);
m_sts = PWRB__NOBUILT;
delete gectx;
return;
}
delete gectx;
sprintf( cmd, "Build: WebGraph Export java %s", java_name);
......
......@@ -385,6 +385,11 @@ void Ge::export_javabean( Ge *gectx, char *name)
char framename[80];
char appletname[80];
if ( isdigit(name[0])) {
gectx->message( 'E', "Java name syntax error");
return;
}
strcpy( framename, name);
if ( (s = strrchr( framename, '.')))
*s = 0;
......@@ -447,6 +452,11 @@ void Ge::export_gejava( Ge *gectx, char *name)
char appletname[80];
char systemname[80];
if ( isdigit(name[0])) {
gectx->message( 'E', "Java name syntax error");
return;
}
strcpy( framename, name);
if ( (s = strrchr( framename, '.')))
*s = 0;
......
......@@ -1532,6 +1532,11 @@ static int graph_export_func( void *client_data,
}
}
if ( isdigit(name[0])) {
graph->message( 'E', "Java name syntax error");
return GE__JAVANAMESYNTAX;
}
if ( graph->is_subgraph())
{
graph->message( 'E', "Unable to save subgraph as ge java");
......
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