Fix for ambiguities which happen in STL=1 mode under DigitalMars C++.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33035 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-03-24 20:01:55 +00:00
parent 7c11806499
commit 489f6cf713
12 changed files with 29 additions and 29 deletions

View File

@@ -486,7 +486,7 @@ void MainWindow::Search(bool ask)
if (ask || m_searchString.empty()) if (ask || m_searchString.empty())
{ {
wxString s = wxGetTextFromUser( _T("Enter search string"), _T("Search"), m_searchString); wxString s = wxGetTextFromUser( _T("Enter search string"), _T("Search"), m_searchString);
if (s != wxEmptyString) if (!s.empty())
{ {
s.MakeLower(); s.MakeLower();
m_searchString = s; m_searchString = s;

View File

@@ -673,7 +673,7 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin
const wxChar *val; const wxChar *val;
#ifndef __WXWINCE__ #ifndef __WXWINCE__
wxChar *tcp; wxChar *tcp;
if (envname != WXSTRINGCAST NULL && (val = wxGetenv (WXSTRINGCAST envname)) != NULL && if (!envname.empty() && (val = wxGetenv (WXSTRINGCAST envname)) != NULL &&
(tcp = wxStrstr (dest, val)) != NULL) (tcp = wxStrstr (dest, val)) != NULL)
{ {
wxStrcpy (wxFileFunctionsBuffer, tcp + wxStrlen (val)); wxStrcpy (wxFileFunctionsBuffer, tcp + wxStrlen (val));
@@ -1734,7 +1734,7 @@ int WXDLLEXPORT wxParseCommonDialogsFilter(const wxString& filterStr, wxArrayStr
// autocompletion // autocompletion
for( size_t j = 0 ; j < descriptions.GetCount() ; j++ ) for( size_t j = 0 ; j < descriptions.GetCount() ; j++ )
{ {
if ( descriptions[j] == wxEmptyString && filters[j] != wxEmptyString ) if ( descriptions[j].empty() && !filters[j].empty() )
{ {
descriptions[j].Printf(_("Files (%s)"), filters[j].c_str()); descriptions[j].Printf(_("Files (%s)"), filters[j].c_str());
} }

View File

@@ -1056,7 +1056,7 @@ bool wxFileName::GetShortcutTarget(const wxString& shortcutPath, wxString& targe
bool success = false; bool success = false;
// Assume it's not a shortcut if it doesn't end with lnk // Assume it's not a shortcut if it doesn't end with lnk
if (ext.Lower() != wxT("lnk")) if (ext.CmpNoCase(wxT("lnk"))!=0)
return false; return false;
// create a ShellLink object // create a ShellLink object
@@ -1453,7 +1453,7 @@ wxString wxFileName::GetPath( int flags, wxPathFormat format ) const
} }
// convert back from ".." to nothing // convert back from ".." to nothing
if ( m_dirs[i] != wxT("..") ) if ( !m_dirs[i].IsSameAs(wxT("..")) )
fullpath += m_dirs[i]; fullpath += m_dirs[i];
break; break;
@@ -1470,7 +1470,7 @@ wxString wxFileName::GetPath( int flags, wxPathFormat format ) const
// TODO: What to do with ".." under VMS // TODO: What to do with ".." under VMS
// convert back from ".." to nothing // convert back from ".." to nothing
if ( m_dirs[i] != wxT("..") ) if ( !m_dirs[i].IsSameAs(wxT("..")) )
fullpath += m_dirs[i]; fullpath += m_dirs[i];
break; break;
} }

View File

@@ -67,11 +67,11 @@ protected:
static wxString StripProtocolAnchor(const wxString& location) static wxString StripProtocolAnchor(const wxString& location)
{ {
wxString myloc(location.BeforeLast(wxT('#'))); wxString myloc(location.BeforeLast(wxT('#')));
if (myloc.IsEmpty()) myloc = location.AfterFirst(wxT(':')); if (myloc.empty()) myloc = location.AfterFirst(wxT(':'));
else myloc = myloc.AfterFirst(wxT(':')); else myloc = myloc.AfterFirst(wxT(':'));
// fix malformed url: // fix malformed url:
if (myloc.Left(2) != wxT("//")) if (!myloc.Left(2).IsSameAs(wxT("//")))
{ {
if (myloc.GetChar(0) != wxT('/')) myloc = wxT("//") + myloc; if (myloc.GetChar(0) != wxT('/')) myloc = wxT("//") + myloc;
else myloc = wxT("/") + myloc; else myloc = wxT("/") + myloc;

View File

@@ -83,7 +83,7 @@ wxFSFile* wxZipFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& l
wxString left = GetLeftLocation(location); wxString left = GetLeftLocation(location);
wxInputStream *s; wxInputStream *s;
if (GetProtocol(left) != wxT("file")) if (!GetProtocol(left).IsSameAs(wxT("file")))
{ {
wxLogError(_("ZIP handler currently supports only local files!")); wxLogError(_("ZIP handler currently supports only local files!"));
return NULL; return NULL;
@@ -133,7 +133,7 @@ wxString wxZipFSHandler::FindFirst(const wxString& spec, int flags)
m_Archive = NULL; m_Archive = NULL;
} }
if (GetProtocol(left) != wxT("file")) if (!GetProtocol(left).IsSameAs(wxT("file")))
{ {
wxLogError(_("ZIP handler currently supports only local files!")); wxLogError(_("ZIP handler currently supports only local files!"));
return wxEmptyString; return wxEmptyString;
@@ -203,14 +203,14 @@ wxString wxZipFSHandler::DoFind()
if (m_AllowDirs) if (m_AllowDirs)
{ {
dir = namestr.BeforeLast(wxT('/')); dir = namestr.BeforeLast(wxT('/'));
while (!dir.IsEmpty()) while (!dir.empty())
{ {
if( m_DirsFound->find(dir) == m_DirsFound->end() ) if( m_DirsFound->find(dir) == m_DirsFound->end() )
{ {
(*m_DirsFound)[dir] = 1; (*m_DirsFound)[dir] = 1;
filename = dir.AfterLast(wxT('/')); filename = dir.AfterLast(wxT('/'));
dir = dir.BeforeLast(wxT('/')); dir = dir.BeforeLast(wxT('/'));
if (!filename.IsEmpty() && m_BaseDir == dir && if (!filename.empty() && m_BaseDir == dir &&
wxMatchWild(m_Pattern, filename, false)) wxMatchWild(m_Pattern, filename, false))
match = m_ZipFile + wxT("#zip:") + dir + wxT("/") + filename; match = m_ZipFile + wxT("#zip:") + dir + wxT("/") + filename;
} }
@@ -221,7 +221,7 @@ wxString wxZipFSHandler::DoFind()
filename = namestr.AfterLast(wxT('/')); filename = namestr.AfterLast(wxT('/'));
dir = namestr.BeforeLast(wxT('/')); dir = namestr.BeforeLast(wxT('/'));
if (m_AllowFiles && !filename.IsEmpty() && m_BaseDir == dir && if (m_AllowFiles && !filename.empty() && m_BaseDir == dir &&
wxMatchWild(m_Pattern, filename, false)) wxMatchWild(m_Pattern, filename, false))
match = m_ZipFile + wxT("#zip:") + namestr; match = m_ZipFile + wxT("#zip:") + namestr;
} }

View File

@@ -304,7 +304,7 @@ bool wxVariantDataStringList::Read(wxString& WXUNUSED(str))
return false; return false;
} }
#endif //2.4 compat #endif //2.4 compat
/* /*
* wxVariantDataLong * wxVariantDataLong
@@ -1994,7 +1994,7 @@ void wxVariant::ClearList()
} }
else else
{ {
if (GetType() != wxT("list")) if (!GetType().IsSameAs(wxT("list")))
{ {
delete m_data; delete m_data;
m_data = NULL; m_data = NULL;

View File

@@ -275,7 +275,7 @@ static bool wxGetDefaultDeviceName(wxString& deviceName, wxString& portName)
GlobalFree(pd.hDevMode); GlobalFree(pd.hDevMode);
pd.hDevMode=NULL; pd.hDevMode=NULL;
} }
return ( deviceName != wxEmptyString ); return ( !deviceName.empty() );
} }
// Gets an HDC for the specified printer configuration // Gets an HDC for the specified printer configuration

View File

@@ -297,7 +297,7 @@ bool wxTabCtrl::InsertItem(int item, const wxString& text, int imageId, void* da
TC_ITEM tcItem; TC_ITEM tcItem;
tcItem.mask = TCIF_PARAM; tcItem.mask = TCIF_PARAM;
tcItem.lParam = (long) data; tcItem.lParam = (long) data;
if (text != wxEmptyString) if (!text.empty())
{ {
tcItem.mask |= TCIF_TEXT; tcItem.mask |= TCIF_TEXT;
wxStrcpy(buf, (const wxChar*) text); wxStrcpy(buf, (const wxChar*) text);

View File

@@ -583,7 +583,7 @@ bool wxToolBar::Realize()
dcAllButtons.SetBackground(*wxTRANSPARENT_BRUSH); dcAllButtons.SetBackground(*wxTRANSPARENT_BRUSH);
else else
dcAllButtons.SetBackground(*wxLIGHT_GREY_BRUSH); dcAllButtons.SetBackground(*wxLIGHT_GREY_BRUSH);
#endif #endif
dcAllButtons.Clear(); dcAllButtons.Clear();
m_hBitmap = bitmap.GetHBITMAP(); m_hBitmap = bitmap.GetHBITMAP();
@@ -1088,7 +1088,7 @@ wxToolBarToolBase *GetItemSkippingDummySpacers(const wxToolBarToolsList& tools,
{ {
wxToolBarToolsList::compatibility_iterator current = tools.GetFirst(); wxToolBarToolsList::compatibility_iterator current = tools.GetFirst();
for ( ; current != 0; current = current->GetNext() ) for ( ; current ; current = current->GetNext() )
{ {
if ( index == 0 ) if ( index == 0 )
return current->GetData(); return current->GetData();
@@ -1251,7 +1251,7 @@ void wxToolBar::OnEraseBackground(wxEraseEvent& event)
event.Skip(); event.Skip();
return; return;
} }
// notice that this 'dumb' implementation may cause flicker for some of the // notice that this 'dumb' implementation may cause flicker for some of the
// controls in which case they should intercept wxEraseEvent and process it // controls in which case they should intercept wxEraseEvent and process it
// themselves somehow // themselves somehow

View File

@@ -320,7 +320,7 @@ private:
TempDir::TempDir() TempDir::TempDir()
{ {
wxString tmp = wxFileName::CreateTempFileName(_T("arctest-")); wxString tmp = wxFileName::CreateTempFileName(_T("arctest-"));
if (tmp != wxEmptyString) { if (!tmp.empty()) {
wxRemoveFile(tmp); wxRemoveFile(tmp);
m_original = wxGetCwd(); m_original = wxGetCwd();
CPPUNIT_ASSERT(wxMkdir(tmp, 0700)); CPPUNIT_ASSERT(wxMkdir(tmp, 0700));
@@ -331,7 +331,7 @@ TempDir::TempDir()
TempDir::~TempDir() TempDir::~TempDir()
{ {
if (m_tmp != wxEmptyString) { if (!m_tmp.empty()) {
wxSetWorkingDirectory(m_original); wxSetWorkingDirectory(m_original);
RemoveDir(m_tmp); RemoveDir(m_tmp);
} }

View File

@@ -813,7 +813,7 @@ bool read_a_line(wxChar *buf)
if (checkSyntax) if (checkSyntax)
{ {
wxString bufStr = buf; wxString bufStr = buf;
for (int index=0; syntaxTokens[index] != wxEmptyString; index++) for (int index=0; !syntaxTokens[index].empty(); index++)
{ {
size_t pos = bufStr.find(syntaxTokens[index]); size_t pos = bufStr.find(syntaxTokens[index]);
if (pos != wxString::npos && pos != 0) if (pos != wxString::npos && pos != 0)

View File

@@ -398,7 +398,7 @@ bool MyApp::OnInit()
*/ */
wxString path = TexPathList.FindValidPath(MacroFile); wxString path = TexPathList.FindValidPath(MacroFile);
if (path != _T("")) if (!path.empty())
ReadCustomMacros((wxChar *)path.c_str()); ReadCustomMacros((wxChar *)path.c_str());
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
@@ -434,7 +434,7 @@ bool MyApp::OnInit()
*/ */
wxString path = TexPathList.FindValidPath(MacroFile); wxString path = TexPathList.FindValidPath(MacroFile);
if (path != _T("")) if (!path.empty())
ReadCustomMacros((wxChar*)path.c_str()); ReadCustomMacros((wxChar*)path.c_str());
Go(); Go();
@@ -743,7 +743,7 @@ void MyFrame::OnLoadMacros(wxCommandEvent& WXUNUSED(event))
{ {
textWindow->Clear(); textWindow->Clear();
wxString s = wxFileSelector(_T("Choose custom macro file"), wxPathOnly(MacroFile), wxFileNameFromPath(MacroFile), _T("ini"), _T("*.ini")); wxString s = wxFileSelector(_T("Choose custom macro file"), wxPathOnly(MacroFile), wxFileNameFromPath(MacroFile), _T("ini"), _T("*.ini"));
if (s != _T("") && wxFileExists(s)) if (!s.empty() && wxFileExists(s))
{ {
MacroFile = copystring(s); MacroFile = copystring(s);
ReadCustomMacros((wxChar *)s.c_str()); ReadCustomMacros((wxChar *)s.c_str());
@@ -862,7 +862,7 @@ void ChooseInputFile(bool force)
if (force || !InputFile) if (force || !InputFile)
{ {
wxString s = wxFileSelector(_T("Choose LaTeX input file"), wxPathOnly(InputFile), wxFileNameFromPath(InputFile), _T("tex"), _T("*.tex")); wxString s = wxFileSelector(_T("Choose LaTeX input file"), wxPathOnly(InputFile), wxFileNameFromPath(InputFile), _T("tex"), _T("*.tex"));
if (s != _T("")) if (!s.empty())
{ {
// Different file, so clear index entries. // Different file, so clear index entries.
ClearKeyWordTable(); ClearKeyWordTable();
@@ -916,7 +916,7 @@ void ChooseOutputFile(bool force)
{ {
wxString s = wxFileSelector(_T("Choose output file"), path, wxFileNameFromPath(OutputFile), wxString s = wxFileSelector(_T("Choose output file"), path, wxFileNameFromPath(OutputFile),
extensionBuf, wildBuf); extensionBuf, wildBuf);
if (s != _T("")) if (!s.empty())
OutputFile = copystring(s); OutputFile = copystring(s);
} }
} }
@@ -971,7 +971,7 @@ bool Go(void)
if (!bulletFile) if (!bulletFile)
{ {
wxString s = TexPathList.FindValidPath(_T("bullet.bmp")); wxString s = TexPathList.FindValidPath(_T("bullet.bmp"));
if (s != _T("")) if (!s.empty())
{ {
wxString str = wxFileNameFromPath(s); wxString str = wxFileNameFromPath(s);
bulletFile = copystring(str); bulletFile = copystring(str);