[ekiga] Fixed "In some circumstances, smileys are not displayed graphically"



commit da1e0a5b4029c2ad3f0f6ebb294fc72d11e99bc8
Author: Eugen Dedu <Eugen Dedu pu-pm univ-fcomte fr>
Date:   Wed Sep 2 20:11:02 2009 +0200

    Fixed "In some circumstances, smileys are not displayed graphically"
    
    Fixes bug #593145.

 lib/gui/gm-text-smiley.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/lib/gui/gm-text-smiley.c b/lib/gui/gm-text-smiley.c
index 335c01e..2bce596 100644
--- a/lib/gui/gm-text-smiley.c
+++ b/lib/gui/gm-text-smiley.c
@@ -78,6 +78,10 @@ enhancer_helper_check (G_GNUC_UNUSED GmTextBufferEnhancerHelperIFace* self,
   char* found = NULL;
   gint found_start = 0;
 
+  /* all smileys are checked, and the one chosen is:
+     - the one which starts the soonest;
+     - in case of equality, the one which is the longest.
+  */
   for (smiley = 0;
        smileys[smiley] != NULL;
        smiley = smiley + 2) {
@@ -87,6 +91,7 @@ enhancer_helper_check (G_GNUC_UNUSED GmTextBufferEnhancerHelperIFace* self,
 
       found_start = found - full_text;
       if ((best_smiley == -1)
+          || (found_start < best_start)
 	  || ((found_start <= best_start)
 	      && (strlen (smileys[smiley]) > strlen (smileys[best_smiley])))) {
 



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