Commit Graph

31 Commits

Author SHA1 Message Date
Vadim Zeitlin
7a91ad2cee Only use wxLocale functions if wxUSE_INTL == 1.
Don't use locale-dependent formats in wxDateTime::ParseFormat() when locale
support is disabled.

Closes #11121.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61731 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-08-21 18:46:39 +00:00
Vadim Zeitlin
9a83f86094 Globally replace _T() with wxT().
Standardize on using a single macro across all wxWidgets sources and solve the name clash with Sun CC standard headers (see #10660).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-07-23 20:30:22 +00:00
Vadim Zeitlin
eaed41872c Handle %e in ParseFormat().
This allows us to parse the format returned by wxLocale::GetInfo(wxLOCALE_DATE_TIME_FMT) under Linux.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61496 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-07-22 16:44:06 +00:00
Vadim Zeitlin
5ec58699d0 suppress harmless warning about possibly uninitialized variable in ParseRfc822Date() in OSX build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-07-03 12:14:51 +00:00
Vadim Zeitlin
01b56a96ae don't redefine HAVE_STRFTIME as it can already be defined by configure (forgotten part of r60842)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-05-31 19:40:57 +00:00
Vadim Zeitlin
0c51a971fb no changes, just removed unused variable
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60012 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-04 12:08:50 +00:00
Vadim Zeitlin
79c4aa385f fix parsing of %p for locales which use periods in AM/PM strings (see #10677)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60011 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-04 11:53:08 +00:00
Vadim Zeitlin
f253c22f29 really fix handling of trailing periods in abbreviated month names in French locale (without breaking everything else like last commit did)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59999 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-03 16:37:52 +00:00
Vadim Zeitlin
6b26ab96f7 allow for trailing periods in week day/month names (as used in e.g. French locale)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59998 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-03 15:42:06 +00:00
Stefan Csomor
911907f4ad adding OSX specific fixes to bsd level formatting problems
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59944 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-30 18:26:23 +00:00
Vadim Zeitlin
694cb6c581 don't dereference end iterator (closes #10656)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-29 21:04:55 +00:00
Vadim Zeitlin
89a7e1ff98 Added wxLOCALE_DATE/TIME_FMT support to wxLocale::GetInfo().
- Implement for POSIX and Win32, TODO for OS X
- Use this instead of ad hoc code in wxDateTime::ParseFormat()
- Remove HAVE_STRPTIME, we don't need nor use strptime() any more


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59914 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-29 17:15:43 +00:00
Vadim Zeitlin
55fffc3418 minor corrections to TranslateFromUnicodeFormat()
- Don't try to dereference end() iteratorm this will fail (unlike comparing
  pointer with NUL)
- Use prefix rather than postfix increment for iterator
- Use wxUniChar::GetValue() rather than cast to char for consistency with
  other switch statements in the same file


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59880 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-26 23:07:07 +00:00
Stefan Csomor
1a39a1d7c0 changing to iterator
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59878 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-26 20:38:43 +00:00
Stefan Csomor
59d454cda2 revert to proper defaults for US
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59864 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-26 14:35:13 +00:00
Stefan Csomor
be8dbffa00 better native date locale support
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59861 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-26 10:17:19 +00:00
Vadim Zeitlin
ed973feb5a fix dereferencing end() iterator in ParseFormat() and constructing out of bound iterator in ParseDate() (thanks to VC9 debug CRT for the warnings)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59839 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-25 11:51:37 +00:00
Vadim Zeitlin
c398434d92 abandon attempts to make wxAnyStrPtr behave as bool: user-defined logical operators don't short circuit silently breaking existing code so it is better to not provide them at all; instead simply return bool from the new versions taking wxString::const_iterator; advise to use the new versions in the new code and so in our own files
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59829 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-25 09:54:10 +00:00
Vadim Zeitlin
254696bb8f return a wxAnyStrPtr covnertible to either narrow or wide char pointer from wxDateTime::ParseXXX() methods to improve compatibility with wx 2.8 and also simplify the code (closes #9560)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59822 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-24 23:21:29 +00:00
Vadim Zeitlin
2887455004 correct translation between iterators and char pointers in CallStrptime()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59810 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-24 12:20:23 +00:00
Vadim Zeitlin
115eded74f work around VC6 bug
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59808 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-24 11:18:34 +00:00
Vadim Zeitlin
19f5f4abbe compilation fix: remove extraneous variable declaration after last commit (why didn't g++ complain about it?)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59806 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-24 09:15:44 +00:00
Vadim Zeitlin
66f22f4ae5 fix parsing methods for non-ASCII strings (e.g. dates in non-"C" locales) (see #9560)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-24 00:11:42 +00:00
Francesco Montorsi
9decc52d62 fix unreadable typo
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59692 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-21 12:27:21 +00:00
Francesco Montorsi
8aa25f4025 handle locales where AM/PM strings are empty
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-21 00:19:27 +00:00
Francesco Montorsi
1ee2f9d96d share a few helpers between datetime.cpp and datetimefmt.cpp
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-20 22:07:09 +00:00
Francesco Montorsi
48fd6e9dd7 build fix (part of r59673, r59656)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-20 21:42:43 +00:00
Francesco Montorsi
cac1cfce37 build fix for systems where HAVE_STRPTIME is defined
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59673 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-20 21:00:15 +00:00
Francesco Montorsi
c4e085608a make GetNumOfDaysInMonth static again; in datetimefmt.cpp use GetNumberOfDays instead.
Attempt to fix wxDateTime::ParseFormat(date, "%c") by using strptime() before our own heuristic checks.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59667 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-20 20:45:20 +00:00
Francesco Montorsi
54e660f85e move parsing helpers, too (part of r59656)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59658 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-20 19:25:48 +00:00
Francesco Montorsi
98919134f0 no real changes: split the huge datetime.cpp in two parts: one dedicated to code for formatting/parsing, the other for everything else
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-20 19:16:21 +00:00