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:
@@ -486,7 +486,7 @@ void MainWindow::Search(bool ask)
|
||||
if (ask || m_searchString.empty())
|
||||
{
|
||||
wxString s = wxGetTextFromUser( _T("Enter search string"), _T("Search"), m_searchString);
|
||||
if (s != wxEmptyString)
|
||||
if (!s.empty())
|
||||
{
|
||||
s.MakeLower();
|
||||
m_searchString = s;
|
||||
|
@@ -673,7 +673,7 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin
|
||||
const wxChar *val;
|
||||
#ifndef __WXWINCE__
|
||||
wxChar *tcp;
|
||||
if (envname != WXSTRINGCAST NULL && (val = wxGetenv (WXSTRINGCAST envname)) != NULL &&
|
||||
if (!envname.empty() && (val = wxGetenv (WXSTRINGCAST envname)) != NULL &&
|
||||
(tcp = wxStrstr (dest, val)) != NULL)
|
||||
{
|
||||
wxStrcpy (wxFileFunctionsBuffer, tcp + wxStrlen (val));
|
||||
@@ -1734,7 +1734,7 @@ int WXDLLEXPORT wxParseCommonDialogsFilter(const wxString& filterStr, wxArrayStr
|
||||
// autocompletion
|
||||
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());
|
||||
}
|
||||
|
@@ -1056,7 +1056,7 @@ bool wxFileName::GetShortcutTarget(const wxString& shortcutPath, wxString& targe
|
||||
bool success = false;
|
||||
|
||||
// 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;
|
||||
|
||||
// create a ShellLink object
|
||||
@@ -1453,7 +1453,7 @@ wxString wxFileName::GetPath( int flags, wxPathFormat format ) const
|
||||
}
|
||||
|
||||
// convert back from ".." to nothing
|
||||
if ( m_dirs[i] != wxT("..") )
|
||||
if ( !m_dirs[i].IsSameAs(wxT("..")) )
|
||||
fullpath += m_dirs[i];
|
||||
break;
|
||||
|
||||
@@ -1470,7 +1470,7 @@ wxString wxFileName::GetPath( int flags, wxPathFormat format ) const
|
||||
// TODO: What to do with ".." under VMS
|
||||
|
||||
// convert back from ".." to nothing
|
||||
if ( m_dirs[i] != wxT("..") )
|
||||
if ( !m_dirs[i].IsSameAs(wxT("..")) )
|
||||
fullpath += m_dirs[i];
|
||||
break;
|
||||
}
|
||||
|
@@ -67,11 +67,11 @@ protected:
|
||||
static wxString StripProtocolAnchor(const wxString& location)
|
||||
{
|
||||
wxString myloc(location.BeforeLast(wxT('#')));
|
||||
if (myloc.IsEmpty()) myloc = location.AfterFirst(wxT(':'));
|
||||
if (myloc.empty()) myloc = location.AfterFirst(wxT(':'));
|
||||
else myloc = myloc.AfterFirst(wxT(':'));
|
||||
|
||||
// fix malformed url:
|
||||
if (myloc.Left(2) != wxT("//"))
|
||||
if (!myloc.Left(2).IsSameAs(wxT("//")))
|
||||
{
|
||||
if (myloc.GetChar(0) != wxT('/')) myloc = wxT("//") + myloc;
|
||||
else myloc = wxT("/") + myloc;
|
||||
|
@@ -83,7 +83,7 @@ wxFSFile* wxZipFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& l
|
||||
wxString left = GetLeftLocation(location);
|
||||
wxInputStream *s;
|
||||
|
||||
if (GetProtocol(left) != wxT("file"))
|
||||
if (!GetProtocol(left).IsSameAs(wxT("file")))
|
||||
{
|
||||
wxLogError(_("ZIP handler currently supports only local files!"));
|
||||
return NULL;
|
||||
@@ -133,7 +133,7 @@ wxString wxZipFSHandler::FindFirst(const wxString& spec, int flags)
|
||||
m_Archive = NULL;
|
||||
}
|
||||
|
||||
if (GetProtocol(left) != wxT("file"))
|
||||
if (!GetProtocol(left).IsSameAs(wxT("file")))
|
||||
{
|
||||
wxLogError(_("ZIP handler currently supports only local files!"));
|
||||
return wxEmptyString;
|
||||
@@ -203,14 +203,14 @@ wxString wxZipFSHandler::DoFind()
|
||||
if (m_AllowDirs)
|
||||
{
|
||||
dir = namestr.BeforeLast(wxT('/'));
|
||||
while (!dir.IsEmpty())
|
||||
while (!dir.empty())
|
||||
{
|
||||
if( m_DirsFound->find(dir) == m_DirsFound->end() )
|
||||
{
|
||||
(*m_DirsFound)[dir] = 1;
|
||||
filename = dir.AfterLast(wxT('/'));
|
||||
dir = dir.BeforeLast(wxT('/'));
|
||||
if (!filename.IsEmpty() && m_BaseDir == dir &&
|
||||
if (!filename.empty() && m_BaseDir == dir &&
|
||||
wxMatchWild(m_Pattern, filename, false))
|
||||
match = m_ZipFile + wxT("#zip:") + dir + wxT("/") + filename;
|
||||
}
|
||||
@@ -221,7 +221,7 @@ wxString wxZipFSHandler::DoFind()
|
||||
|
||||
filename = namestr.AfterLast(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))
|
||||
match = m_ZipFile + wxT("#zip:") + namestr;
|
||||
}
|
||||
|
@@ -1994,7 +1994,7 @@ void wxVariant::ClearList()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetType() != wxT("list"))
|
||||
if (!GetType().IsSameAs(wxT("list")))
|
||||
{
|
||||
delete m_data;
|
||||
m_data = NULL;
|
||||
|
@@ -275,7 +275,7 @@ static bool wxGetDefaultDeviceName(wxString& deviceName, wxString& portName)
|
||||
GlobalFree(pd.hDevMode);
|
||||
pd.hDevMode=NULL;
|
||||
}
|
||||
return ( deviceName != wxEmptyString );
|
||||
return ( !deviceName.empty() );
|
||||
}
|
||||
|
||||
// Gets an HDC for the specified printer configuration
|
||||
|
@@ -297,7 +297,7 @@ bool wxTabCtrl::InsertItem(int item, const wxString& text, int imageId, void* da
|
||||
TC_ITEM tcItem;
|
||||
tcItem.mask = TCIF_PARAM;
|
||||
tcItem.lParam = (long) data;
|
||||
if (text != wxEmptyString)
|
||||
if (!text.empty())
|
||||
{
|
||||
tcItem.mask |= TCIF_TEXT;
|
||||
wxStrcpy(buf, (const wxChar*) text);
|
||||
|
@@ -1088,7 +1088,7 @@ wxToolBarToolBase *GetItemSkippingDummySpacers(const wxToolBarToolsList& tools,
|
||||
{
|
||||
wxToolBarToolsList::compatibility_iterator current = tools.GetFirst();
|
||||
|
||||
for ( ; current != 0; current = current->GetNext() )
|
||||
for ( ; current ; current = current->GetNext() )
|
||||
{
|
||||
if ( index == 0 )
|
||||
return current->GetData();
|
||||
|
@@ -320,7 +320,7 @@ private:
|
||||
TempDir::TempDir()
|
||||
{
|
||||
wxString tmp = wxFileName::CreateTempFileName(_T("arctest-"));
|
||||
if (tmp != wxEmptyString) {
|
||||
if (!tmp.empty()) {
|
||||
wxRemoveFile(tmp);
|
||||
m_original = wxGetCwd();
|
||||
CPPUNIT_ASSERT(wxMkdir(tmp, 0700));
|
||||
@@ -331,7 +331,7 @@ TempDir::TempDir()
|
||||
|
||||
TempDir::~TempDir()
|
||||
{
|
||||
if (m_tmp != wxEmptyString) {
|
||||
if (!m_tmp.empty()) {
|
||||
wxSetWorkingDirectory(m_original);
|
||||
RemoveDir(m_tmp);
|
||||
}
|
||||
|
@@ -813,7 +813,7 @@ bool read_a_line(wxChar *buf)
|
||||
if (checkSyntax)
|
||||
{
|
||||
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]);
|
||||
if (pos != wxString::npos && pos != 0)
|
||||
|
@@ -398,7 +398,7 @@ bool MyApp::OnInit()
|
||||
*/
|
||||
|
||||
wxString path = TexPathList.FindValidPath(MacroFile);
|
||||
if (path != _T(""))
|
||||
if (!path.empty())
|
||||
ReadCustomMacros((wxChar *)path.c_str());
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
@@ -434,7 +434,7 @@ bool MyApp::OnInit()
|
||||
*/
|
||||
|
||||
wxString path = TexPathList.FindValidPath(MacroFile);
|
||||
if (path != _T(""))
|
||||
if (!path.empty())
|
||||
ReadCustomMacros((wxChar*)path.c_str());
|
||||
|
||||
Go();
|
||||
@@ -743,7 +743,7 @@ void MyFrame::OnLoadMacros(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
textWindow->Clear();
|
||||
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);
|
||||
ReadCustomMacros((wxChar *)s.c_str());
|
||||
@@ -862,7 +862,7 @@ void ChooseInputFile(bool force)
|
||||
if (force || !InputFile)
|
||||
{
|
||||
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.
|
||||
ClearKeyWordTable();
|
||||
@@ -916,7 +916,7 @@ void ChooseOutputFile(bool force)
|
||||
{
|
||||
wxString s = wxFileSelector(_T("Choose output file"), path, wxFileNameFromPath(OutputFile),
|
||||
extensionBuf, wildBuf);
|
||||
if (s != _T(""))
|
||||
if (!s.empty())
|
||||
OutputFile = copystring(s);
|
||||
}
|
||||
}
|
||||
@@ -971,7 +971,7 @@ bool Go(void)
|
||||
if (!bulletFile)
|
||||
{
|
||||
wxString s = TexPathList.FindValidPath(_T("bullet.bmp"));
|
||||
if (s != _T(""))
|
||||
if (!s.empty())
|
||||
{
|
||||
wxString str = wxFileNameFromPath(s);
|
||||
bulletFile = copystring(str);
|
||||
|
Reference in New Issue
Block a user