From: mpv Date: Thu, 26 Jan 2017 12:59:03 +0000 (+0300) Subject: Fix for issue #1999 : correct store/restore boolean array values by better management... X-Git-Tag: V_2.7.0~305 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c74eac8a720f6cbf08337eb4cc110fe8b2389f4c;p=modules%2Fshaper.git Fix for issue #1999 : correct store/restore boolean array values by better management of lower/upper parameters of this array. --- diff --git a/src/Model/Model_AttributeTables.cpp b/src/Model/Model_AttributeTables.cpp index f8eebe405..69f5e3290 100644 --- a/src/Model/Model_AttributeTables.cpp +++ b/src/Model/Model_AttributeTables.cpp @@ -61,9 +61,6 @@ void Model_AttributeTables::setSize(const int theRows, const int theColumns, con (myType == ModelAPI_AttributeTables::DOUBLE) ? new TColStd_HArray1OfReal(0, aNewSize - 1) : Handle(TColStd_HArray1OfReal)(); bool* anOldBool = 0; // an not work with internal arrays because of different indexing - Handle(TColStd_HArray1OfByte) aNewBool = (myType == ModelAPI_AttributeTables::BOOLEAN) ? - // internal array for boolean has 8 times lower size - new TColStd_HArray1OfByte(0, (aNewSize - 1)>>3) : Handle(TColStd_HArray1OfByte)(); Handle(TDataStd_BooleanArray) aBoolArray; // an existing array Handle(TColStd_HArray1OfInteger) anOldInt, aNewInt = (myType == ModelAPI_AttributeTables::INTEGER) ? @@ -84,7 +81,7 @@ void Model_AttributeTables::setSize(const int theRows, const int theColumns, con aBoolArray = Handle(TDataStd_BooleanArray)::DownCast(anArray); for(int a = 0; a < aSize; a++) anOldBool[a] = aBoolArray->Value(a); - aBoolArray->SetInternalArray(aNewBool); + aBoolArray->Init(0, aNewSize - 1); break; } case ModelAPI_AttributeTables::INTEGER: