Skip to content

Commit

Permalink
Updated the classes if needed before saving them.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Dec 10, 2015
1 parent b4d8ad0 commit 61a0dc8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp
Expand Up @@ -2968,6 +2968,10 @@ bool LibraryWidget::saveLibraryTreeItem(LibraryTreeItem *pLibraryTreeItem)
mpMainWindow->getStatusBar()->showMessage(tr("Saving %1").arg(pLibraryTreeItem->getNameStructure()));
mpMainWindow->showProgressBar();
if (pLibraryTreeItem->getLibraryType() == LibraryTreeItem::Modelica) {
/* if user has done some changes in the Modelica text view then save & validate it in the AST before saving it to file. */
if (pLibraryTreeItem->getModelWidget() && !pLibraryTreeItem->getModelWidget()->validateText()) {
return false;
}
result = saveModelicaLibraryTreeItem(pLibraryTreeItem);
} else if (pLibraryTreeItem->getLibraryType() == LibraryTreeItem::TLM) {
result = saveTLMLibraryTreeItem(pLibraryTreeItem);
Expand Down

0 comments on commit 61a0dc8

Please sign in to comment.