1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0024023: Revamp the OCCT Handle - non-cost reference cast

Code corrected to avoid passing object to function as non-const reference to handle of the base type where it is not necessary.
This commit is contained in:
abv
2015-06-25 00:45:56 +03:00
parent 5b111128de
commit 7f22979e82
23 changed files with 90 additions and 164 deletions

View File

@@ -151,9 +151,10 @@ void TDataStd_Expression::Paste(const Handle(TDF_Attribute)& Into,
{
Handle(TDataStd_Expression) EXPR = Handle(TDataStd_Expression)::DownCast (Into);
EXPR->SetExpression(myExpression);
Handle(TDataStd_Variable) V1,V2;
Handle(TDataStd_Variable) V1;
for (TDF_ListIteratorOfAttributeList it (myVariables); it.More(); it.Next()) {
V1 = Handle(TDataStd_Variable)::DownCast(it.Value());
Handle(TDF_Attribute) V2;
RT->HasRelocation (V1,V2);
EXPR->GetVariables().Append(V2);
}

View File

@@ -151,9 +151,10 @@ void TDataStd_Relation::Paste(const Handle(TDF_Attribute)& Into,
{
Handle(TDataStd_Relation) REL = Handle(TDataStd_Relation)::DownCast (Into);
REL->SetRelation(myRelation);
Handle(TDataStd_Variable) V1,V2;
Handle(TDataStd_Variable) V1;
for (TDF_ListIteratorOfAttributeList it (myVariables); it.More(); it.Next()) {
V1 = Handle(TDataStd_Variable)::DownCast(it.Value());
Handle(TDF_Attribute) V2;
RT->HasRelocation (V1,V2);
REL->GetVariables().Append(V2);
}