From: srn Date: Tue, 5 Dec 2006 14:39:23 +0000 (+0000) Subject: Fix of bugs found when running the Unit Test for SALOMEDS X-Git-Tag: SALOMEDS_Unit_Tests_0_1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=dce643a72e5f5bbd6f1943ef19f140344dda7cdb;p=modules%2Fkernel.git Fix of bugs found when running the Unit Test for SALOMEDS --- diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx index a7bbc0451..829dd0205 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx @@ -297,6 +297,7 @@ std::vector SALOMEDS_AttributeTableOfInteger::GetRow(int theRow) } else { SALOMEDS::LongSeq_var aRow = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRow(theRow); + aLength = aRow->length(); for (i = 0; i < aLength; i++) aVector.push_back(aRow[i]); } @@ -339,7 +340,7 @@ void SALOMEDS_AttributeTableOfInteger::SetColumn(int theColumn, const std::vecto Handle(TColStd_HSequenceOfInteger) aColumn = new TColStd_HSequenceOfInteger; for (int i = 0; i < aLength; i++) aColumn->Append(theData[i]); try { - aTable->SetRowData(theColumn, aColumn); + aTable->SetColumnData(theColumn, aColumn); } catch(...) { throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength(); @@ -349,7 +350,7 @@ void SALOMEDS_AttributeTableOfInteger::SetColumn(int theColumn, const std::vecto SALOMEDS::LongSeq_var aColumn = new SALOMEDS::LongSeq(); aColumn->length(aLength); for (i = 0; i < aLength; i++) aColumn[i] = theData[i]; - SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRow(theColumn, aColumn); + SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetColumn(theColumn, aColumn); } } @@ -366,6 +367,7 @@ std::vector SALOMEDS_AttributeTableOfInteger::GetColumn(int theColumn) } else { SALOMEDS::LongSeq_var aColumn = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetColumn(theColumn); + aLength = aColumn->length(); for (i = 0; i < aLength; i++) aVector.push_back(aColumn[i]); } return aVector; @@ -433,6 +435,7 @@ std::vector SALOMEDS_AttributeTableOfInteger::GetRowSetIndices(int theRow) else { SALOMEDS::LongSeq_var aSet = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRowSetIndices(theRow); + aLength = aSet->length(); for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]); } return aVector; diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx index ce2afc9f7..f695ed2ad 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx @@ -296,6 +296,7 @@ std::vector SALOMEDS_AttributeTableOfReal::GetRow(int theRow) } else { SALOMEDS::DoubleSeq_var aRow = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRow(theRow); + aLength = aRow->length(); for (i = 0; i < aLength; i++) aVector.push_back(aRow[i]); } @@ -338,7 +339,7 @@ void SALOMEDS_AttributeTableOfReal::SetColumn(int theColumn, const std::vectorAppend(theData[i]); try { - aTable->SetRowData(theColumn, aColumn); + aTable->SetColumnData(theColumn, aColumn); } catch(...) { throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength(); @@ -348,7 +349,7 @@ void SALOMEDS_AttributeTableOfReal::SetColumn(int theColumn, const std::vectorlength(aLength); for (i = 0; i < aLength; i++) aColumn[i] = theData[i]; - SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRow(theColumn, aColumn); + SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetColumn(theColumn, aColumn); } } @@ -365,6 +366,7 @@ std::vector SALOMEDS_AttributeTableOfReal::GetColumn(int theColumn) } else { SALOMEDS::DoubleSeq_var aColumn = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetColumn(theColumn); + aLength = aColumn->length(); for (i = 0; i < aLength; i++) aVector.push_back(aColumn[i]); } return aVector; @@ -430,6 +432,7 @@ std::vector SALOMEDS_AttributeTableOfReal::GetRowSetIndices(int theRow) } else { SALOMEDS::LongSeq_var aSet = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowSetIndices(theRow); + aLength = aSet->length(); for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]); } return aVector; diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx index de544941a..b416e0691 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx @@ -296,6 +296,7 @@ std::vector SALOMEDS_AttributeTableOfString::GetRow(int theRow) } else { SALOMEDS::StringSeq_var aRow = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetRow(theRow); + aLength = aRow->length(); for (i = 0; i < aLength; i++) aVector.push_back((char*)aRow[i].in()); } @@ -338,7 +339,7 @@ void SALOMEDS_AttributeTableOfString::SetColumn(int theColumn, const std::vector Handle(TColStd_HSequenceOfExtendedString) aColumn = new TColStd_HSequenceOfExtendedString; for (int i = 0; i < aLength; i++) aColumn->Append((char*)theData[i].c_str()); try { - aTable->SetRowData(theColumn, aColumn); + aTable->SetColumnData(theColumn, aColumn); } catch(...) { throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength(); @@ -348,7 +349,7 @@ void SALOMEDS_AttributeTableOfString::SetColumn(int theColumn, const std::vector SALOMEDS::StringSeq_var aColumn = new SALOMEDS::StringSeq(); aColumn->length(aLength); for (i = 0; i < aLength; i++) aColumn[i] = (char*)theData[i].c_str(); - SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRow(theColumn, aColumn); + SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetColumn(theColumn, aColumn); } } @@ -368,6 +369,7 @@ std::vector SALOMEDS_AttributeTableOfString::GetColumn(int theColum else { SALOMEDS::StringSeq_var aColumn = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetColumn(theColumn); + aLength = aColumn->length(); for (i = 0; i < aLength; i++) aVector.push_back(aColumn[i].in()); } return aVector; @@ -435,6 +437,7 @@ std::vector SALOMEDS_AttributeTableOfString::GetRowSetIndices(int theRow) else { SALOMEDS::LongSeq_var aSet = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetRowSetIndices(theRow); + aLength = aSet->length(); for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]); } return aVector;