Index: trunk/MagicSoft/Mars/mhbase/MH3.cc
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MH3.cc	(revision 6240)
+++ trunk/MagicSoft/Mars/mhbase/MH3.cc	(revision 6280)
@@ -505,33 +505,4 @@
 void MH3::Paint(Option_t *o)
 {
-    /*
-     *fLog << all << fHist << " " << gPad->GetName() << " ----> Paint " << o << endl;
-     TListIter Next(gPad->GetListOfPrimitives()); TObject *obj;
-     while ((obj=Next())) *fLog << obj << " " << obj->GetName() << " " << obj->ClassName() << " " << Next.GetOption() << " " << (int)obj->TestBit(kCanDelete) << endl;
-     */
-    /*
-    TString str(o);
-
-    if (str.Contains("log", TString::kIgnoreCase))
-    {
-        if (fHist->TestBit(kIsLogx) && fHist->GetEntries()>0) gPad->SetLogx();
-        if (fHist->TestBit(kIsLogy) && fHist->GetEntries()>0) gPad->SetLogy();
-        if (fHist->TestBit(kIsLogz) && fHist->GetEntries()>0) gPad->SetLogz();
-    }
-
-    if (str.Contains("upd", TString::kIgnoreCase))
-    {
-
-        // Set pretty color palette
-        // gStyle->SetPalette(1, 0);
-
-        TProfile* h0;
-        if ((h0 = (TProfile*)gPad->FindObject(fNameProfX)))
-            ((TH2*)fHist)->ProfileX(fNameProfX, -1, 9999, "s");
-        if ((h0 = (TProfile*)gPad->FindObject(fNameProfY)))
-            ((TH2*)fHist)->ProfileY(fNameProfY, -1, 9999, "s");
-            }
-            */
-
     fHist->SetFillStyle(4000);
 
@@ -550,6 +521,8 @@
     str.ReplaceAll("profy", "");
 
+    // WARNING: Don't use FindObject directly always use GetListOfPrimitives!!
+
     // FIXME: We may have to remove all our own options from str!
-    if (!only && !gPad->FindObject(fHist))
+    if (!only && !gPad->GetListOfPrimitives()->FindObject(fHist))
         fHist->Draw(str);
 
@@ -557,5 +530,5 @@
     {
         TProfile *p = ((TH2*)fHist)->ProfileX("ProfX", -1, 9999, "s");
-        if (!gPad->FindObject(p))
+        if (!gPad->GetListOfPrimitives()->FindObject(p))
         {
             p->UseCurrentStyle();
@@ -571,5 +544,5 @@
     {
         TProfile *p = ((TH2*)fHist)->ProfileY("ProfY", -1, 9999, "s");
-        if (!gPad->FindObject(p))
+        if (!gPad->GetListOfPrimitives()->FindObject(p))
         {
             p->UseCurrentStyle();
