#if wxUSE_LOG
{
wxCMD_LINE_SWITCH,
- _T(""),
+ wxEmptyString,
OPTION_VERBOSE,
gettext_noop("generate verbose log messages"),
wxCMD_LINE_VAL_NONE,
// terminator
{
wxCMD_LINE_NONE,
- _T(""),
- _T(""),
- _T(""),
+ wxEmptyString,
+ wxEmptyString,
+ wxEmptyString,
wxCMD_LINE_VAL_NONE,
0x0
}
#ifdef __WXUNIVERSAL__
{
wxCMD_LINE_OPTION,
- _T(""),
+ wxEmptyString,
OPTION_THEME,
gettext_noop("specify the theme to use"),
wxCMD_LINE_VAL_STRING,
// and not mgl/app.cpp
{
wxCMD_LINE_OPTION,
- _T(""),
+ wxEmptyString,
OPTION_MODE,
gettext_noop("specify display mode to use (e.g. 640x480-16)"),
wxCMD_LINE_VAL_STRING,
// terminator
{
wxCMD_LINE_NONE,
- _T(""),
- _T(""),
- _T(""),
+ wxEmptyString,
+ wxEmptyString,
+ wxEmptyString,
wxCMD_LINE_VAL_NONE,
0x0
}
{
wxCommand *command = (wxCommand *)m_currentCommand->GetData();
wxString commandName(command->GetName());
- if (commandName == wxT("")) commandName = _("Unnamed command");
+ if (commandName.empty()) commandName = _("Unnamed command");
bool canUndo = command->CanUndo();
if (canUndo)
buf = wxString(_("&Undo ")) + commandName + m_undoAccelerator;
{
wxCommand *redoCommand = (wxCommand *)m_currentCommand->GetNext()->GetData();
wxString redoCommandName(redoCommand->GetName());
- if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command");
+ if (redoCommandName.empty()) redoCommandName = _("Unnamed command");
buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator;
}
else
// we've undone to the start of the list, but can redo the first.
wxCommand *redoCommand = (wxCommand *)m_commands.GetFirst()->GetData();
wxString redoCommandName(redoCommand->GetName());
- if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command");
+ if (redoCommandName.empty()) redoCommandName = _("Unnamed command");
buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator;
}
}
m_printCollate = false;
// New, 24/3/99
- m_printerName = wxT("");
+ m_printerName = wxEmptyString;
m_colour = true;
m_duplexMode = wxDUPLEX_SIMPLEX;
m_printQuality = wxPRINT_QUALITY_HIGH;
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterCommand();
#endif
- return wxT("");
+ return wxEmptyString;
}
wxString wxPrintData::GetPrinterOptions() const
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterOptions();
#endif
- return wxT("");
+ return wxEmptyString;
}
wxString wxPrintData::GetPreviewCommand() const
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPreviewCommand();
#endif
- return wxT("");
+ return wxEmptyString;
}
wxString wxPrintData::GetFontMetricPath() const
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
return ((wxPostScriptPrintNativeData*)m_nativeData)->GetFontMetricPath();
#endif
- return wxT("");
+ return wxEmptyString;
}
double wxPrintData::GetPrinterScaleX() const
void wxPageSetupDialogData::SetPrintData(const wxPrintData& printData)
{
m_printData = printData;
- CalculatePaperSizeFromId();
+ CalculatePaperSizeFromId();
}
// Use paper size defined in this object to set the wxPrintData
if ( flags & wxDIR_DIRS )
{
wxString dirname;
- for ( bool cont = GetFirst(&dirname, _T(""), wxDIR_DIRS | (flags & wxDIR_HIDDEN) );
+ for ( bool cont = GetFirst(&dirname, wxEmptyString, wxDIR_DIRS | (flags & wxDIR_HIDDEN) );
cont;
cont = cont && GetNext(&dirname) )
{
{
wxStaticText *s = new wxStaticText( this, wxID_ANY, line );
box->Add( s );
- line = wxT("");
+ line = wxEmptyString;
}
else
{
pos = last_space;
last_space = 0;
- line = wxT("");
+ line = wxEmptyString;
}
}
}
void wxDocMDIParentFrame::OnMRUFile(wxCommandEvent& event)
{
- wxString f(m_docManager->GetHistoryFile(event.GetId() - wxID_FILE1));
- if (f != wxT(""))
+ wxString f(m_docManager->GetHistoryFile(event.GetId() - wxID_FILE1));
+ if (!f.empty())
(void)m_docManager->CreateDocument(f, wxDOC_SILENT);
}
t->GetDocClassInfo() == docTemplate->GetDocClassInfo())
{
// add a '|' to separate this filter from the previous one
- if ( !filter.IsEmpty() )
+ if ( !filter.empty() )
filter << wxT('|');
filter << t->GetDescription() << wxT(" (") << t->GetFileFilter() << wxT(") |")
wxSAVE | wxOVERWRITE_PROMPT,
GetDocumentWindow());
- if (tmp.IsEmpty())
+ if (tmp.empty())
return false;
wxString fileName(tmp);
wxString path, name, ext;
wxSplitPath(fileName, & path, & name, & ext);
- if (ext.IsEmpty() || ext == wxT(""))
+ if (ext.empty())
{
fileName += wxT(".");
fileName += docTemplate->GetDefaultExtension();
// Get title, or filename if no title, else unnamed
bool wxDocument::GetPrintableName(wxString& buf) const
{
- if (m_documentTitle != wxT(""))
+ if (!m_documentTitle.empty())
{
buf = m_documentTitle;
return true;
}
- else if (m_documentFile != wxT(""))
+ else if (!m_documentFile.empty())
{
buf = wxFileNameFromPath(m_documentFile);
return true;
GetPrintableName(title);
wxString msgTitle;
- if (wxTheApp->GetAppName() != wxT(""))
+ if (!wxTheApp->GetAppName().empty())
msgTitle = wxTheApp->GetAppName();
else
msgTitle = wxString(_("Warning"));
bool wxDocument::DoSaveDocument(const wxString& file)
{
wxString msgTitle;
- if (wxTheApp->GetAppName() != wxT(""))
+ if (!wxTheApp->GetAppName().empty())
msgTitle = wxTheApp->GetAppName();
else
msgTitle = wxString(_("File error"));
bool wxDocument::DoOpenDocument(const wxString& file)
{
wxString msgTitle;
- if (wxTheApp->GetAppName() != wxT(""))
+ if (!wxTheApp->GetAppName().empty())
msgTitle = wxTheApp->GetAppName();
else
msgTitle = wxString(_("File error"));
void wxDocManager::OnFileNew(wxCommandEvent& WXUNUSED(event))
{
- CreateDocument( wxT(""), wxDOC_NEW );
+ CreateDocument( wxEmptyString, wxDOC_NEW );
}
void wxDocManager::OnFileOpen(wxCommandEvent& WXUNUSED(event))
{
- if ( !CreateDocument( wxT(""), 0) )
+ if ( !CreateDocument( wxEmptyString, 0) )
{
OnOpenFileFailure();
}
// Existing document
wxDocTemplate *temp;
- wxString path2(wxT(""));
- if (path != wxT(""))
- path2 = path;
+ wxString path2 = path;
if (flags & wxDOC_SILENT)
{
if (templates[i]->IsVisible())
{
// add a '|' to separate this filter from the previous one
- if ( !descrBuf.IsEmpty() )
+ if ( !descrBuf.empty() )
descrBuf << wxT('|');
descrBuf << templates[i]->GetDescription()
wxString pathTmp = wxFileSelectorEx(_("Select a file"),
m_lastDirectory,
- wxT(""),
+ wxEmptyString,
&FilterIndex,
descrBuf,
0,
parent);
wxDocTemplate *theTemplate = (wxDocTemplate *)NULL;
- if (!pathTmp.IsEmpty())
+ if (!pathTmp.empty())
{
if (!wxFileExists(pathTmp))
{
wxString msgTitle;
- if (!wxTheApp->GetAppName().IsEmpty())
+ if (!wxTheApp->GetAppName().empty())
msgTitle = wxTheApp->GetAppName();
else
msgTitle = wxString(_("File error"));
(void)wxMessageBox(_("Sorry, could not open this file."), msgTitle, wxOK | wxICON_EXCLAMATION,
parent);
- path = wxT("");
+ path = wxEmptyString;
return (wxDocTemplate *) NULL;
}
m_lastDirectory = wxPathOnly(pathTmp);
}
else
{
- path = wxT("");
+ path = wxEmptyString;
}
return theTemplate;
{
int n = event.GetId() - wxID_FILE1; // the index in MRU list
wxString filename(m_docManager->GetHistoryFile(n));
- if ( !filename.IsEmpty() )
+ if ( !filename.empty() )
{
// verify that the file exists before doing anything else
if ( wxFile::Exists(filename) )
wxString buf;
buf.Printf(wxT("file%d"), (int)m_fileHistoryN+1);
wxString historyFile;
- while ((m_fileHistoryN < m_fileMaxFiles) && config.Read(buf, &historyFile) && (historyFile != wxT("")))
+ while ((m_fileHistoryN < m_fileMaxFiles) && config.Read(buf, &historyFile) && (!historyFile.empty()))
{
m_fileHistory[m_fileHistoryN] = MYcopystring((const wxChar*) historyFile);
m_fileHistoryN ++;
buf.Printf(wxT("file%d"), (int)m_fileHistoryN+1);
- historyFile = wxT("");
+ historyFile = wxEmptyString;
}
AddFilesToMenu();
}
#if defined(__WXPM__) || defined(__EMX__)
const wxChar *wxDynamicLibrary::ms_dllext = _T(".dll");
#elif defined(__WXMAC__) && !defined(__DARWIN__)
- const wxChar *wxDynamicLibrary::ms_dllext = _T("");
+ const wxChar *wxDynamicLibrary::ms_dllext = wxEmptyString;
#endif
// for Unix it is in src/unix/dlunix.cpp
void wxFileConfig::Init()
{
m_pCurrentGroup =
- m_pRootGroup = new wxFileConfigGroup(NULL, wxT(""), this);
+ m_pRootGroup = new wxFileConfigGroup(NULL, wxEmptyString, this);
m_linesHead =
m_linesTail = NULL;
// It's not an error if (one of the) file(s) doesn't exist.
// parse the global file
- if ( !m_strGlobalFile.IsEmpty() && wxFile::Exists(m_strGlobalFile) )
+ if ( !m_strGlobalFile.empty() && wxFile::Exists(m_strGlobalFile) )
{
wxTextFile fileGlobal(m_strGlobalFile);
}
// parse the local file
- if ( !m_strLocalFile.IsEmpty() && wxFile::Exists(m_strLocalFile) )
+ if ( !m_strLocalFile.empty() && wxFile::Exists(m_strLocalFile) )
{
wxTextFile fileLocal(m_strLocalFile);
if ( fileLocal.Open(m_conv/*ignored in ANSI build*/) )
m_conv(conv)
{
// Make up names for files if empty
- if ( m_strLocalFile.IsEmpty() && (style & wxCONFIG_USE_LOCAL_FILE) )
+ if ( m_strLocalFile.empty() && (style & wxCONFIG_USE_LOCAL_FILE) )
m_strLocalFile = GetLocalFileName(GetAppName());
- if ( m_strGlobalFile.IsEmpty() && (style & wxCONFIG_USE_GLOBAL_FILE) )
+ if ( m_strGlobalFile.empty() && (style & wxCONFIG_USE_GLOBAL_FILE) )
m_strGlobalFile = GetGlobalFileName(GetAppName());
// Check if styles are not supplied, but filenames are, in which case
// add the correct styles.
- if ( !m_strLocalFile.IsEmpty() )
+ if ( !m_strLocalFile.empty() )
SetStyle(GetStyle() | wxCONFIG_USE_LOCAL_FILE);
- if ( !m_strGlobalFile.IsEmpty() )
+ if ( !m_strGlobalFile.empty() )
SetStyle(GetStyle() | wxCONFIG_USE_GLOBAL_FILE);
// if the path is not absolute, prepend the standard directory to it
// UNLESS wxCONFIG_USE_RELATIVE_PATH style is set
if ( !(style & wxCONFIG_USE_RELATIVE_PATH) )
{
- if ( !m_strLocalFile.IsEmpty() && !wxIsAbsolutePath(m_strLocalFile) )
+ if ( !m_strLocalFile.empty() && !wxIsAbsolutePath(m_strLocalFile) )
{
wxString strLocal = m_strLocalFile;
m_strLocalFile = GetLocalDir();
m_strLocalFile << strLocal;
}
- if ( !m_strGlobalFile.IsEmpty() && !wxIsAbsolutePath(m_strGlobalFile) )
+ if ( !m_strGlobalFile.empty() && !wxIsAbsolutePath(m_strGlobalFile) )
{
wxString strGlobal = m_strGlobalFile;
m_strGlobalFile = GetGlobalDir();
SetStyle(GetStyle() | wxCONFIG_USE_LOCAL_FILE);
m_pCurrentGroup =
- m_pRootGroup = new wxFileConfigGroup(NULL, wxT(""), this);
+ m_pRootGroup = new wxFileConfigGroup(NULL, wxEmptyString, this);
m_linesHead =
m_linesTail = NULL;
{
wxArrayString aParts;
- if ( strPath.IsEmpty() ) {
+ if ( strPath.empty() ) {
SetRootPath();
return;
}
szValue.c_str(),
GetPath().c_str() );
- if ( strName.IsEmpty() )
+ if ( strName.empty() )
{
// setting the value of a group is an error
- wxASSERT_MSG( wxIsEmpty(szValue), wxT("can't set value of a group!") );
+ wxASSERT_MSG( szValue.empty(), wxT("can't set value of a group!") );
// ... except if it's empty in which case it's a way to force it's creation
}
m_strLocalFile =
- m_strGlobalFile = wxT("");
+ m_strGlobalFile = wxEmptyString;
}
Init();
int nLine)
: m_strName(strName)
{
- wxASSERT( !strName.IsEmpty() );
+ wxASSERT( !strName.empty() );
m_pParent = pParent;
m_nLine = nLine;
wxString strResult;
strResult.Alloc(str.Len());
- bool bQuoted = !str.IsEmpty() && str[0] == '"';
+ bool bQuoted = !str.empty() && str[0] == '"';
for ( size_t n = bQuoted ? 1 : 0; n < str.Len(); n++ ) {
if ( str[n] == wxT('\\') ) {
bool
wxIsAbsolutePath (const wxString& filename)
{
- if (filename != wxT(""))
+ if (!filename.empty())
{
#if defined(__WXMAC__) && !defined(__DARWIN__)
// Classic or Carbon CodeWarrior like
// Must be destroyed
wxChar *wxCopyAbsolutePath(const wxString& filename)
{
- if (filename == wxT(""))
+ if (filename.empty())
return (wxChar *) NULL;
if (! wxIsAbsolutePath(wxExpandPath(wxFileFunctionsBuffer, filename))) {
if (nm[1] == SEP || nm[1] == 0)
{ /* ~/filename */
// FIXME: wxGetUserHome could return temporary storage in Unicode mode
- if ((s = WXSTRINGCAST wxGetUserHome(wxT(""))) != NULL) {
+ if ((s = WXSTRINGCAST wxGetUserHome(wxEmptyString)) != NULL) {
if (*++nm)
nm++;
}
{
static wxChar dest[_MAXPATHLEN];
- if (filename == wxT(""))
+ if (filename.empty())
return (wxChar *) NULL;
wxStrcpy (dest, WXSTRINGCAST filename);
if (wxStrncmp(dest, val, len) == 0)
{
wxStrcpy(wxFileFunctionsBuffer, wxT("~"));
- if (user != wxT(""))
+ if (!user.empty())
wxStrcat(wxFileFunctionsBuffer, (const wxChar*) user);
wxStrcat(wxFileFunctionsBuffer, dest + len);
wxStrcpy (dest, wxFileFunctionsBuffer);
// Return just the directory, or NULL if no directory
wxString wxPathOnly (const wxString& path)
{
- if (path != wxT(""))
+ if (!path.empty())
{
wxChar buf[_MAXPATHLEN];
}
#endif
}
- return wxString(wxT(""));
+ return wxEmptyString;
}
// Utility for converting delimiters in DOS filenames to UNIX style
void wxFileName::AssignDir(const wxString& dir, wxPathFormat format)
{
- Assign(dir, _T(""), format);
+ Assign(dir, wxEmptyString, format);
}
void wxFileName::Clear()
psl->GetArguments(buf, 2048);
wxString args(buf);
- if (!args.IsEmpty() && arguments)
+ if (!args.empty() && arguments)
{
*arguments = args;
}
static const wxFileTypeInfo fallbacks[] =
{
wxFileTypeInfo(_T("image/jpeg"),
- _T(""),
- _T(""),
+ wxEmptyString,
+ wxEmptyString,
_T("JPEG image (from fallback)"),
_T("jpg"), _T("jpeg"), _T("JPG"), _T("JPEG"), NULL),
wxFileTypeInfo(_T("image/gif"),
- _T(""),
- _T(""),
+ wxEmptyString,
+ wxEmptyString,
_T("GIF image (from fallback)"),
_T("gif"), _T("GIF"), NULL),
wxFileTypeInfo(_T("image/png"),
- _T(""),
- _T(""),
+ wxEmptyString,
+ wxEmptyString,
_T("PNG image (from fallback)"),
_T("png"), _T("PNG"), NULL),
wxFileTypeInfo(_T("image/bmp"),
- _T(""),
- _T(""),
+ wxEmptyString,
+ wxEmptyString,
_T("windows bitmap image (from fallback)"),
_T("bmp"), _T("BMP"), NULL),
wxFileTypeInfo(_T("text/html"),
- _T(""),
- _T(""),
+ wxEmptyString,
+ wxEmptyString,
_T("HTML document (from fallback)"),
_T("htm"), _T("html"), _T("HTM"), _T("HTML"), NULL),
// must terminate the table with this!
// if ext == "*" or "bar*" or "b?r" or " " then its not valid
if ((ext.Find(wxT('*')) != wxNOT_FOUND) ||
(ext.Find(wxT('?')) != wxNOT_FOUND) ||
- (ext.Strip(wxString::both).IsEmpty()))
+ (ext.Strip(wxString::both).empty()))
return filePath;
// if fileName doesn't have a '.' then add one
{
wxFileDialog fileDialog(parent,
- title ? title : wxT(""),
- defaultDir ? defaultDir : wxT(""),
- defaultFileName ? defaultFileName : wxT(""),
- filter ? filter : wxT(""),
+ title ? title : wxEmptyString,
+ defaultDir ? defaultDir : wxEmptyString,
+ defaultFileName ? defaultFileName : wxEmptyString,
+ filter ? filter : wxEmptyString,
flags, wxPoint(x, y));
wxString filename;