|
From: <sar...@us...> - 2014-09-25 14:12:08
|
Revision: 21158
http://sourceforge.net/p/sbml/code/21158
Author: sarahkeating
Date: 2014-09-25 14:12:02 +0000 (Thu, 25 Sep 2014)
Log Message:
-----------
Found the place where the flattening code was enabling the comp package on an instantiated model; this was not working if the model came from an external document
This is now fixed
Modified Paths:
--------------
trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.cpp
Modified: trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.cpp 2014-09-25 13:40:13 UTC (rev 21157)
+++ trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.cpp 2014-09-25 14:12:02 UTC (rev 21158)
@@ -922,20 +922,19 @@
mInstantiatedModel->connectToParent(this);
mInstantiatedModel->setSBMLDocument(origdoc);
mInstantiatedModel->enablePackage(getPackageURI(), getPrefix(), true);
+ CompModelPlugin* instmodplug =
+ static_cast<CompModelPlugin*>(mInstantiatedModel->getPlugin(getPrefix()));
+ if (instmodplug == NULL)
+ {
+ mInstantiatedModel->enablePackageInternal(getPackageURI(), getPrefix(), true);
+ }
- // enable any packages that were enabled on the doc
- //for (unsigned int n = 0; n < origdoc->getNumPlugins(); n++)
- //{
- // SBasePlugin * plugin = origdoc->getPlugin(n);
- //
- // mInstantiatedModel->enablePackage(plugin->getURI(),
- // plugin->getPrefix(), true);
- //}
+
CompModelPlugin* origmodplug =
static_cast<CompModelPlugin*>(rootdoc->getModel()->getPlugin(getPrefix()));
- CompModelPlugin* instmodplug =
+ instmodplug =
static_cast<CompModelPlugin*>(mInstantiatedModel->getPlugin(getPrefix()));
if (instmodplug == NULL)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|