mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03: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:
@@ -64,6 +64,7 @@ is
|
||||
Value (me; Index : Integer from Standard)
|
||||
---Purpose: Returns the value of the <Index>th element of the array
|
||||
--
|
||||
---C++: return const &
|
||||
---C++: alias operator ()
|
||||
returns ExtendedString from TCollection;
|
||||
|
||||
|
@@ -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