From: vsr Date: Tue, 7 May 2019 13:17:43 +0000 (+0300) Subject: Issue #16922 [CEA 16749] SALOME_MODULES_ORDER not set in SALOME 9.3.0 Windows archive X-Git-Tag: EMC2P_V1_1_0~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b997c40f598ab557a58502d4609fa64559baa9f0;p=modules%2Fkernel.git Issue #16922 [CEA 16749] SALOME_MODULES_ORDER not set in SALOME 9.3.0 Windows archive - Put SHAPER always to first place --- diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index 62a2ea30d..579bf2348 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -2075,19 +2075,24 @@ bool SALOMEDSImpl_Study::DumpStudy(const std::string& thePath, } std::vector aSeq; - std::string aCompType, aFactoryType; + std::string aFactoryType; //Build a list of all components in the Study SALOMEDSImpl_SComponentIterator itcomponent = NewComponentIterator(); - for (; itcomponent.More(); itcomponent.Next()) { - SALOMEDSImpl_SComponent sco = itcomponent.Value(); - aCompType = sco.ComponentDataType(); - if (aCompType == "GEOM") - aSeq.insert(aSeq.begin(), aCompType); - else - aSeq.push_back(aCompType); + for (; itcomponent.More(); itcomponent.Next()) + aSeq.push_back(itcomponent.Value().ComponentDataType()); + + std::vector::iterator it; + if ( (it = std::find( aSeq.begin(), aSeq.end(), "GEOM" )) != aSeq.end() ) { + aSeq.erase( it ); + aSeq.insert(aSeq.begin(), "GEOM" ); + } + if ( (it = std::find( aSeq.begin(), aSeq.end(), "SHAPER" )) != aSeq.end() ) { + aSeq.erase( it ); + aSeq.insert(aSeq.begin(), "SHAPER" ); } + // re-arrange modules in the sequence, if specific order is given via SALOME_MODULES_ORDER environment variable. if ( getenv("SALOME_MODULES_ORDER") != 0 ) { std::string order = getenv("SALOME_MODULES_ORDER"); @@ -2180,7 +2185,7 @@ bool SALOMEDSImpl_Study::DumpStudy(const std::string& thePath, int aLength = aSeq.size(); for(int i = 1; i <= aLength; i++) { - aCompType = aSeq[i-1]; + std::string aCompType = aSeq[i-1]; SALOMEDSImpl_SComponent sco = FindComponent(aCompType); SALOMEDSImpl_Driver* aDriver = NULL; // if there is an associated Engine call its method for saving