1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0027427: Exception on loading a DE package to Draw

This commit is contained in:
anv
2016-04-25 15:29:57 +03:00
parent 92788bf4bb
commit 3e64931da5
2 changed files with 5 additions and 5 deletions

View File

@@ -2796,7 +2796,7 @@ void IFSelect_WorkSession::SetParams
Standard_Integer i, nbp = params.Length(), nbu = uselist.Length(); Standard_Integer i, nbp = params.Length(), nbu = uselist.Length();
Handle(IFSelect_ParamEditor) editor = new IFSelect_ParamEditor Handle(IFSelect_ParamEditor) editor = new IFSelect_ParamEditor
(nbp+nbu+50,"Parameter Editor"); (nbp+nbu+50,"Parameter Editor");
for (i = 1; i <= nbp; i ++) { for (i = params.Lower(); i <= params.Upper(); i ++) {
DeclareAndCast(Interface_TypedValue,val,params.Value(i)); DeclareAndCast(Interface_TypedValue,val,params.Value(i));
if (val.IsNull()) continue; if (val.IsNull()) continue;
editor->AddValue(val); editor->AddValue(val);
@@ -2808,7 +2808,7 @@ void IFSelect_WorkSession::SetParams
// On attaque les EditForms partielles // On attaque les EditForms partielles
TColStd_SequenceOfInteger listgen,listload,listsend,listsplit,listread,listwrite; TColStd_SequenceOfInteger listgen,listload,listsend,listsplit,listread,listwrite;
for (i = 1; i <= nbu; i ++) { for (i = uselist.Lower(); i <= uselist.Upper(); i ++) {
Standard_Integer use = uselist.Value(i); Standard_Integer use = uselist.Value(i);
switch (use) { switch (use) {
case 1 : listgen.Append(i); break; case 1 : listgen.Append(i); break;

View File

@@ -90,14 +90,14 @@ Standard_Integer Interface_Category::NbCategories()
Standard_CString Interface_Category::Name (const Standard_Integer theNum) Standard_CString Interface_Category::Name (const Standard_Integer theNum)
{ {
if (theNum < 0) return ""; if (theNum < 0) return "";
if (theNum < 1 || theNum > theCats().Length()) return unspec; if (theNum < theCats().Lower() || theNum > theCats().Upper()) return unspec;
return theCats().ChangeValue(theNum).ToCString(); return theCats().ChangeValue(theNum).ToCString();
} }
Standard_Integer Interface_Category::Number (const Standard_CString theName) Standard_Integer Interface_Category::Number (const Standard_CString theName)
{ {
Standard_Integer i, nb = theCats().Length(); Standard_Integer i;
for (i = 1; i <= nb; i ++) { for (i = theCats().Lower(); i <= theCats().Upper(); i ++) {
if (theCats().ChangeValue(i).IsEqual(theName)) return i; if (theCats().ChangeValue(i).IsEqual(theName)) return i;
} }
return 0; return 0;