Fix various SVACE errors 05/98005/5
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 15 Nov 2016 15:35:14 +0000 (15:35 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 15 Nov 2016 19:31:05 +0000 (19:31 +0000)
Change-Id: I9bef1e40dbcd4a5feb8bf518ade181e5e9d08cdb

automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-sync-abstraction.h
automated-tests/src/dali-toolkit/utc-Dali-ItemLayout.cpp
dali-toolkit/internal/controls/scrollable/item-view/depth-layout.cpp
dali-toolkit/internal/controls/scrollable/item-view/grid-layout.cpp
dali-toolkit/internal/image-loader/image-load-thread.h
dali-toolkit/internal/scripting/script-plugin-proxy.h
dali-toolkit/internal/text/multi-language-support-impl.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-mesh-factory.cpp
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/visuals/gradient/gradient-visual.cpp
dali-toolkit/internal/visuals/npatch-loader.cpp

index 278bcd7..8ce96a4 100644 (file)
@@ -2,7 +2,7 @@
 #define __TEST_GL_SYNC_ABSTRACTION_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -108,6 +108,10 @@ public: // TEST FUNCTIONS
   int GetNumberOfSyncObjects();
 
 private:
+
+  TestGlSyncAbstraction( const TestGlSyncAbstraction& ); ///< Undefined
+  TestGlSyncAbstraction& operator=( const TestGlSyncAbstraction& ); ///< Undefined
+
   typedef std::vector<TestSyncObject*>   SyncContainer;
   typedef SyncContainer::iterator SyncIter;
   SyncContainer mSyncObjects;  ///< The sync objects
index 447c78a..aa51150 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -291,6 +291,9 @@ int UtcDaliItemLayoutSetAndGetOrientation(void)
 
   DALI_TEST_CHECK(flickSpeedFactor != 0.0f);
 
+  // White box test here: -( itemId / NoOfItemsPerRow(default 4) ) * NoOfItemsPerRow
+  DALI_TEST_EQUALS( -1.0f, gridLayout->GetItemScrollToPosition( 1 ), TEST_LOCATION );
+
   ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
   view.AddLayout(*depthLayout);
 
index 557a089..613af0a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -390,7 +390,7 @@ float DepthLayout::GetClosestAnchorPosition(float layoutPosition) const
 
 float DepthLayout::GetItemScrollToPosition(unsigned int itemId) const
 {
-  float rowIndex = static_cast<float>(itemId / mImpl->mNumberOfColumns);
+  float rowIndex = static_cast< float >( itemId ) / mImpl->mNumberOfColumns;
   return -rowIndex * static_cast<float>(mImpl->mNumberOfColumns);
 }
 
index e1ca4d0..4ef642c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -390,7 +390,7 @@ float GridLayout::GetClosestAnchorPosition(float layoutPosition) const
 
 float GridLayout::GetItemScrollToPosition(unsigned int itemId) const
 {
-  float rowIndex = static_cast<float>(itemId / mImpl->mNumberOfColumns);
+  float rowIndex = static_cast< float >( itemId ) / mImpl->mNumberOfColumns;
   return -rowIndex * static_cast<float>(mImpl->mNumberOfColumns);
 }
 
index 4eddce7..85ea419 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_IMAGE_LOAD_THREAD_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -83,6 +83,8 @@ public:
    * Add a task in to the loading queue
    *
    * @param[in] task The task added to the queue.
+   *
+   * @note This class takes ownership of the task object
    */
   void AddTask( LoadingTask* task );
 
index 2c359c7..eff47e3 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SCRIPT_PLUGIN_PROXY_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -79,6 +79,10 @@ public:
   bool IsInitialized() const;
 
 private:
+
+  ScriptPluginProxy( const ScriptPluginProxy& ); ///< Undefined
+  ScriptPluginProxy& operator=( const ScriptPluginProxy& ); ///< Undefined
+
   /**
    * @brief Dynamically loads the script plugin.
    */
index ae9a68b..32e7c38 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -565,7 +565,6 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
           // At this point the character common for all scripts has no font assigned.
           // If there is a valid previously cached default font for it, use that one.
           fontId = cachedDefaultFontId;
-          isValidFont = true;
         }
       }
       else
index 4da6c1f..4017f79 100644 (file)
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -83,6 +83,9 @@ void CreateQuad( SizeType imageWidth,
   Vector2 topLeft = Vector2( position.x - 0.5f, position.y - 0.5f );
 
   float fBlockX = texelBlockWidth * static_cast< float >( block % atlasWidthInBlocks );
+
+  // In the next expression, we have purposely made ( block / atlasWidthInBlocks ) yield an integer value and then convert to float as
+  // we do not want the remainder in that expression to affect the value of fBlockY
   float fBlockY = texelBlockHeight * static_cast< float >( block / atlasWidthInBlocks );
 
   // Add on texture filtering compensation ( half a texel plus compensation for filled pixel in top left corner )
index 6d2a022..ee7c4ac 100644 (file)
@@ -75,6 +75,7 @@ EventData::EventData( DecoratorPtr decorator )
   mPlaceholderTextColor( 0.8f, 0.8f, 0.8f, 0.8f ),
   mEventQueue(),
   mInputStyleChangedQueue(),
+  mPreviousState( INACTIVE ),
   mState( INACTIVE ),
   mPrimaryCursorPosition( 0u ),
   mLeftSelectionPosition( 0u ),
index 6f50a9a..bfc9130 100644 (file)
@@ -449,7 +449,7 @@ bool GradientVisual::NewGradient(Type gradientType, const Property::Map& propert
   if( spread )
   {
     Toolkit::GradientVisual::SpreadMethod::Type spreadMethod = Toolkit::GradientVisual::SpreadMethod::PAD;
-    if( Scripting::GetEnumerationProperty( *spread, SPREAD_METHOD_TABLE, SPREAD_METHOD_TABLE_COUNT, spreadMethod ) );
+    if( Scripting::GetEnumerationProperty( *spread, SPREAD_METHOD_TABLE, SPREAD_METHOD_TABLE_COUNT, spreadMethod ) )
     {
       mGradient->SetSpreadMethod( spreadMethod );
     }
index 026450d..6e3c8ec 100644 (file)
@@ -59,12 +59,12 @@ std::size_t NPatchLoader::Load( const std::string& url )
   NinePatchImage ninePatch = NinePatchImage::New( url );
   if( ninePatch )
   {
-    Data* data = new Data();
-    data->hash = hash;
-    data->url = url;
     BufferImage croppedImage = ninePatch.CreateCroppedBufferImage();
     if( croppedImage )
     {
+      Data* data = new Data();
+      data->hash = hash;
+      data->url = url;
       data->textureSet = TextureSet::New();
       TextureSetImage( data->textureSet, 0u, croppedImage );
       data->croppedWidth = croppedImage.GetWidth();