-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SALOMEDSImpl_AttributeTarget.cxx
DF_Label aRefLabel = theSO.GetLabel();
SALOMEDSImpl_AttributeReference* aReference;
if ((aReference=(SALOMEDSImpl_AttributeReference*)aRefLabel.FindAttribute(SALOMEDSImpl_AttributeReference::GetID()))) {
- for(int i = 0, len = myVariables.size(); i<len; i++) if(myVariables[i]->Label() == aRefLabel) return; //BugID: PAL6192
- myVariables.push_back(aReference);
+ myVariables[aRefLabel.Entry()]=aReference;
}
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
{
std::vector<SALOMEDSImpl_SObject> aSeq;
- for(int i = 0, len = myVariables.size(); i<len; i++)
- aSeq.push_back( SALOMEDSImpl_Study::SObject(myVariables[i]->Label()));
+ for (std::map< std::string , DF_Attribute* >::iterator iter = myVariables.begin(); iter != myVariables.end(); ++iter)
+ aSeq.push_back( SALOMEDSImpl_Study::SObject(iter->second->Label()));
return aSeq;
}
Backup();
DF_Label aRefLabel = theSO.GetLabel();
- std::vector<DF_Attribute*> va;
- for(int i = 0, len = myVariables.size(); i<len; i++) {
- DF_Label L = myVariables[i]->Label();
- if(myVariables[i]->Label() == aRefLabel) continue;
- va.push_back(myVariables[i]);
- }
-
- myVariables.clear();
- myVariables = va;
+ myVariables.erase(aRefLabel.Entry());
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
SALOMEDSImpl_AttributeTarget* REL = dynamic_cast<SALOMEDSImpl_AttributeTarget*>(With);
myRelation = REL->GetRelation();
myVariables.clear();
- for (int i = 0, len = REL->myVariables.size(); i<len; i++) {
- myVariables.push_back(REL->myVariables[i]);
+ for (std::map< std::string , DF_Attribute* >::iterator iter = REL->myVariables.begin(); iter != REL->myVariables.end(); ++iter){
+ myVariables[iter->first]=iter->second;
}
}
SALOMEDSImpl_AttributeTarget* REL = dynamic_cast<SALOMEDSImpl_AttributeTarget*>(into);
REL->SetRelation(myRelation);
REL->myVariables.clear();
- for (int i = 0, len = myVariables.size(); i<len; i++) {
- REL->myVariables.push_back(myVariables[i]);
+ for (std::map< std::string , DF_Attribute* >::iterator iter = myVariables.begin(); iter != myVariables.end(); ++iter){
+ REL->myVariables[iter->first]=iter->second;
}
}