Remove unnecessary c_str() from wx var arg functions arguments
Using c_str() for arguments to wxString::Printf(), Format() and wxLogXXX() is useless since wx 2.9 days, so simply remove them. No real changes, this is just a (long due) cleanup.
This commit is contained in:
@@ -136,7 +136,7 @@ wxChmTools::wxChmTools(const wxFileName &archive)
|
||||
else
|
||||
{
|
||||
wxLogError(_("Failed to open CHM archive '%s'."),
|
||||
archive.GetFullPath().c_str());
|
||||
archive.GetFullPath());
|
||||
m_lasterror = (chmd->last_error(chmd));
|
||||
return;
|
||||
}
|
||||
@@ -268,9 +268,9 @@ size_t wxChmTools::Extract(const wxString& pattern, const wxString& filename)
|
||||
// Error
|
||||
m_lasterror = d->last_error(d);
|
||||
wxLogError(_("Could not extract %s into %s: %s"),
|
||||
wxString::FromAscii(f->filename).c_str(),
|
||||
filename.c_str(),
|
||||
ChmErrorMsg(m_lasterror).c_str());
|
||||
wxString::FromAscii(f->filename),
|
||||
filename,
|
||||
ChmErrorMsg(m_lasterror));
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
@@ -434,7 +434,7 @@ wxChmInputStream::wxChmInputStream(const wxString& archive,
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogError(_("Could not locate file '%s'."), filename.c_str());
|
||||
wxLogError(_("Could not locate file '%s'."), filename);
|
||||
m_lasterror = wxSTREAM_READ_ERROR;
|
||||
return;
|
||||
}
|
||||
@@ -708,7 +708,7 @@ bool wxChmInputStream::CreateFileStream(const wxString& pattern)
|
||||
|
||||
if ( tmpfile.empty() )
|
||||
{
|
||||
wxLogError(_("Could not create temporary file '%s'"), tmpfile.c_str());
|
||||
wxLogError(_("Could not create temporary file '%s'"), tmpfile);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -716,7 +716,7 @@ bool wxChmInputStream::CreateFileStream(const wxString& pattern)
|
||||
if ( m_chm->Extract(pattern, tmpfile) <= 0 )
|
||||
{
|
||||
wxLogError(_("Extraction of '%s' into '%s' failed."),
|
||||
pattern.c_str(), tmpfile.c_str());
|
||||
pattern, tmpfile);
|
||||
if ( wxFileExists(tmpfile) )
|
||||
wxRemoveFile(tmpfile);
|
||||
return false;
|
||||
@@ -877,7 +877,7 @@ wxString wxChmFSHandler::FindFirst(const wxString& spec, int WXUNUSED(flags))
|
||||
!m_pattern.Contains(wxT(".hhp.cached")))
|
||||
{
|
||||
m_found.Printf(wxT("%s#chm:%s.hhp"),
|
||||
left.c_str(), m_pattern.BeforeLast(wxT('.')).c_str());
|
||||
left, m_pattern.BeforeLast(wxT('.')));
|
||||
}
|
||||
|
||||
return m_found;
|
||||
|
||||
@@ -293,7 +293,7 @@ bool wxHtmlHelpData::LoadMSProject(wxHtmlBookRecord *book, wxFileSystem& fsys,
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogError(_("Cannot open contents file: %s"), contentsfile.c_str());
|
||||
wxLogError(_("Cannot open contents file: %s"), contentsfile);
|
||||
}
|
||||
|
||||
f = ( indexfile.empty() ? NULL : fsys.OpenFile(indexfile) );
|
||||
@@ -307,7 +307,7 @@ bool wxHtmlHelpData::LoadMSProject(wxHtmlBookRecord *book, wxFileSystem& fsys,
|
||||
}
|
||||
else if (!indexfile.empty())
|
||||
{
|
||||
wxLogError(_("Cannot open index file: %s"), indexfile.c_str());
|
||||
wxLogError(_("Cannot open index file: %s"), indexfile);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -657,7 +657,7 @@ bool wxHtmlHelpData::AddBook(const wxString& book)
|
||||
fi = fsys.OpenFile(book);
|
||||
if (fi == NULL)
|
||||
{
|
||||
wxLogError(_("Cannot open HTML help book: %s"), book.c_str());
|
||||
wxLogError(_("Cannot open HTML help book: %s"), book);
|
||||
return false;
|
||||
}
|
||||
fsys.ChangePathTo(book);
|
||||
|
||||
@@ -131,7 +131,7 @@ wxString wxHtmlFilterHTML::ReadFile(const wxFSFile& file) const
|
||||
|
||||
if (s == NULL)
|
||||
{
|
||||
wxLogError(_("Cannot open HTML document: %s"), file.GetLocation().c_str());
|
||||
wxLogError(_("Cannot open HTML document: %s"), file.GetLocation());
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ wxString wxHtmlFilterHTML::ReadFile(const wxFSFile& file) const
|
||||
{
|
||||
wxString hdr;
|
||||
wxString mime = file.GetMimeType();
|
||||
hdr.Printf(wxT("<meta http-equiv=\"Content-Type\" content=\"%s\">"), mime.c_str());
|
||||
hdr.Printf(wxT("<meta http-equiv=\"Content-Type\" content=\"%s\">"), mime);
|
||||
return hdr+doc;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -583,7 +583,7 @@ bool wxHtmlWindow::LoadPage(const wxString& location)
|
||||
|
||||
if (f == NULL)
|
||||
{
|
||||
wxLogError(_("Unable to open requested HTML document: %s"), location.c_str());
|
||||
wxLogError(_("Unable to open requested HTML document: %s"), location);
|
||||
m_tmpCanDrawLocks--;
|
||||
SetHTMLStatusText(wxEmptyString);
|
||||
return false;
|
||||
@@ -688,7 +688,7 @@ bool wxHtmlWindow::ScrollToAnchor(const wxString& anchor)
|
||||
const wxHtmlCell *c = m_Cell->Find(wxHTML_COND_ISANCHOR, &anchor);
|
||||
if (!c)
|
||||
{
|
||||
wxLogWarning(_("HTML anchor %s does not exist."), anchor.c_str());
|
||||
wxLogWarning(_("HTML anchor %s does not exist."), anchor);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -718,7 +718,7 @@ void wxHtmlWindow::OnSetTitle(const wxString& title)
|
||||
if (m_RelatedFrame)
|
||||
{
|
||||
wxString tit;
|
||||
tit.Printf(m_TitleFormat, title.c_str());
|
||||
tit.Printf(m_TitleFormat, title);
|
||||
m_RelatedFrame->SetTitle(tit);
|
||||
}
|
||||
m_OpenedPageTitle = title;
|
||||
@@ -1017,7 +1017,7 @@ bool wxHtmlWindow::CopySelection(ClipboardType t)
|
||||
wxTheClipboard->SetData(new wxTextDataObject(txt));
|
||||
wxTheClipboard->Close();
|
||||
wxLogTrace(wxT("wxhtmlselection"),
|
||||
_("Copied to clipboard:\"%s\""), txt.c_str());
|
||||
_("Copied to clipboard:\"%s\""), txt);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user