Prevent font data being cleared when System font changes 64/48364/1
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Fri, 18 Sep 2015 10:23:59 +0000 (11:23 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Fri, 18 Sep 2015 10:27:50 +0000 (11:27 +0100)
* Font data is being cleared incorrectly outside of a conditional block, now inside that block

Change-Id: Ia3266538323a9ca935622ed3376ca18aad9f54db
Signed-off-by: Agnelo Vaz <agnelo.vaz@samsung.com>
dali-toolkit/internal/text/text-controller.cpp

index f9979df..a1283fb 100644 (file)
@@ -404,11 +404,10 @@ void Controller::UpdateAfterFontChange( std::string& newDefaultFont )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Concise, "Controller::UpdateAfterFontChange");
 
-  ClearFontData();
-
   if ( !mImpl->mUserDefinedFontFamily ) // If user defined font then should not update when system font changes
   {
     DALI_LOG_INFO( gLogFilter, Debug::Concise, "Controller::UpdateAfterFontChange newDefaultFont(%s)\n", newDefaultFont.c_str() );
+    ClearFontData();
     mImpl->mFontDefaults->mFontDescription.family = newDefaultFont;
     mImpl->UpdateModel( ALL_OPERATIONS );
     mImpl->QueueModifyEvent( ModifyEvent::TEXT_REPLACED );