Modified not to be added the invalid value except the defined orientation 54/166454/1
authorMoonhee Choi <mh0310.choi@samsung.com>
Wed, 10 Jan 2018 08:26:05 +0000 (17:26 +0900)
committerMoonhee Choi <mh0310.choi@samsung.com>
Wed, 10 Jan 2018 08:26:05 +0000 (17:26 +0900)
Change-Id: Icd30b6f9cef6a99de64646f9c8ad4080df2194dd
Signed-off-by: Moonhee Choi <mh0310.choi@samsung.com>
adaptors/ecore/wayland/window-impl-ecore-wl.cpp

index 2c46991..ca805b5 100644 (file)
@@ -849,19 +849,22 @@ void Window::AddAvailableOrientation(Dali::Window::WindowOrientation orientation
 {
   bool found = false;
 
-  for( std::size_t i=0; i<mAvailableOrientations.size(); i++ )
+  if ((orientation >= Dali::Window::PORTRAIT) && (orientation <= Dali::Window::LANDSCAPE_INVERSE))
   {
-    if(mAvailableOrientations[i] == orientation)
+    for( std::size_t i=0; i<mAvailableOrientations.size(); i++ )
     {
-      found = true;
-      break;
+      if(mAvailableOrientations[i] == orientation)
+      {
+        found = true;
+        break;
+      }
     }
-  }
 
-  if( ! found )
-  {
-    mAvailableOrientations.push_back(orientation);
-    SetAvailableOrientations( mAvailableOrientations );
+    if( ! found )
+    {
+      mAvailableOrientations.push_back(orientation);
+      SetAvailableOrientations( mAvailableOrientations );
+    }
   }
 }