X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Ftext%2Ftext-visual.cpp;h=31dc8bb2f721e0faa9e3d885da7adc3162dcf385;hp=3f9dd1e0da6d6afd18274a629adf0fc373c4113a;hb=bd8218422386b6ec88f744233587fd085d0135da;hpb=f4c1e7f52d49c3ce033b9ee4c3c7414b06a22d45 diff --git a/dali-toolkit/internal/visuals/text/text-visual.cpp b/dali-toolkit/internal/visuals/text/text-visual.cpp index 3f9dd1e..31dc8bb 100644 --- a/dali-toolkit/internal/visuals/text/text-visual.cpp +++ b/dali-toolkit/internal/visuals/text/text-visual.cpp @@ -259,10 +259,8 @@ TextVisual::~TextVisual() { } -void TextVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap ) +void TextVisual::DoSetProperties( const Property::Map& propertyMap ) { - mSelf = actor; - for( Property::Map::SizeType index = 0u, count = propertyMap.Count(); index < count; ++index ) { const KeyValuePair& keyValue = propertyMap.GetKeyValue( index ); @@ -812,6 +810,13 @@ Dali::Property::Value TextVisual::DoGetProperty( Dali::Property::Index index ) void TextVisual::RenderText() { + Actor self = mSelf.GetHandle(); + if( !self ) + { + // Nothing to do if the handle is not initialized. + return; + } + Actor renderableActor; if( mRenderer ) @@ -828,7 +833,7 @@ void TextVisual::RenderText() const Vector2& scrollOffset = mController->GetScrollPosition(); renderableActor.SetPosition( scrollOffset.x, scrollOffset.y ); - mSelf.Add( renderableActor ); + self.Add( renderableActor ); } mRenderableActor = renderableActor; @@ -849,6 +854,13 @@ void TextVisual::StopTextAutoScrolling() void TextVisual::SetUpAutoScrolling() { + Actor self = mSelf.GetHandle(); + if( !self ) + { + // Nothing to do if the handle is not initialized. + return; + } + const Text::ScrollerData* const data = mController->GetAutoScrollData(); if( NULL != data ) @@ -862,8 +874,8 @@ void TextVisual::SetUpAutoScrolling() mTextScroller->StartScrolling( mRenderableActor, *data ); - mSelf.Add( mTextScroller->GetScrollingText() ); - mSelf.Add( mTextScroller->GetSourceCamera() ); + self.Add( mTextScroller->GetScrollingText() ); + self.Add( mTextScroller->GetSourceCamera() ); } }