Fix svace issues in LinearLayout. 69/182469/1
authorAnton Obzhirov <a.obzhirov@samsung.com>
Mon, 25 Jun 2018 10:04:30 +0000 (11:04 +0100)
committerAnton Obzhirov <a.obzhirov@samsung.com>
Mon, 25 Jun 2018 10:16:46 +0000 (11:16 +0100)
Change-Id: If82808ed8390cc5ae9305f495ca4647cca1a8a7a

dali-toolkit/devel-api/layouting/layout-size.h
dali-toolkit/devel-api/layouting/linear-layout.cpp
dali-toolkit/internal/layouting/linear-layout-impl.cpp

index c5ab2dd..b7ec71e 100644 (file)
@@ -87,6 +87,11 @@ public:
     return x==rhs.x && y==rhs.y;
   }
 
+  bool operator!=( const LayoutSize& rhs )
+  {
+    return !( *this==rhs );
+  }
+
   union
   {
     LayoutLength::IntType x;
index e9e7e5b..4a63036 100644 (file)
@@ -57,25 +57,21 @@ LinearLayout& LinearLayout::operator=( const LinearLayout& other )
 void LinearLayout::SetCellPadding( LayoutSize size )
 {
   GetImplementation(*this).SetCellPadding( size );
-  GetImplementation(*this).RequestLayout();
 }
 
 LayoutSize LinearLayout::GetCellPadding()
 {
   return GetImplementation(*this).GetCellPadding();
-  GetImplementation(*this).RequestLayout();
 }
 
 void LinearLayout::SetOrientation( LinearLayout::Orientation orientation )
 {
   GetImplementation(*this).SetOrientation( orientation );
-  GetImplementation(*this).RequestLayout();
 }
 
 LinearLayout::Orientation LinearLayout::GetOrientation()
 {
   return GetImplementation(*this).GetOrientation();
-  GetImplementation(*this).RequestLayout();
 }
 
 LinearLayout::LinearLayout( Dali::Toolkit::Internal::LinearLayout* object )
index 6b91bc0..7b3720c 100644 (file)
@@ -61,7 +61,11 @@ LinearLayout::~LinearLayout()
 
 void LinearLayout::SetCellPadding( LayoutSize size )
 {
-  mCellPadding = size;
+  if ( mCellPadding != size )
+  {
+    mCellPadding = size;
+    RequestLayout();
+  }
 }
 
 LayoutSize LinearLayout::GetCellPadding()
@@ -71,7 +75,11 @@ LayoutSize LinearLayout::GetCellPadding()
 
 void LinearLayout::SetOrientation( Dali::Toolkit::LinearLayout::Orientation orientation )
 {
-  mOrientation = orientation;
+  if ( mOrientation != orientation )
+  {
+    mOrientation = orientation;
+    RequestLayout();
+  }
 }
 
 Dali::Toolkit::LinearLayout::Orientation LinearLayout::GetOrientation()