From cd0a63dd7b9dc069e74dcc4e5418012cf6beaf7d Mon Sep 17 00:00:00 2001
From: kgv <kgv@opencascade.com>
Date: Thu, 15 Jan 2015 15:25:52 +0300
Subject: [PATCH] 0025466: Visualization - Impossible to change the display
 mode when a local context is opened

Remove irrelevant check from method AIS_InteractiveContext::SetDisplayMode().

Test case for issue CR25466
---
 src/AIS/AIS_InteractiveContext.cxx |  5 -----
 tests/bugs/vis/bug25466            | 25 +++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 5 deletions(-)
 create mode 100644 tests/bugs/vis/bug25466

diff --git a/src/AIS/AIS_InteractiveContext.cxx b/src/AIS/AIS_InteractiveContext.cxx
index 8f3e0bd0b4..8caf9adae9 100644
--- a/src/AIS/AIS_InteractiveContext.cxx
+++ b/src/AIS/AIS_InteractiveContext.cxx
@@ -1461,11 +1461,6 @@ void AIS_InteractiveContext::SetDisplayMode (const Handle(AIS_InteractiveObject)
     theIObj->SetContext(this);
   }
 
-  if (HasOpenedContext())
-  {
-    return;
-  }
-
   if (!myObjects.IsBound (theIObj))
   {
     theIObj->SetDisplayMode (theMode);
diff --git a/tests/bugs/vis/bug25466 b/tests/bugs/vis/bug25466
new file mode 100644
index 0000000000..c333bbad48
--- /dev/null
+++ b/tests/bugs/vis/bug25466
@@ -0,0 +1,25 @@
+puts "============"
+puts "CR25466"
+puts "============"
+puts ""
+#######################################################################
+#  Visualization - Impossible to change the display mode when a local context is opened
+#######################################################################
+
+box b1 0 0 0 1 2 3
+box b2 3 0 0 2 3 1
+
+vinit View1
+vclear
+vaxo
+
+vsetdispmode 0
+vdisplay b1 b2
+vfit
+
+vselmode b1 4 1
+vsetdispmode b1 1
+
+checkcolor 100 100 0.78 0.55 0.09
+
+set only_screen 1