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

0032684: Draw Harness - fix Draw_Interpretor::Add() misuse due to overloaded syntax

This commit is contained in:
kgv
2021-11-23 20:35:58 +03:00
committed by smoskvin
parent 4e69a6ac05
commit d0cf7e8f3c
11 changed files with 65 additions and 56 deletions

View File

@@ -316,14 +316,11 @@ void Draw_Interpretor::add (const Standard_CString theCommandName,
{
Standard_ASSERT_RAISE (myInterp != NULL, "Attempt to add command to Null interpretor");
Standard_PCharacter aName = (Standard_PCharacter )theCommandName;
Standard_PCharacter aHelp = (Standard_PCharacter )theHelp;
Standard_PCharacter aGroup = (Standard_PCharacter )theGroup;
Tcl_CreateCommand (myInterp, aName, CommandCmd, (ClientData )theCallback, CommandDelete);
Tcl_CreateCommand (myInterp, theCommandName, CommandCmd, (ClientData )theCallback, CommandDelete);
// add the help
Tcl_SetVar2 (myInterp, "Draw_Helps", aName, aHelp, TCL_GLOBAL_ONLY);
Tcl_SetVar2 (myInterp, "Draw_Groups", aGroup, aName,
Tcl_SetVar2 (myInterp, "Draw_Helps", theCommandName, theHelp, TCL_GLOBAL_ONLY);
Tcl_SetVar2 (myInterp, "Draw_Groups", theGroup, theCommandName,
TCL_GLOBAL_ONLY | TCL_APPEND_VALUE | TCL_LIST_ELEMENT);
// add path to source file (keep not more than two last subdirectories)
@@ -344,8 +341,10 @@ void Draw_Interpretor::add (const Standard_CString theCommandName,
TCollection_AsciiString aSrcPath;
aPath.SystemName (aSrcPath);
if (aSrcPath.Value(1) == '/')
{
aSrcPath.Remove(1);
Tcl_SetVar2 (myInterp, "Draw_Files", aName, aSrcPath.ToCString(), TCL_GLOBAL_ONLY);
}
Tcl_SetVar2 (myInterp, "Draw_Files", theCommandName, aSrcPath.ToCString(), TCL_GLOBAL_ONLY);
}
//=======================================================================