From: Javon Prince Date: Thu, 24 Apr 2014 15:22:41 +0000 (+0100) Subject: Optimizing markup processing X-Git-Tag: dali-2014-wk20-release~30 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=35714d363fefee93222a098a5f3c4cc02355e707 Optimizing markup processing Only reprocess markup-text in the TextView when the 'markup-enabled' property is changed to true Change-Id: I9011af832a27fa4c6b5d3b9dfe59c9890f91725c Signed-off-by: Javon Prince --- diff --git a/dali-toolkit/internal/controls/text-view/text-view-impl.cpp b/dali-toolkit/internal/controls/text-view/text-view-impl.cpp index 37ce628..6bfaed3 100644 --- a/dali-toolkit/internal/controls/text-view/text-view-impl.cpp +++ b/dali-toolkit/internal/controls/text-view/text-view-impl.cpp @@ -2121,13 +2121,17 @@ void TextView::SetProperty( BaseObject* object, Property::Index index, const Pro { Internal::TextView& textViewImpl( GetImpl( textView ) ); bool newValue( value.Get() ); - textViewImpl.SetMarkupProcessingEnabled( newValue ); - if( newValue ) + if( newValue != textViewImpl.IsMarkupProcessingEnabled() ) { - const std::string& currentText( textViewImpl.GetText() ); - if( ! currentText.empty() ) + textViewImpl.SetMarkupProcessingEnabled( newValue ); + if( newValue ) { - textViewImpl.SetText( currentText ); + // If markup processing has been enabled, Ensure current text is reprocessed. + const std::string& currentText( textViewImpl.GetText() ); + if( ! currentText.empty() ) + { + textViewImpl.SetText( currentText ); + } } } }