[Bf-blender-cvs] [6546442f4f0] master: Fix (unreported) broken 'compse' feature when editing text.

Bastien Montagne noreply at git.blender.org
Mon Jul 8 16:12:05 CEST 2019


Commit: 6546442f4f0a275a15969e1daefcc8e0f5fa8f54
Author: Bastien Montagne
Date:   Mon Jul 8 16:09:28 2019 +0200
Branches: master
https://developer.blender.org/rB6546442f4f0a275a15969e1daefcc8e0f5fa8f54

Fix (unreported) broken 'compse' feature when editing text.

Looks like that code was not updated when we switched to unicode, it was
still returning axtended ascii codes (iso-8859-15 ones I think)...

That was breaking some chars, which have a very different value in
unicode. Found while working on Text section of the Manual! ;)

===================================================================

M	source/blender/editors/curve/editfont.c

===================================================================

diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index ffbfb692ca9..db3d5ad401d 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -73,9 +73,9 @@ static int kill_selection(Object *obedit, int ins);
 
 /************************* utilities ******************************/
 
-static char findaccent(char char1, unsigned int code)
+static wchar_t findaccent(wchar_t char1, unsigned int code)
 {
-  char new = 0;
+  wchar_t new = 0;
 
   if (char1 == 'a') {
     if (code == '`') {
@@ -170,7 +170,7 @@ static char findaccent(char char1, unsigned int code)
       new = 186;
     }
     else if (code == 'e') {
-      new = 143;
+      new = 339;
     }
     else if (code == 'c') {
       new = 169;
@@ -191,7 +191,7 @@ static char findaccent(char char1, unsigned int code)
   }
   else if (char1 == 't') {
     if (code == 'm') {
-      new = 153;
+      new = 8482;
     }
   }
   else if (char1 == 'u') {
@@ -342,7 +342,7 @@ static char findaccent(char char1, unsigned int code)
       new = 247;
     }
     if (code == '|') {
-      new = 135;
+      new = 8224;
     }
     if (code == '+') {
       new = 177;
@@ -350,15 +350,15 @@ static char findaccent(char char1, unsigned int code)
   }
   else if (char1 == '|') {
     if (code == '-') {
-      new = 135;
+      new = 8224;
     }
     if (code == '=') {
-      new = 136;
+      new = 8225;
     }
   }
   else if (char1 == '=') {
     if (code == '|') {
-      new = 136;
+      new = 8225;
     }
   }
   else if (char1 == '+') {



More information about the Bf-blender-cvs mailing list