From: erg Date: Thu, 3 Mar 2011 00:52:59 +0000 (+0000) Subject: Fix gvedit so that we don't try to lay out graphs with parse errors X-Git-Tag: LAST_LIBGRAPH~32^2~969 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0bab58bf67d815d7c0b82a2ade541d931d344a87;p=graphviz Fix gvedit so that we don't try to lay out graphs with parse errors --- diff --git a/cmd/gvedit/csettings.cpp b/cmd/gvedit/csettings.cpp index 13c6b1659..7556fa74c 100644 --- a/cmd/gvedit/csettings.cpp +++ b/cmd/gvedit/csettings.cpp @@ -269,6 +269,11 @@ bool CFrmSettings::createLayout() /* graph=agread_usergets(reinterpret_cast(this),(gets_f)graph_reader); */ if(!graph) return false; + if (agerrors()) { + agclose (graph); + graph = NULL; + return false; + } Agraph_t* G=this->graph; gvLayout (gvc, G, (char*)WIDGET(QComboBox,cbLayout)->currentText().toUtf8().constData()); /* library function */ return true; @@ -327,12 +332,15 @@ void CFrmSettings::saveContent() } int CFrmSettings::drawGraph() { - createLayout(); - renderLayout(); - getActiveWindow()->settingsSet=false; - return QDialog::Accepted; - + if (createLayout() && renderLayout()) { + getActiveWindow()->settingsSet=false; + return QDialog::Accepted; + } + else + return QDialog::Accepted; + /* return QDialog::Rejected; */ } + int CFrmSettings::runSettings(MdiChild* m) { if ((m) && (m==getActiveWindow()))