Use wxString() instead of "" for empty strings
This will allow this code to work even when implicit conversion from "const char*" is disabled in wxString and is already marginally more efficient even now. See https://github.com/wxWidgets/wxWidgets/pull/782
This commit is contained in:
committed by
Vadim Zeitlin
parent
e905b94436
commit
8d02384792
@@ -59,7 +59,7 @@ public:
|
||||
// And we also use wxBU_EXACTFIT to avoid being resized up to the
|
||||
// standard button size as this doesn't make sense for bitmap buttons
|
||||
// which are not standard anyhow and should fit their bitmap size.
|
||||
return wxButton::Create(parent, winid, "",
|
||||
return wxButton::Create(parent, winid, wxString(),
|
||||
pos, size,
|
||||
style | wxBU_NOTEXT | wxBU_EXACTFIT,
|
||||
validator, name);
|
||||
|
@@ -5239,7 +5239,7 @@ public:
|
||||
|
||||
virtual void Remove(long from, long to) wxOVERRIDE
|
||||
{
|
||||
Replace(from, to, "");
|
||||
Replace(from, to, wxString());
|
||||
}
|
||||
virtual void Replace(long from, long to, const wxString& text) wxOVERRIDE
|
||||
{
|
||||
|
@@ -1617,7 +1617,7 @@ public:
|
||||
static wxString FromUTF8(const char *utf8)
|
||||
{
|
||||
if ( !utf8 || !wxStringOperations::IsValidUtf8String(utf8) )
|
||||
return "";
|
||||
return wxString();
|
||||
|
||||
return FromImpl(wxStringImpl(utf8));
|
||||
}
|
||||
@@ -1627,7 +1627,7 @@ public:
|
||||
return FromUTF8(utf8);
|
||||
|
||||
if ( !utf8 || !wxStringOperations::IsValidUtf8String(utf8, len) )
|
||||
return "";
|
||||
return wxString();
|
||||
|
||||
return FromImpl(wxStringImpl(utf8, len));
|
||||
}
|
||||
|
Reference in New Issue
Block a user