https://bugs.kde.org/show_bug.cgi?id=396405

--- Comment #7 from Ralf Habacker <ralf.habac...@freenet.de> ---
(In reply to Thomas Baumgart from comment #6)
> > From what I can see now, a correct implementation of> 
> > Register::minimumColumnWidth() should get the longest date string for the
> > current language by iterating all dates for a whole given year once at
> > application start and use that for the date column minimal width.
> 
> I would only iterate over the weekdays and the months. That leaves 19
> iterations instead of 365/366.

This only returns the correct string length if the user really enters'WEEKDAY'
and'MONTH'. In any other case, the string length is too long. 

To avoid this, a kind of parser would be required to be able to choose over
which elements to iterate. Note that there is no control over what the user
enters in the short date field. 
To avoid this, I iterate over all days of a year, which takes about 2 ms at
program start.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to