Last .empty() string source cleaning before 2.5.4.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-02-02 13:57:02 +00:00
parent 5c2a509fca
commit 525d858363
17 changed files with 50 additions and 50 deletions

View File

@@ -803,7 +803,7 @@ wxDateTime::wxDateTime_t wxDateTime::GetNumberOfDays(wxDateTime::Month month,
wxString wxDateTime::GetMonthName(wxDateTime::Month month,
wxDateTime::NameFlags flags)
{
wxCHECK_MSG( month != Inv_Month, _T(""), _T("invalid month") );
wxCHECK_MSG( month != Inv_Month, wxEmptyString, _T("invalid month") );
// notice that we must set all the fields to avoid confusing libc (GNU one
// gets confused to a crash if we don't do this)
@@ -818,7 +818,7 @@ wxString wxDateTime::GetMonthName(wxDateTime::Month month,
wxString wxDateTime::GetWeekDayName(wxDateTime::WeekDay wday,
wxDateTime::NameFlags flags)
{
wxCHECK_MSG( wday != Inv_WeekDay, _T(""), _T("invalid weekday") );
wxCHECK_MSG( wday != Inv_WeekDay, wxEmptyString, _T("invalid weekday") );
// take some arbitrary Sunday (but notice that the day should be such that
// after adding wday to it below we still have a valid date, e.g. don't
@@ -2068,7 +2068,7 @@ wxDateTime& wxDateTime::MakeTimezone(const TimeZone& tz, bool noDST)
wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
{
wxCHECK_MSG( format, _T(""), _T("NULL format in wxDateTime::Format") );
wxCHECK_MSG( format, wxEmptyString, _T("NULL format in wxDateTime::Format") );
// we have to use our own implementation if the date is out of range of
// strftime() or if we use non standard specificators
@@ -3849,7 +3849,7 @@ enum TimeSpanPart
// %l milliseconds (000 - 999)
wxString wxTimeSpan::Format(const wxChar *format) const
{
wxCHECK_MSG( format, _T(""), _T("NULL format in wxTimeSpan::Format") );
wxCHECK_MSG( format, wxEmptyString, _T("NULL format in wxTimeSpan::Format") );
wxString str;
str.Alloc(wxStrlen(format));

View File

@@ -288,7 +288,7 @@ void wxStringHashTable::Put(long key, const wxString& value)
wxString wxStringHashTable::Get(long key, bool *wasFound) const
{
wxCHECK_MSG( m_hashSize, _T(""), _T("must call Create() first") );
wxCHECK_MSG( m_hashSize, wxEmptyString, _T("must call Create() first") );
size_t slot = (size_t)abs((int)(key % (long)m_hashSize));
@@ -311,7 +311,7 @@ wxString wxStringHashTable::Get(long key, bool *wasFound) const
if ( wasFound )
*wasFound = false;
return _T("");
return wxEmptyString;
}
bool wxStringHashTable::Delete(long key) const

View File

@@ -1226,7 +1226,7 @@ void wxMsgCatalogFile::FillHash(wxMessagesHash& hash,
{
#if wxUSE_WCHAR_T
wxCSConv *csConv = NULL;
if ( !m_charset.IsEmpty() )
if ( !m_charset.empty() )
csConv = new wxCSConv(m_charset);
wxMBConv& inputConv = csConv ? *((wxMBConv*)csConv) : *wxConvCurrent;
@@ -1462,7 +1462,7 @@ bool wxLocale::Init(const wxChar *szName,
// the short name will be used to look for catalog files as well,
// so we need something here
if ( m_strShort.IsEmpty() ) {
if ( m_strShort.empty() ) {
// FIXME I don't know how these 2 letter abbreviations are formed,
// this wild guess is surely wrong
if ( szLocale && szLocale[0] )
@@ -1637,7 +1637,7 @@ bool wxLocale::Init(int language, int flags)
if (codepage != 0)
locale << wxT(".") << buffer;
}
if (locale.IsEmpty())
if (locale.empty())
{
wxLogLastError(wxT("SetThreadLocale"));
wxLogError(wxT("Cannot set locale to language %s."), name.c_str());
@@ -2545,14 +2545,14 @@ wxString wxLocale::GetHeaderValue( const wxChar* szHeader,
if ( pMsgCat == NULL )
return wxEmptyString;
pszTrans = pMsgCat->GetString(wxT(""), (size_t)-1);
pszTrans = pMsgCat->GetString(wxEmptyString, (size_t)-1);
}
else
{
// search in all domains
for ( pMsgCat = m_pMsgCat; pMsgCat != NULL; pMsgCat = pMsgCat->m_pNext )
{
pszTrans = pMsgCat->GetString(wxT(""), (size_t)-1);
pszTrans = pMsgCat->GetString(wxEmptyString, (size_t)-1);
if ( pszTrans != NULL ) // take the first found
break;
}

View File

@@ -141,7 +141,7 @@ wxAcceleratorEntry *wxGetAccelFromString(const wxString& label)
}
}
if ( current.IsEmpty() ) {
if ( current.empty() ) {
wxLogDebug(wxT("No accel key found, accel string ignored."));
}
else {
@@ -706,7 +706,7 @@ wxString wxMenuBase::GetLabel( int id ) const
{
wxMenuItem *item = FindItem(id);
wxCHECK_MSG( item, wxT(""), wxT("wxMenu::GetLabel: no such item") );
wxCHECK_MSG( item, wxEmptyString, wxT("wxMenu::GetLabel: no such item") );
return item->GetText();
}
@@ -724,7 +724,7 @@ wxString wxMenuBase::GetHelpString( int id ) const
{
wxMenuItem *item = FindItem(id);
wxCHECK_MSG( item, wxT(""), wxT("wxMenu::GetHelpString: no such item") );
wxCHECK_MSG( item, wxEmptyString, wxT("wxMenu::GetHelpString: no such item") );
return item->GetHelp();
}

View File

@@ -196,7 +196,7 @@ wxString wxFileType::ExpandCommand(const wxString& command,
// know of the correct solution, try to guess what we have to do.
// test now carried out on reading file so test should never get here
if ( !hasFilename && !str.IsEmpty()
if ( !hasFilename && !str.empty()
#ifdef __UNIX__
&& !str.StartsWith(_T("test "))
#endif // Unix
@@ -428,7 +428,7 @@ bool wxFileType::SetDefaultIcon(const wxString& cmd, int index)
// VZ: should we do this?
// chris elliott : only makes sense in MS windows
if ( sTmp.empty() )
GetOpenCommand(&sTmp, wxFileType::MessageParameters(wxT(""), wxT("")));
GetOpenCommand(&sTmp, wxFileType::MessageParameters(wxEmptyString, wxEmptyString));
#endif
wxCHECK_MSG( !sTmp.empty(), false, _T("need the icon file") );

View File

@@ -56,7 +56,7 @@ const wxClassInfo* wxObject::ms_classParents[] = { NULL } ;
{ return &data.wxTEMPLATED_MEMBER_CALL(Get , wxObject) ; }
wxxVariant wxObjectToVariantConverterwxObject ( wxObject *data )
{ return wxxVariant( dynamic_cast<wxObject*> (data) ) ; }
wxClassInfo wxObject::ms_classInfo(ms_classParents , wxT("") , wxT("wxObject"),
wxClassInfo wxObject::ms_classInfo(ms_classParents , wxEmptyString , wxT("wxObject"),
(int) sizeof(wxObject), \
(wxObjectConstructorFn) 0 ,
(wxPropertyInfo*) NULL,(wxHandlerInfo*) NULL,0 , 0 ,

View File

@@ -59,7 +59,7 @@ wxPrintPaperType::wxPrintPaperType()
{
m_paperId = wxPAPER_NONE;
m_platformId = 0;
m_paperName = wxT("");
m_paperName = wxEmptyString;
m_width = 0;
m_height = 0;
}

View File

@@ -141,7 +141,7 @@ wxIPV4address::~wxIPV4address()
bool wxIPV4address::Hostname(const wxString& name)
{
// Some people are sometimes fool.
if (name == wxT(""))
if (name.empty())
{
wxLogWarning( _("Trying to solve a NULL hostname: giving up") );
return false;
@@ -245,7 +245,7 @@ wxIPV6address::~wxIPV6address()
bool wxIPV6address::Hostname(const wxString& name)
{
if (name == wxT(""))
if (name.empty())
{
wxLogWarning( _("Trying to solve a NULL hostname: giving up") );
return false;

View File

@@ -86,7 +86,7 @@ enum
// get the address object for the given server name, the caller must delete it
static wxSockAddress *
GetAddressFromName(const wxString& serverName, const wxString& host = _T(""))
GetAddressFromName(const wxString& serverName, const wxString& host = wxEmptyString)
{
// we always use INET sockets under non-Unix systems
#if defined(__UNIX__) && !defined(__WXMAC__) && !defined(__WINE__)

View File

@@ -563,7 +563,7 @@ bool wxToolBarBase::GetToolEnabled(int id) const
wxString wxToolBarBase::GetToolShortHelp(int id) const
{
wxToolBarToolBase *tool = FindById(id);
wxCHECK_MSG( tool, _T(""), _T("no such tool") );
wxCHECK_MSG( tool, wxEmptyString, _T("no such tool") );
return tool->GetShortHelp();
}
@@ -571,7 +571,7 @@ wxString wxToolBarBase::GetToolShortHelp(int id) const
wxString wxToolBarBase::GetToolLongHelp(int id) const
{
wxToolBarToolBase *tool = FindById(id);
wxCHECK_MSG( tool, _T(""), _T("no such tool") );
wxCHECK_MSG( tool, wxEmptyString, _T("no such tool") );
return tool->GetLongHelp();
}

View File

@@ -63,7 +63,7 @@ const wxChar *wxTextBuffer::GetEOL(wxTextFileType type)
wxFAIL_MSG(wxT("bad buffer type in wxTextBuffer::GetEOL."));
// fall through nevertheless - we must return something...
case wxTextFileType_None: return wxT("");
case wxTextFileType_None: return wxEmptyString;
case wxTextFileType_Unix: return wxT("\n");
case wxTextFileType_Dos: return wxT("\r\n");
case wxTextFileType_Mac: return wxT("\r");

View File

@@ -79,7 +79,7 @@ wxURI::~wxURI()
void wxURI::Clear()
{
m_scheme = m_user = m_server = m_port = m_path =
m_query = m_fragment = wxT("");
m_query = m_fragment = wxEmptyString;
m_hostType = wxURI_REGNAME;
@@ -401,7 +401,7 @@ const wxChar* wxURI::ParseScheme(const wxChar* uri)
}
else
//relative uri with relative path reference
m_scheme = wxT("");
m_scheme = wxEmptyString;
}
// else
//relative uri with _possible_ relative path reference
@@ -450,7 +450,7 @@ const wxChar* wxURI::ParseUser(const wxChar* uri)
uricopy = ++uri;
}
else
m_user = wxT("");
m_user = wxEmptyString;
return uricopy;
}

View File

@@ -119,7 +119,7 @@
wxChar *
copystring (const wxChar *s)
{
if (s == NULL) s = wxT("");
if (s == NULL) s = wxEmptyString;
size_t len = wxStrlen (s) + 1;
wxChar *news = new wxChar[len];
@@ -281,7 +281,7 @@ const wxChar *wxGetInstallPrefix()
#ifdef wxINSTALL_PREFIX
return wxT(wxINSTALL_PREFIX);
#else
return wxT("");
return wxEmptyString;
#endif
}

View File

@@ -164,7 +164,7 @@ bool wxVariantDataList::Write(wxSTD ostream& str) const
bool wxVariantDataList::Write(wxString& str) const
{
str = wxT("");
str = wxEmptyString;
wxList::compatibility_iterator node = m_value.GetFirst();
while (node)
{
@@ -1769,7 +1769,7 @@ wxString wxVariant::MakeString() const
if (GetData()->Write(str))
return str;
}
return wxString(wxT(""));
return wxEmptyString;
}
// Accessors

View File

@@ -1376,7 +1376,7 @@ wxWindowBase::FindWindowByName(const wxString& title, const wxWindow *parent)
wxWindow *
wxWindowBase::FindWindowById( long id, const wxWindow* parent )
{
return wxFindWindowHelper(parent, _T(""), id, wxFindWindowCmpIds);
return wxFindWindowHelper(parent, wxEmptyString, id, wxFindWindowCmpIds);
}
// ----------------------------------------------------------------------------
@@ -2232,7 +2232,7 @@ void wxWindowBase::OnMiddleClick( wxMouseEvent& event )
#ifdef __WXDEBUG__
_T(" Debug build"),
#else
_T(""),
wxEmptyString,
#endif
__TDATE__,
__TTIME__

View File

@@ -501,7 +501,7 @@ int WXDLLEXPORT wxVsnprintf_(wxChar *buf, size_t lenMax,
}
else
{
val = wxT("");
val = wxEmptyString;
len = 0;
}

View File

@@ -88,7 +88,7 @@ const wxChar *wxEnumData::GetEnumMemberName(int value) const
if (value == m_members[i].m_value)
return m_members[i].m_name;
return wxT("") ;
return wxEmptyString ;
}
int wxEnumData::GetEnumMemberValueByIndex( int idx ) const
@@ -318,13 +318,13 @@ void wxTypeInfo::Register()
if ( ms_typeTable == NULL )
ms_typeTable = new wxTypeInfoMap() ;
if( !m_name.IsEmpty() )
if( !m_name.empty() )
(*ms_typeTable)[m_name] = this ;
}
void wxTypeInfo::Unregister()
{
if( !m_name.IsEmpty() )
if( !m_name.empty() )
ms_typeTable->erase(m_name);
}