On 10/01/2009 03:28 PM, Nikolay Sivov wrote:
Paul Vriens wrote:
On 10/01/2009 02:58 PM, Nikolay Sivov wrote:
Yes, please. If a problem is only in rectangle orders it's very simple to fix (test for yyyy in returned locale data). I suggest not to drop tests yet, we'll probably want to drop them later when trying probable dpi-dependent failures.
Well I need to test for all possible occurrences of month and year. So something like:
/* Get the format of the title */ len = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SYEARMONTH, NULL, 0); yearmonth = HeapAlloc(GetProcessHeap(), 0, len); GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SYEARMONTH, yearmonth, len); /* Find out the order */ year = strstr(yearmonth, "y"); month = strstr(yearmonth, "M");
if (month < year) trace("Month before year\n"); else trace("Year before month\n"); HeapFree(GetProcessHeap(), 0, yearmonth);
Yes, not all possible actually, only month < year condition matters. It's better to use yyyy pattern cause some locales add extra words in this format string. Also a static char[80] buffer should be used to simplify things (btw, MSDN says about 80 character length for
Yeah, but as I didn't find a nice constant for this I opted for the dynamic one.
The problem with the 'yyyy' pattern is that this is not the only pattern.
year : "yyyyy", "yyyy", "yy", "y" month : "MMMM", "MMM", "MM", "M"
This for example "yyyy maybe MMMM" produces "2007 may7be April" in the title. (There is a limit to what can be used for LOCALE_SYEARMONTH though.)
all locale data, but we currently use much shorter in some cases - about 10, 30 or so. Unfortunately there's no way to check this max length value, cause it's more like a max resource length. Anyway I'm going to use this value in next patch set maybe cause it's documented at least and isn't so magic like ours).
The 3 tests I removed with the first patch can be removed safely as all should be tested in the loop.
Now I need to change the way we test to cope with:
- order of year/month
Ok.
- text right after the prev button or right before the next button
Not sure what you mean here. Isn't it the same as order?
If you change the regional settings to Portuguese (on a Windows box) you see what I mean. There is no room between the buttons and the text.