Commit 1c524558 authored by Johnny Jazeix's avatar Johnny Jazeix

Modification pour supprimer une erreur (a ameliorer : faire un message

de la classe message_ns pour informer l'utilisateur de l'erreur)
parent 2ba2b008
......@@ -106,7 +106,14 @@ bool Interface_console::draw_trace(const string & filename, Svg* svg){
DrawTrace<Svg> drawing;
parser.parse(filename, trace);
try{
parser.parse(filename, trace);
}
catch (const string &error){
//message << "unable to parse " << filename << ende;
message << "Reason : " << error << ende;
return false;
}
drawing.build(svg, &trace);
......
......@@ -166,6 +166,10 @@ public:
container = get_container(trace_container, 0);
if(container == NULL) {
std::cerr << "The trace can not be shown because there are no containers." << std::endl;
return;
}
if (number_of_children(container) <= 1)
x = _container_width;
else
......@@ -420,16 +424,19 @@ public:
return s.top();
}
inline Container* get_container(const std::list<Container*>* list_container, const int pos) const{
std::list<Container *>::const_reverse_iterator it;
int i=0;
for (it=list_container->rbegin() ; i<pos; it++, i++ ){ }
if(list_container->empty()){
return NULL;
}
for (it=list_container->rbegin() ; i<pos; it++, i++ ){ }
return *it;
}
};
......
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