From: Kimmo Hoikka Date: Mon, 6 Jul 2015 12:46:25 +0000 (+0100) Subject: Only use StyleManager if it really is available X-Git-Tag: dali_1.0.48~11^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=8a98cff44ef0a693a6d686d60258deaea8b519f8 Only use StyleManager if it really is available Change-Id: I90fdf261f7e93faeaa3fa14daa021169f98467c6 --- diff --git a/dali-toolkit/public-api/controls/control-impl.cpp b/dali-toolkit/public-api/controls/control-impl.cpp index 2274995..c0c71ea 100644 --- a/dali-toolkit/public-api/controls/control-impl.cpp +++ b/dali-toolkit/public-api/controls/control-impl.cpp @@ -548,9 +548,12 @@ void Control::SetStyleName( const std::string& styleName ) { mImpl->mStyleName = styleName; - // Apply new style + // Apply new style, if stylemanager is available Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get(); - GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) ); + if( styleManager ) + { + GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) ); + } } } @@ -865,12 +868,15 @@ void Control::Initialize() if( mImpl->mFlags & REQUIRES_STYLE_CHANGE_SIGNALS ) { Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get(); + // if stylemanager is available + if( styleManager ) + { + // Register for style changes + styleManager.StyleChangeSignal().Connect( this, &Control::OnStyleChange ); - // Register for style changes - styleManager.StyleChangeSignal().Connect( this, &Control::OnStyleChange ); - - // Apply the current style - GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) ); + // Apply the current style + GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) ); + } } if( mImpl->mFlags & REQUIRES_KEYBOARD_NAVIGATION_SUPPORT )