diff --git a/src/Units/Units.cxx b/src/Units/Units.cxx index 802121ffe0..202f63c892 100644 --- a/src/Units/Units.cxx +++ b/src/Units/Units.cxx @@ -240,8 +240,6 @@ Standard_Real Units::ToSI(const Standard_Real aData, Handle(Units_Dimensions) &dim) { if(lastunit != aUnit ) { - - lastunit = TCollection_AsciiString(aUnit); Units_UnitSentence unitsentence(aUnit); if(!unitsentence.IsDone()) { #ifdef OCCT_DEBUG @@ -257,6 +255,7 @@ Standard_Real Units::ToSI(const Standard_Real aData, Handle(Units_ShiftedToken)::DownCast(token) ; lastmove = stoken->Move(); } + lastunit = TCollection_AsciiString(aUnit); lastdimension = token->Dimensions(); } dim = lastdimension; @@ -286,7 +285,6 @@ Standard_Real Units::FromSI(const Standard_Real aData, Handle(Units_Dimensions) &dim) { if(lastunit != aUnit) { - lastunit = TCollection_AsciiString(aUnit); Units_UnitSentence unitsentence(aUnit); if(!unitsentence.IsDone()) { #ifdef OCCT_DEBUG @@ -302,6 +300,7 @@ Standard_Real Units::FromSI(const Standard_Real aData, Handle(Units_ShiftedToken)::DownCast(token) ; lastmove = stoken->Move(); } + lastunit = TCollection_AsciiString(aUnit); lastdimension = token->Dimensions(); } dim = lastdimension;