From: Adeel Kazmi Date: Wed, 23 May 2018 11:23:05 +0000 (+0100) Subject: Fixed SVACE errors X-Git-Tag: dali_1.3.26~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=c87446dd57403afc21d11544d162df31c00922ee Fixed SVACE errors Change-Id: I478b27d3ca840a0f867415bf7326c658177e8fb4 --- diff --git a/dali-toolkit/devel-api/layouting/layout-item-impl.cpp b/dali-toolkit/devel-api/layouting/layout-item-impl.cpp index f6bd7f8..e31045f 100644 --- a/dali-toolkit/devel-api/layouting/layout-item-impl.cpp +++ b/dali-toolkit/devel-api/layouting/layout-item-impl.cpp @@ -141,19 +141,9 @@ void LayoutItem::Measure( MeasureSpec widthMeasureSpec, MeasureSpec heightMeasur { 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 ) && @@ -163,8 +153,6 @@ void LayoutItem::Measure( MeasureSpec widthMeasureSpec, MeasureSpec heightMeasur 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 ) diff --git a/dali-toolkit/devel-api/layouting/layout-length.h b/dali-toolkit/devel-api/layouting/layout-length.h index 94f7ae0..9953ed8 100644 --- a/dali-toolkit/devel-api/layouting/layout-length.h +++ b/dali-toolkit/devel-api/layouting/layout-length.h @@ -46,7 +46,10 @@ public: LayoutLength& operator=(const LayoutLength& rhs) { - mValue = rhs.mValue; + if( this != &rhs ) + { + mValue = rhs.mValue; + } return *this; } diff --git a/dali-toolkit/devel-api/layouting/measure-spec.h b/dali-toolkit/devel-api/layouting/measure-spec.h index f766247..92a03f2 100644 --- a/dali-toolkit/devel-api/layouting/measure-spec.h +++ b/dali-toolkit/devel-api/layouting/measure-spec.h @@ -62,8 +62,11 @@ public: 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; } diff --git a/dali-toolkit/devel-api/layouting/measured-size.h b/dali-toolkit/devel-api/layouting/measured-size.h index 68f988c..3e38a1e 100644 --- a/dali-toolkit/devel-api/layouting/measured-size.h +++ b/dali-toolkit/devel-api/layouting/measured-size.h @@ -60,8 +60,11 @@ public: 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; } diff --git a/dali-toolkit/internal/controls/image-view/image-view-impl.cpp b/dali-toolkit/internal/controls/image-view/image-view-impl.cpp index 9af610b..20869d3 100755 --- a/dali-toolkit/internal/controls/image-view/image-view-impl.cpp +++ b/dali-toolkit/internal/controls/image-view/image-view-impl.cpp @@ -286,7 +286,8 @@ void ImageView::OnRelayout( const Vector2& size, RelayoutContainer& container ) // 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;