[wx-dev] #9560: improve compatibility of wxDateTime::ParseFormat()
with old Unicode build
wxTrac
noreply at wxsite.net
Mon Jun 9 15:48:41 PDT 2008
Ticket URL: <http://trac.wxwidgets.org/ticket/9560>
#9560: improve compatibility of wxDateTime::ParseFormat() with old Unicode build
----------------------------------------------------------+-----------------
Reporter: vadz | Owner: vadz
Type: defect | Status: new
Priority: normal | Milestone: 2.9.0
Component: base | Version: 2.9-svn
Keywords: unicode compatibility wxDateTime ParseFormat | Blockedby:
Patch: 0 | Blocking:
----------------------------------------------------------+-----------------
Currently code like
{{{
const wxChar *p = dt.ParseFormat(wxT("..."));
}}}
compiles. And so does
{{{
const char *p = dt.ParseFormat("...");
const char *q = dt.ParseFormat(wxString());
const char *s = dt.ParseFormat(wxString().c_str());
}}}
so compatibility with the old ANSI build is good.
But the last 2 lines don't compile if `wxChar` is used for the variables
to which return value is assigned. To fix this we need to return an object
convertible to either narrow or wide string from `ParseFormat()` but it
can't be `wxCStrData` because it can't be `NULL` (but return value of this
function can).
So the idea would be to add some `wxAnyStr` (name by Vaclav, thanks) which
would just store any kind of string passed to it (without copying it), a
la `wxFormatString`, but also be convertible to either kind of string.
This should improve compatibility and also allow us to have only one
overload of the method above instead of the 4 we have currently.
--
Ticket URL: <http://trac.wxwidgets.org/ticket/9560>
More information about the wx-dev
mailing list