Fixed SVACE errors 51/179951/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 23 May 2018 11:23:05 +0000 (12:23 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 23 May 2018 11:23:05 +0000 (12:23 +0100)
Change-Id: I478b27d3ca840a0f867415bf7326c658177e8fb4

dali-toolkit/devel-api/layouting/layout-item-impl.cpp
dali-toolkit/devel-api/layouting/layout-length.h
dali-toolkit/devel-api/layouting/measure-spec.h
dali-toolkit/devel-api/layouting/measured-size.h
dali-toolkit/internal/controls/image-view/image-view-impl.cpp

index f6bd7f8..e31045f 100644 (file)
@@ -141,19 +141,9 @@ void LayoutItem::Measure( MeasureSpec widthMeasureSpec, MeasureSpec heightMeasur
   {
     mImpl->ClearPrivateFlag( Impl::PRIVATE_FLAG_MEASURED_DIMENSION_SET );
 
   {
     mImpl->ClearPrivateFlag( Impl::PRIVATE_FLAG_MEASURED_DIMENSION_SET );
 
-    //resolveRtlPropertiesIfNeeded();
-
-    int cacheIndex = -1;  // = forceLayout ? -1 : mMeasureCache.indexOfKey(key);
-    if( cacheIndex < 0 ) //|| sIgnoreMeasureCache )
-    {
-      // measure ourselves, this should set the measured dimension flag back
-      OnMeasure( widthMeasureSpec, heightMeasureSpec );
-      mImpl->ClearPrivateFlag( Impl::PRIVATE_FLAG_MEASURE_NEEDED_BEFORE_LAYOUT );
-    }
-    else
-    {
-      mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_MEASURE_NEEDED_BEFORE_LAYOUT );
-    }
+    // measure ourselves, this should set the measured dimension flag back
+    OnMeasure( widthMeasureSpec, heightMeasureSpec );
+    mImpl->ClearPrivateFlag( Impl::PRIVATE_FLAG_MEASURE_NEEDED_BEFORE_LAYOUT );
 
     // flag not set, setMeasuredDimension() was not invoked, we raise an exception to warn the developer
     DALI_ASSERT_ALWAYS( mImpl->GetPrivateFlag( Impl::PRIVATE_FLAG_MEASURED_DIMENSION_SET ) &&
 
     // flag not set, setMeasuredDimension() was not invoked, we raise an exception to warn the developer
     DALI_ASSERT_ALWAYS( mImpl->GetPrivateFlag( Impl::PRIVATE_FLAG_MEASURED_DIMENSION_SET ) &&
@@ -163,8 +153,6 @@ void LayoutItem::Measure( MeasureSpec widthMeasureSpec, MeasureSpec heightMeasur
 
   mImpl->mOldWidthMeasureSpec = widthMeasureSpec;
   mImpl->mOldHeightMeasureSpec = heightMeasureSpec;
 
   mImpl->mOldWidthMeasureSpec = widthMeasureSpec;
   mImpl->mOldHeightMeasureSpec = heightMeasureSpec;
-
-  //mMeasureCache.put(key, ((long) mMeasuredWidth) << 32 | (long) mMeasuredHeight & 0xffffffffL); // suppress sign extension
 }
 
 void LayoutItem::Layout( LayoutLength l, LayoutLength t, LayoutLength r, LayoutLength b )
 }
 
 void LayoutItem::Layout( LayoutLength l, LayoutLength t, LayoutLength r, LayoutLength b )
index 94f7ae0..9953ed8 100644 (file)
@@ -46,7 +46,10 @@ public:
 
   LayoutLength& operator=(const LayoutLength& rhs)
   {
 
   LayoutLength& operator=(const LayoutLength& rhs)
   {
-    mValue = rhs.mValue;
+    if( this != &rhs )
+    {
+      mValue = rhs.mValue;
+    }
     return *this;
   }
 
     return *this;
   }
 
index f766247..92a03f2 100644 (file)
@@ -62,8 +62,11 @@ public:
 
   MeasureSpec& operator=( const MeasureSpec& rhs )
   {
 
   MeasureSpec& operator=( const MeasureSpec& rhs )
   {
-    this->mSize = rhs.mSize;
-    this->mMode = rhs.mMode;
+    if( this != &rhs )
+    {
+      this->mSize = rhs.mSize;
+      this->mMode = rhs.mMode;
+    }
     return *this;
   }
 
     return *this;
   }
 
index 68f988c..3e38a1e 100644 (file)
@@ -60,8 +60,11 @@ public:
 
   MeasuredSize& operator=( const MeasuredSize& rhs )
   {
 
   MeasuredSize& operator=( const MeasuredSize& rhs )
   {
-    this->mMeasuredSize = rhs.mMeasuredSize;
-    this->mState = rhs.mState;
+    if( this != &rhs )
+    {
+      this->mMeasuredSize = rhs.mMeasuredSize;
+      this->mState = rhs.mState;
+    }
     return *this;
   }
 
     return *this;
   }
 
index 9af610b..20869d3 100755 (executable)
@@ -286,7 +286,8 @@ void ImageView::OnRelayout( const Vector2& size, RelayoutContainer& container )
 
       // scale to fit the padded area
       auto finalSize =
 
       // scale to fit the padded area
       auto finalSize =
-             naturalSize * std::min((paddedSize.width / naturalSize.width), (paddedSize.height / naturalSize.height));
+             naturalSize * std::min( ( naturalSize.width  ? ( paddedSize.width  / naturalSize.width  ) : 0 ),
+                                     ( naturalSize.height ? ( paddedSize.height / naturalSize.height ) : 0 ) );
 
       // calculate final offset within the padded area
       auto finalOffset = Vector2(padding.start, padding.top) + (paddedSize - finalSize) * .5f;
 
       // calculate final offset within the padded area
       auto finalOffset = Vector2(padding.start, padding.top) + (paddedSize - finalSize) * .5f;