1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +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:
vro
2013-05-16 11:07:43 +04:00
parent ee1e83b94b
commit bbd048069d
4 changed files with 35 additions and 11 deletions

View File

@@ -952,12 +952,9 @@ static Standard_Integer DDataStd_GetExtStringArray (Draw_Interpretor& di,
return 1;
}
TCollection_ExtendedString anExtendedString;
TCollection_AsciiString anAsciiString;
for(Standard_Integer i = A->Lower(); i<=A->Upper(); i++){
anExtendedString = A->Value(i);
anAsciiString = TCollection_AsciiString (A->Value(i),'?');
//cout << anAsciiString.ToCString() << endl;
const TCollection_ExtendedString& anExtendedString = A->Value(i);
TCollection_AsciiString anAsciiString(A->Value(i),'?');
di << anAsciiString.ToCString();
if(i<A->Upper())
di<<" ";