From 525d858363f08a3d774b494bd8df19e4ab7c9dc0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Wed, 2 Feb 2005 13:57:02 +0000 Subject: [PATCH] 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 --- src/common/datetime.cpp | 8 ++++---- src/common/hash.cpp | 4 ++-- src/common/intl.cpp | 10 +++++----- src/common/menucmn.cpp | 6 +++--- src/common/mimecmn.cpp | 4 ++-- src/common/object.cpp | 2 +- src/common/paper.cpp | 2 +- src/common/sckaddr.cpp | 4 ++-- src/common/sckipc.cpp | 2 +- src/common/tbarbase.cpp | 4 ++-- src/common/textbuf.cpp | 2 +- src/common/uri.cpp | 6 +++--- src/common/utilscmn.cpp | 4 ++-- src/common/variant.cpp | 4 ++-- src/common/wincmn.cpp | 4 ++-- src/common/wxchar.cpp | 28 ++++++++++++++-------------- src/common/xti.cpp | 6 +++--- 17 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index f2e5c356fa..b7ecda73a4 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -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)); diff --git a/src/common/hash.cpp b/src/common/hash.cpp index c9a0c31aa0..7f313cd56f 100644 --- a/src/common/hash.cpp +++ b/src/common/hash.cpp @@ -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 diff --git a/src/common/intl.cpp b/src/common/intl.cpp index d9dd83410c..ad9d29f161 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -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; } diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index 731b154254..4383f3cde2 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -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(); } diff --git a/src/common/mimecmn.cpp b/src/common/mimecmn.cpp index 089b071996..4d251a8dc5 100644 --- a/src/common/mimecmn.cpp +++ b/src/common/mimecmn.cpp @@ -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") ); diff --git a/src/common/object.cpp b/src/common/object.cpp index 7f03d2ae38..e6852e8e76 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -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 (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 , diff --git a/src/common/paper.cpp b/src/common/paper.cpp index dafaeb189a..5a2316cf4f 100644 --- a/src/common/paper.cpp +++ b/src/common/paper.cpp @@ -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; } diff --git a/src/common/sckaddr.cpp b/src/common/sckaddr.cpp index 2e78e0e2a0..37ad7cf8b1 100644 --- a/src/common/sckaddr.cpp +++ b/src/common/sckaddr.cpp @@ -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; diff --git a/src/common/sckipc.cpp b/src/common/sckipc.cpp index 79e5ce5d46..5dbcec46cd 100644 --- a/src/common/sckipc.cpp +++ b/src/common/sckipc.cpp @@ -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__) diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index e9b2c110ec..f944cdd209 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -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(); } diff --git a/src/common/textbuf.cpp b/src/common/textbuf.cpp index a09bbd5cce..0f662f16b3 100644 --- a/src/common/textbuf.cpp +++ b/src/common/textbuf.cpp @@ -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"); diff --git a/src/common/uri.cpp b/src/common/uri.cpp index e386cfb2d5..c7b04ebe25 100644 --- a/src/common/uri.cpp +++ b/src/common/uri.cpp @@ -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; } diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index d3ecc68a97..09369b63f3 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -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 } diff --git a/src/common/variant.cpp b/src/common/variant.cpp index aed2105dfc..830859ec54 100644 --- a/src/common/variant.cpp +++ b/src/common/variant.cpp @@ -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 diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 1627e1723e..1f67899546 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -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__ diff --git a/src/common/wxchar.cpp b/src/common/wxchar.cpp index 793b0b3204..5af0fe3c94 100644 --- a/src/common/wxchar.cpp +++ b/src/common/wxchar.cpp @@ -501,7 +501,7 @@ int WXDLLEXPORT wxVsnprintf_(wxChar *buf, size_t lenMax, } else { - val = wxT(""); + val = wxEmptyString; len = 0; } @@ -658,12 +658,12 @@ int vswscanf(const wxChar *ws, const wxChar *format, va_list argptr) // convert the strings into MB representation and run ANSI version // of the function. This doesn't work with %c and %s because of difference // in size of char and wchar_t, though. - + wxCHECK_MSG( wxStrstr(format, _T("%s")) == NULL, -1, _T("incomplete vswscanf implementation doesn't allow %s") ); wxCHECK_MSG( wxStrstr(format, _T("%c")) == NULL, -1, _T("incomplete vswscanf implementation doesn't allow %c") ); - + va_list argcopy; wxVaCopy(argcopy, argptr); return vsscanf(wxConvLibc.cWX2MB(ws), wxConvLibc.cWX2MB(format), argcopy); @@ -1070,7 +1070,7 @@ WXDLLEXPORT int wxTolower(wxChar ch) { return (wxChar)CharLower((LPTSTR)(ch)); } WXDLLEXPORT int wxToupper(wxChar ch) { return (wxChar)CharUpper((LPTSTR)(ch)); } #endif -#if defined(__DARWIN__) && ( MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_2 ) +#if defined(__DARWIN__) && ( MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_2 ) WXDLLEXPORT size_t wxInternalMbstowcs (wchar_t * out, const char * in, size_t outlen) { @@ -1081,16 +1081,16 @@ WXDLLEXPORT size_t wxInternalMbstowcs (wchar_t * out, const char * in, size_t ou outsize++; return outsize; } - + const char* origin = in; - + while (outlen-- && *in) { *out++ = (wchar_t) *in++; } - + *out = '\0'; - + return in - origin; } @@ -1103,19 +1103,19 @@ WXDLLEXPORT size_t wxInternalWcstombs (char * out, const wchar_t * in, size_t ou outsize++; return outsize; } - + const wchar_t* origin = in; - + while (outlen-- && *in) { *out++ = (char) *in++; } - + *out = '\0'; - + return in - origin; } - + #if defined(wxNEED_WX_CTYPE_H) #include @@ -1267,7 +1267,7 @@ WXDLLEXPORT size_t wxStrlen_(const wxChar *s) size_t n = 0; while ( *s++ ) n++; - + return n; } diff --git a/src/common/xti.cpp b/src/common/xti.cpp index c367e7cf2c..4020bb2c8e 100644 --- a/src/common/xti.cpp +++ b/src/common/xti.cpp @@ -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); } -- 2.47.2