From: prascle Date: Mon, 6 Dec 2010 17:02:23 +0000 (+0000) Subject: Merge from 1.10.2.4.6.5 X-Git-Tag: V6_2_0a2~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1df03b46159ff2ee7e0a6ee11d1e17a0e146c62f;p=modules%2Fsmesh.git Merge from 1.10.2.4.6.5 --- diff --git a/src/SMESHDS/SMESHDS_SubMesh.cxx b/src/SMESHDS/SMESHDS_SubMesh.cxx index ada454b9c..b56397d97 100644 --- a/src/SMESHDS/SMESHDS_SubMesh.cxx +++ b/src/SMESHDS/SMESHDS_SubMesh.cxx @@ -67,18 +67,23 @@ void SMESHDS_SubMesh::AddElement(const SMDS_MeshElement * ME) else { int idInSubShape = ME->getIdInShape(); - MESSAGE("add element in subshape already belonging to that subshape " - << ME->GetID() << " " << oldShapeId << " " << idInSubShape); - // check if ok: do nothing if ok - if ((idInSubShape == -1) || (idInSubShape >= myElements.size())) + if (idInSubShape >= 0) { - MESSAGE("out of bounds"); - throw SALOME_Exception(LOCALIZED("out of bounds")); - } - if (ME != myElements[idInSubShape]) - { - MESSAGE("not the same element"); - throw SALOME_Exception(LOCALIZED("not the same element")); + MESSAGE("add element in subshape already belonging to that subshape " + << ME->GetID() << " " << oldShapeId << " " << idInSubShape); + // check if ok: do nothing if ok + if (idInSubShape >= myElements.size()) + { + MESSAGE("out of bounds " << idInSubShape << " " << myElements.size()); + throw SALOME_Exception(LOCALIZED("out of bounds")); + } + if (ME != myElements[idInSubShape]) + { + MESSAGE("not the same element"); + throw SALOME_Exception(LOCALIZED("not the same element")); + } + MESSAGE("already done, OK, nothing to do"); + return; } } }