From 158079cdd9653bc4f237facc44076bbe9edd4f61 Mon Sep 17 00:00:00 2001 From: srn Date: Tue, 19 Dec 2006 07:14:43 +0000 Subject: [PATCH] Added CORBA::string_dup for the input string arrays --- src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx | 8 ++++---- src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx | 6 +++--- src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx index 829dd0205..d9d3bd5c8 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx @@ -90,7 +90,7 @@ void SALOMEDS_AttributeTableOfInteger::SetRowTitles(const std::vectorlength(aLength); - for(i = 0; i < aLength; i++) aSeq[i] = theTitles[i].c_str(); + for(i = 0; i < aLength; i++) aSeq[i] = CORBA::string_dup(theTitles[i].c_str()); SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowTitles(aSeq); } @@ -139,7 +139,7 @@ void SALOMEDS_AttributeTableOfInteger::SetColumnTitles(const std::vectorlength(aLength); - for (i = 0; i < aLength; i++) aSeq[i] = theTitles[i].c_str(); + for (i = 0; i < aLength; i++) aSeq[i] = CORBA::string_dup(theTitles[i].c_str()); SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetColumnTitles(aSeq); } } @@ -187,8 +187,8 @@ void SALOMEDS_AttributeTableOfInteger::SetRowUnits(const std::vectorlength(aLength); - for (i = 0; i < aLength; i++) aSeq[i] = (char*)theUnits[i].c_str(); - SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowUnits(aSeq); + for (i = 0; i < aLength; i++) aSeq[i] = CORBA::string_dup((char*)theUnits[i].c_str()); + SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowUnits(aSeq); } } diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx index f695ed2ad..182b468ed 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx @@ -91,7 +91,7 @@ void SALOMEDS_AttributeTableOfReal::SetRowTitles(const std::vector& else { SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq(); aSeq->length(aLength); - for (i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str(); + for (i = 0; i < aLength; i++) aSeq[i] = CORBA::string_dup((char*)theTitles[i].c_str()); SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowTitles(aSeq); } } @@ -139,7 +139,7 @@ void SALOMEDS_AttributeTableOfReal::SetColumnTitles(const std::vectorlength(aLength); - for (i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str(); + for (i = 0; i < aLength; i++) aSeq[i] = CORBA::string_dup((char*)theTitles[i].c_str()); SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetColumnTitles(aSeq); } } @@ -187,7 +187,7 @@ void SALOMEDS_AttributeTableOfReal::SetRowUnits(const std::vector& else { SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq(); aSeq->length(aLength); - for (i = 0; i < aLength; i++) aSeq[i] = (char*)theUnits[i].c_str(); + for (i = 0; i < aLength; i++) aSeq[i] = CORBA::string_dup((char*)theUnits[i].c_str()); SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowUnits(aSeq); } } diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx index b416e0691..a64a4daa2 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx @@ -91,7 +91,7 @@ void SALOMEDS_AttributeTableOfString::SetRowTitles(const std::vectorlength(aLength); - for (i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str(); + for (i = 0; i < aLength; i++) aSeq[i] = CORBA::string_dup((char*)theTitles[i].c_str()); SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowTitles(aSeq); } } @@ -139,7 +139,7 @@ void SALOMEDS_AttributeTableOfString::SetColumnTitles(const std::vectorlength(aLength); - for (i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str(); + for (i = 0; i < aLength; i++) aSeq[i] = CORBA::string_dup((char*)theTitles[i].c_str()); SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetColumnTitles(aSeq); } } @@ -187,7 +187,7 @@ void SALOMEDS_AttributeTableOfString::SetRowUnits(const std::vector else { SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq(); aSeq->length(aLength); - for (i = 0; i < aLength; i++) aSeq[i] = (char*)theUnits[i].c_str(); + for (i = 0; i < aLength; i++) aSeq[i] = CORBA::string_dup((char*)theUnits[i].c_str()); SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowUnits(aSeq); } } @@ -253,7 +253,7 @@ void SALOMEDS_AttributeTableOfString::AddRow(const std::vector& the else { SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq(); aSeq->length(aLength); - for (i = 0; i < aLength; i++) aSeq[i] = (char*)theData[i].c_str(); + for (i = 0; i < aLength; i++) aSeq[i] = CORBA::string_dup((char*)theData[i].c_str()); SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->AddRow(aSeq); } } @@ -278,7 +278,7 @@ void SALOMEDS_AttributeTableOfString::SetRow(int theRow, const std::vectorlength(aLength); - for (i = 0; i < aLength; i++) aSeq[i] = (char*)theData[i].c_str(); + for (i = 0; i < aLength; i++) aSeq[i] = CORBA::string_dup((char*)theData[i].c_str()); SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRow(theRow, aSeq); } } @@ -323,7 +323,7 @@ void SALOMEDS_AttributeTableOfString::AddColumn(const std::vector& else { SALOMEDS::StringSeq_var aColumn = new SALOMEDS::StringSeq(); aColumn->length(aLength); - for (i = 0; i < aLength; i++) aColumn[i] = (char*)theData[i].c_str(); + for (i = 0; i < aLength; i++) aColumn[i] = CORBA::string_dup((char*)theData[i].c_str()); SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->AddColumn(aColumn); } } @@ -348,7 +348,7 @@ void SALOMEDS_AttributeTableOfString::SetColumn(int theColumn, const std::vector else { SALOMEDS::StringSeq_var aColumn = new SALOMEDS::StringSeq(); aColumn->length(aLength); - for (i = 0; i < aLength; i++) aColumn[i] = (char*)theData[i].c_str(); + for (i = 0; i < aLength; i++) aColumn[i] = CORBA::string_dup((char*)theData[i].c_str()); SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetColumn(theColumn, aColumn); } } -- 2.39.2