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;
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));
// 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());
}
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
}
// convert back from ".." to nothing
- if ( m_dirs[i] != wxT("..") )
+ if ( !m_dirs[i].IsSameAs(wxT("..")) )
fullpath += m_dirs[i];
break;
// 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;
}
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;
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;
m_Archive = NULL;
}
- if (GetProtocol(left) != wxT("file"))
+ if (!GetProtocol(left).IsSameAs(wxT("file")))
{
wxLogError(_("ZIP handler currently supports only local files!"));
return wxEmptyString;
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;
}
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;
}
return false;
}
-#endif //2.4 compat
+#endif //2.4 compat
/*
* wxVariantDataLong
}
else
{
- if (GetType() != wxT("list"))
+ if (!GetType().IsSameAs(wxT("list")))
{
delete m_data;
m_data = NULL;
GlobalFree(pd.hDevMode);
pd.hDevMode=NULL;
}
- return ( deviceName != wxEmptyString );
+ return ( !deviceName.empty() );
}
// Gets an HDC for the specified printer configuration
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);
dcAllButtons.SetBackground(*wxTRANSPARENT_BRUSH);
else
dcAllButtons.SetBackground(*wxLIGHT_GREY_BRUSH);
-#endif
+#endif
dcAllButtons.Clear();
m_hBitmap = bitmap.GetHBITMAP();
{
wxToolBarToolsList::compatibility_iterator current = tools.GetFirst();
- for ( ; current != 0; current = current->GetNext() )
+ for ( ; current ; current = current->GetNext() )
{
if ( index == 0 )
return current->GetData();
event.Skip();
return;
}
-
+
// notice that this 'dumb' implementation may cause flicker for some of the
// controls in which case they should intercept wxEraseEvent and process it
// themselves somehow
TempDir::TempDir()
{
wxString tmp = wxFileName::CreateTempFileName(_T("arctest-"));
- if (tmp != wxEmptyString) {
+ if (!tmp.empty()) {
wxRemoveFile(tmp);
m_original = wxGetCwd();
CPPUNIT_ASSERT(wxMkdir(tmp, 0700));
TempDir::~TempDir()
{
- if (m_tmp != wxEmptyString) {
+ if (!m_tmp.empty()) {
wxSetWorkingDirectory(m_original);
RemoveDir(m_tmp);
}
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)
*/
wxString path = TexPathList.FindValidPath(MacroFile);
- if (path != _T(""))
+ if (!path.empty())
ReadCustomMacros((wxChar *)path.c_str());
#if wxUSE_STATUSBAR
*/
wxString path = TexPathList.FindValidPath(MacroFile);
- if (path != _T(""))
+ if (!path.empty())
ReadCustomMacros((wxChar*)path.c_str());
Go();
{
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());
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();
{
wxString s = wxFileSelector(_T("Choose output file"), path, wxFileNameFromPath(OutputFile),
extensionBuf, wildBuf);
- if (s != _T(""))
+ if (!s.empty())
OutputFile = copystring(s);
}
}
if (!bulletFile)
{
wxString s = TexPathList.FindValidPath(_T("bullet.bmp"));
- if (s != _T(""))
+ if (!s.empty())
{
wxString str = wxFileNameFromPath(s);
bulletFile = copystring(str);