Fix SVACE errors in accessibility code in control-data-impl 53/261753/2
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 23 Jul 2021 11:06:41 +0000 (12:06 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 23 Jul 2021 11:09:44 +0000 (12:09 +0100)
Change-Id: I08d2e79b19cb269ed48db198ebd04a45f9f89d18

dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/internal/controls/control/control-data-impl.h

index 8fd35e0..0b41d3f 100644 (file)
@@ -550,6 +550,12 @@ const Control::Impl& Control::Impl::Get(const Internal::Control& internalControl
 void Control::Impl::CheckHighlightedObjectGeometry(PropertyNotification& propertyNotification)
 {
   auto accessibleImpl = dynamic_cast<Dali::Toolkit::DevelControl::AccessibleImpl*>(mAccessibilityObject.get());
+  if(!accessibleImpl)
+  {
+    DALI_LOG_ERROR("accessibleImpl is not a pointer to a DevelControl::AccessibleImpl type");
+    return;
+  }
+
   auto lastPosition   = accessibleImpl->GetLastPosition();
   auto accessibleRect = accessibleImpl->GetExtents(Dali::Accessibility::CoordinateType::WINDOW);
 
index 4c480a0..c31ed81 100644 (file)
@@ -495,17 +495,17 @@ public:
   int mUpFocusableActorId;    ///< Actor ID of Up focusable control.
   int mDownFocusableActorId;  ///< Actor ID of Down focusable control.
 
-  RegisteredVisualContainer                                      mVisuals; ///< Stores visuals needed by the control, non trivial type so std::vector used.
-  std::string                                                    mStyleName;
-  Vector4                                                        mBackgroundColor;    ///< The color of the background visual
-  Vector3*                                                       mStartingPinchScale; ///< The scale when a pinch gesture starts, TODO: consider removing this
-  Extents                                                        mMargin;             ///< The margin values
-  Extents                                                        mPadding;            ///< The padding values
-  Toolkit::Control::KeyEventSignalType                           mKeyEventSignal;
-  Toolkit::Control::KeyInputFocusSignalType                      mKeyInputFocusGainedSignal;
-  Toolkit::Control::KeyInputFocusSignalType                      mKeyInputFocusLostSignal;
-  Toolkit::Control::ResourceReadySignalType                      mResourceReadySignal;
-  DevelControl::VisualEventSignalType                            mVisualEventSignal;
+  RegisteredVisualContainer                 mVisuals; ///< Stores visuals needed by the control, non trivial type so std::vector used.
+  std::string                               mStyleName;
+  Vector4                                   mBackgroundColor;    ///< The color of the background visual
+  Vector3*                                  mStartingPinchScale; ///< The scale when a pinch gesture starts, TODO: consider removing this
+  Extents                                   mMargin;             ///< The margin values
+  Extents                                   mPadding;            ///< The padding values
+  Toolkit::Control::KeyEventSignalType      mKeyEventSignal;
+  Toolkit::Control::KeyInputFocusSignalType mKeyInputFocusGainedSignal;
+  Toolkit::Control::KeyInputFocusSignalType mKeyInputFocusLostSignal;
+  Toolkit::Control::ResourceReadySignalType mResourceReadySignal;
+  DevelControl::VisualEventSignalType       mVisualEventSignal;
 
   // Accessibility
   Toolkit::DevelControl::AccessibilityActivateSignalType         mAccessibilityActivateSignal;
@@ -515,15 +515,15 @@ public:
   Toolkit::DevelControl::AccessibilityReadingCancelledSignalType mAccessibilityReadingCancelledSignal;
   Toolkit::DevelControl::AccessibilityReadingStoppedSignalType   mAccessibilityReadingStoppedSignal;
 
-  Toolkit::DevelControl::AccessibilityGetNameSignalType          mAccessibilityGetNameSignal;
-  Toolkit::DevelControl::AccessibilityGetDescriptionSignalType   mAccessibilityGetDescriptionSignal;
-  Toolkit::DevelControl::AccessibilityDoGestureSignalType        mAccessibilityDoGestureSignal;
+  Toolkit::DevelControl::AccessibilityGetNameSignalType        mAccessibilityGetNameSignal;
+  Toolkit::DevelControl::AccessibilityGetDescriptionSignalType mAccessibilityGetDescriptionSignal;
+  Toolkit::DevelControl::AccessibilityDoGestureSignalType      mAccessibilityDoGestureSignal;
 
   std::string mAccessibilityName;
   std::string mAccessibilityDescription;
   std::string mAccessibilityTranslationDomain;
-  bool        mAccessibilityNameSet = false;
-  bool        mAccessibilityDescriptionSet = false;
+  bool        mAccessibilityNameSet              = false;
+  bool        mAccessibilityDescriptionSet       = false;
   bool        mAccessibilityTranslationDomainSet = false;
 
   bool mAccessibilityHighlightable    = false;
@@ -583,7 +583,7 @@ private:
   // Accessibility - notification for highlighted object to check if it is showing.
   bool                                      mIsAccessibilityPositionPropertyNotificationSet{false};
   Dali::PropertyNotification                mAccessibilityPositionNotification;
-  Dali::Accessibility::MovedOutOfScreenType mAccessibilityMovedOutOfScreenDirection;
+  Dali::Accessibility::MovedOutOfScreenType mAccessibilityMovedOutOfScreenDirection{Accessibility::MovedOutOfScreenType::NONE};
 };
 
 } // namespace Internal