diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-10-05 12:55:52 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-10-05 13:02:02 +0300 |
commit | 86aeb7df961b994e87be57d85410de530b392f3e (patch) | |
tree | 4a928fa7bde7cdd6aea6f8a08998316a2914755d /source/blender | |
parent | 3d5622a20883f6eab4dfb491faf57b3e5e349e9e (diff) |
Fix T46379: Bad behavior of bUnit_ToUnitAltName() with default units.
It would simply remove default units (in most case), cannot see any good reason for such behavior?
Might work in case default unit is the only one present, but breaks consistency (and it may not be
always obvious for user which unit it is). Comes from original patch from five years ago, rB7d8f0fce.
This will break keyboard-setting of values, e.g. '2m 33.4cm' would become '2 33.4cm',
totally useless and invalid entry!
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/unit.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index 64d561491e2..ab8fbabd329 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -730,11 +730,10 @@ void bUnit_ToUnitAltName(char *str, int len_max, const char *orig_str, int syste bUnitCollection *usys = unit_get_system(system, type); bUnitDef *unit; - bUnitDef *unit_def = unit_default(usys); /* find and substitute all units */ for (unit = usys->units; unit->name; unit++) { - if (len_max > 0 && (unit->name_alt || unit == unit_def)) { + if (len_max > 0 && unit->name_alt) { const char *found = unit_find_str(orig_str, unit->name_short); if (found) { int offset = (int)(found - orig_str); |