From 4fc7595c7ecbd7efa89d7343aeacb124f1d53677 Mon Sep 17 00:00:00 2001 From: mtadel Date: Tue, 27 Jun 2006 17:53:22 +0000 Subject: [PATCH] In CheckMacro() use TInterpreter::IsLoaded(mac) instead of searching the list of global functions. --- EVE/Reve/Reve.cxx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/EVE/Reve/Reve.cxx b/EVE/Reve/Reve.cxx index af3e1de0764..ad7cf2022ac 100644 --- a/EVE/Reve/Reve.cxx +++ b/EVE/Reve/Reve.cxx @@ -103,10 +103,21 @@ namespace { Bool_t CheckMacro(const Text_t* mac) { - // Checks if macro 'mac' is loaded, (expect function with same name). + // Checks if macro 'mac' is loaded. + return gROOT->GetInterpreter()->IsLoaded(mac); + + // Previous version expected function with same name and used ROOT's + // list of global functions. + /* TString foo(mac); ChompTail(foo); + if(recreate) { + TCollection* logf = gROOT->GetListOfGlobalFunctions(kFALSE); + logf->SetOwner(); + logf->Clear(); + } return (gROOT->GetGlobalFunction(foo.Data(), 0, kTRUE) != 0); + */ } void AssertMacro(const Text_t* mac) @@ -122,11 +133,10 @@ void Macro(const Text_t* mac) { // Execute macro 'mac'. Do not reload the macro. - TString foo(mac); ChompTail(foo); - if(gROOT->GetGlobalFunction(foo.Data(), 0, kTRUE) == 0) { + if(CheckMacro(mac) == kFALSE) { gROOT->LoadMacro(mac); } - foo += "()"; + TString foo(mac); ChompTail(foo); foo += "()"; gROOT->ProcessLine(foo.Data()); } -- 2.39.3