[gcompris] click_on_letter: no more change the internal model when uppercase is forced.



commit 5a9d463a3d705f77bb868dd29a7a5c843f86bb23
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Sat Aug 27 16:57:05 2011 +0200

    click_on_letter: no more change the internal model when uppercase is forced.
    
    It had a side effect to change the dataset in edition.

 src/click_on_letter-activity/click_on_letter.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/src/click_on_letter-activity/click_on_letter.c b/src/click_on_letter-activity/click_on_letter.c
index d3fb6c8..dcfb763 100644
--- a/src/click_on_letter-activity/click_on_letter.c
+++ b/src/click_on_letter-activity/click_on_letter.c
@@ -519,15 +519,18 @@ static GooCanvasItem *click_on_letter_create_item(GooCanvasItem *parent)
 
       if ( uppercase_only )
 	{
-	  gchar *answers = g_utf8_strup( level->answers, -1 );
-	  gchar *questions = g_utf8_strup( level->questions, -1 );
-	  g_free( level->answers );
-	  g_free( level->questions );
-	  level->answers = answers;
-	  level->questions = questions;
+	  gchar *answers_up = g_utf8_strup( level->answers, -1 );
+	  gchar *questions_up = g_utf8_strup( level->questions, -1 );
+	  answers = shuffle_utf8(answers_up);
+	  questions = shuffle_utf8(questions_up);
+	  g_free(answers_up);
+	  g_free(questions_up);
+	}
+      else
+	{
+	  answers = shuffle_utf8(level->answers);
+	  questions = shuffle_utf8(level->questions);
 	}
-      answers = shuffle_utf8(level->answers);
-      questions = shuffle_utf8(level->questions);
 
       /* Go to next level after this number of 'play' */
       gcomprisBoard->number_of_sublevel = g_utf8_strlen (level->questions, -1);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]