mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-06 17:37:21 +02:00
Bug #1189
- Fixed bug #1189, which caused wide Asian UTF8 characters to be measured as narrow characters (thanks to Roy Zuo).
This commit is contained in:
parent
914447c885
commit
6aa0277749
10 changed files with 45 additions and 36 deletions
|
@ -32,6 +32,7 @@
|
|||
#include <Date.h>
|
||||
#include <ColUDA.h>
|
||||
#include <text.h>
|
||||
#include <utf8.h>
|
||||
#include <i18n.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
@ -99,11 +100,11 @@ void ColumnUDA::measure (Task& task, unsigned int& minimum, unsigned int& maximu
|
|||
if (format == "")
|
||||
format = context.config.get ("dateformat");
|
||||
|
||||
minimum = maximum = date.toString (format).length ();
|
||||
minimum = maximum = utf8_width (date.toString (format));
|
||||
}
|
||||
else if (_type == "duration")
|
||||
{
|
||||
minimum = maximum = Duration (value).formatCompact ().length ();
|
||||
minimum = maximum = utf8_width (Duration (value).formatCompact ());
|
||||
}
|
||||
else if (_type == "string")
|
||||
{
|
||||
|
@ -113,7 +114,7 @@ void ColumnUDA::measure (Task& task, unsigned int& minimum, unsigned int& maximu
|
|||
}
|
||||
else if (_type == "numeric")
|
||||
{
|
||||
minimum = maximum = value.length ();
|
||||
minimum = maximum = utf8_width (value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue