mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-12 11:06:26 +08:00
0023912: TDataStd_ExtStringArray::Value() returns a copy of TCollection_ExtendedString, but it might return a reference.
Since now TDataStd_ExtStringArray::Value() returns a constant reference to the string value. Also, a draw-command GetExtStringArray is modified to manipulate with the string by a constant reference. Added test case bugs/caf/bug23912
This commit is contained in:
@@ -99,18 +99,20 @@ void TDataStd_ExtStringArray::SetValue(const Standard_Integer index, const TColl
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : GetValue
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TCollection_ExtendedString TDataStd_ExtStringArray::Value (const Standard_Integer index) const
|
||||
const TCollection_ExtendedString& TDataStd_ExtStringArray::Value (const Standard_Integer index) const
|
||||
{
|
||||
if(myValue.IsNull()) return TCollection_ExtendedString();
|
||||
return myValue->Value(index);
|
||||
if (myValue.IsNull())
|
||||
{
|
||||
static TCollection_ExtendedString staticEmptyValue;
|
||||
return staticEmptyValue;
|
||||
}
|
||||
return myValue->Value(index);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Lower
|
||||
//purpose :
|
||||
|
||||
Reference in New Issue
Block a user