0025436: Visualization - AIS_InteractiveContext::HilightPreviousDetected() should...
[occt.git] / src / AIS / AIS_LocalContext_1.cxx
index 3bbeb80..2301294 100644 (file)
@@ -1455,9 +1455,10 @@ Standard_Integer AIS_LocalContext::HilightPreviousDetected (const Handle(V3d_Vie
     return 0;
   }
 
+  const Standard_Integer aLen = myDetectedSeq.Length();
   if (--myCurDetected < 1)
   {
-    myCurDetected = 1;
+    myCurDetected = aLen;
   }
   Handle(SelectMgr_EntityOwner) anOwner = myMainVS->Picked (myDetectedSeq (myCurDetected));
   if (anOwner.IsNull())
@@ -1504,7 +1505,7 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromIO
   
   Handle(AIS_Selection) Sel = AIS_Selection::Selection(mySelName.ToCString());
   if(Sel.IsNull()) {
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
     cout<<"\t\tAIS_LocalCOntext::FindSelectedOwnerFromShape : Selection "
         <<mySelName<<" Nulle "<<endl;
 #endif
@@ -1553,7 +1554,7 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromShape(const
   
   Handle(AIS_Selection) Sel = AIS_Selection::Selection(mySelName.ToCString());
   if(Sel.IsNull()) {
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
     cout<<"\t\tAIS_LocalCOntext::FindSelectedOwnerFromShape : Selection "<<mySelName<<" Nulle "<<endl;
 #endif
     return EO;