diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index 44981df672..f0c84581cc 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -936,7 +936,7 @@ bool wxGenericDirCtrl::ExpandPath(const wxString& path) { data = GetItemData(childId); - if (data && data->m_path != wxEmptyString && !data->m_isDir) + if (data && !data->m_path.empty() && !data->m_isDir) { m_treeCtrl->SelectItem(childId); m_treeCtrl->EnsureVisible(childId); diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 594aea10bc..64b2113ebf 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -6359,7 +6359,7 @@ void wxGrid::ShowCellEditControl() // resize editor to overflow into righthand cells if allowed int maxWidth = rect.width; wxString value = GetCellValue(row, col); - if ( (value != wxEmptyString) && (attr->GetOverflow()) ) + if ( !value.empty() && attr->GetOverflow() ) { int y; GetTextExtent(value, &maxWidth, &y, NULL, NULL, &attr->GetFont()); diff --git a/src/generic/tipdlg.cpp b/src/generic/tipdlg.cpp index 028a374de6..1e45bd5ea6 100644 --- a/src/generic/tipdlg.cpp +++ b/src/generic/tipdlg.cpp @@ -164,7 +164,7 @@ wxString wxFileTipProvider::GetTip() // Break if tip isn't a comment, and isn't an empty string // (or only stray space characters). - if ( !tip.StartsWith(wxT("#")) && (tip.Trim() != wxEmptyString) ) + if ( !tip.StartsWith(wxT("#")) && !tip.Trim().empty() ) { break; } diff --git a/src/html/helpdata.cpp b/src/html/helpdata.cpp index d257bec45e..e5312bbadd 100644 --- a/src/html/helpdata.cpp +++ b/src/html/helpdata.cpp @@ -700,7 +700,7 @@ bool wxHtmlHelpData::AddBook(const wxString& book) wxFontEncoding enc = wxFONTENCODING_SYSTEM; #if wxUSE_FONTMAP - if (charset != wxEmptyString) + if (!charset.empty()) enc = wxFontMapper::Get()->CharsetToEncoding(charset); #endif @@ -807,7 +807,7 @@ wxHtmlSearchStatus::wxHtmlSearchStatus(wxHtmlHelpData* data, const wxString& key m_Data = data; m_Keyword = keyword; wxHtmlBookRecord* bookr = NULL; - if (book != wxEmptyString) + if (!book.empty()) { // we have to search in a specific book. Find it first int i, cnt = data->m_bookRecords.GetCount(); diff --git a/src/html/helpwnd.cpp b/src/html/helpwnd.cpp index 262904486f..f68b485cea 100644 --- a/src/html/helpwnd.cpp +++ b/src/html/helpwnd.cpp @@ -1073,7 +1073,7 @@ void wxHtmlHelpWindow::ReadCustomization(wxConfigBase *cfg, const wxString& path wxString oldpath; wxString tmp; - if (path != wxEmptyString) + if (!path.empty()) { oldpath = cfg->GetPath(); cfg->SetPath(wxT("/") + path); @@ -1122,7 +1122,7 @@ void wxHtmlHelpWindow::ReadCustomization(wxConfigBase *cfg, const wxString& path if (m_HtmlWin) m_HtmlWin->ReadCustomization(cfg); - if (path != wxEmptyString) + if (!path.empty()) cfg->SetPath(oldpath); } @@ -1131,7 +1131,7 @@ void wxHtmlHelpWindow::WriteCustomization(wxConfigBase *cfg, const wxString& pat wxString oldpath; wxString tmp; - if (path != wxEmptyString) + if (!path.empty()) { oldpath = cfg->GetPath(); cfg->SetPath(wxT("/") + path); @@ -1170,7 +1170,7 @@ void wxHtmlHelpWindow::WriteCustomization(wxConfigBase *cfg, const wxString& pat if (m_HtmlWin) m_HtmlWin->WriteCustomization(cfg); - if (path != wxEmptyString) + if (!path.empty()) cfg->SetPath(oldpath); } #endif // wxUSE_CONFIG @@ -1495,7 +1495,7 @@ void wxHtmlHelpWindow::OnToolbar(wxCommandEvent& event) item = m_HtmlWin->GetOpenedPageTitle(); url = m_HtmlWin->GetOpenedPage(); - if (item == wxEmptyString) + if (item.empty()) item = url.AfterLast(wxT('/')); if (m_BookmarksPages.Index(url) == wxNOT_FOUND) { @@ -1612,7 +1612,7 @@ void wxHtmlHelpWindow::DoIndexFind() { wxString sr = m_IndexText->GetLineText(0); sr.MakeLower(); - if (sr == wxEmptyString) + if (sr.empty()) { DoIndexAll(); } diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index 6000a004c8..bf16620db8 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -179,7 +179,7 @@ wxHtmlCell::AdjustPagebreak(int *pagebreak, void wxHtmlCell::SetLink(const wxHtmlLinkInfo& link) { wxDELETE(m_Link); - if (link.GetHref() != wxEmptyString) + if (!link.GetHref().empty()) m_Link = new wxHtmlLinkInfo(link); } diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index 5d2e2a3bd8..9ae6d0df8e 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -611,7 +611,7 @@ bool wxHtmlWindow::LoadPage(const wxString& location) } node = node->GetNext(); } - if (src == wxEmptyString) + if (src.empty()) { if (m_DefaultFilter == NULL) m_DefaultFilter = GetDefaultFilter(); src = m_DefaultFilter->ReadFile(*f); @@ -620,7 +620,7 @@ bool wxHtmlWindow::LoadPage(const wxString& location) m_FS->ChangePathTo(f->GetLocation()); rt_val = SetPage(src); m_OpenedPage = f->GetLocation(); - if (f->GetAnchor() != wxEmptyString) + if (!f->GetAnchor().empty()) { ScrollToAnchor(f->GetAnchor()); } @@ -651,7 +651,7 @@ bool wxHtmlWindow::LoadPage(const wxString& location) } } - if (m_OpenedPageTitle == wxEmptyString) + if (m_OpenedPageTitle.empty()) OnSetTitle(wxFileNameFromPath(m_OpenedPage)); if (needs_refresh) @@ -832,7 +832,7 @@ void wxHtmlWindow::ReadCustomization(wxConfigBase *cfg, wxString path) int p_fontsizes[7]; wxString p_fff, p_ffn; - if (path != wxEmptyString) + if (!path.empty()) { oldpath = cfg->GetPath(); cfg->SetPath(path); @@ -848,7 +848,7 @@ void wxHtmlWindow::ReadCustomization(wxConfigBase *cfg, wxString path) } SetFonts(p_ffn, p_fff, p_fontsizes); - if (path != wxEmptyString) + if (!path.empty()) cfg->SetPath(oldpath); } @@ -859,7 +859,7 @@ void wxHtmlWindow::WriteCustomization(wxConfigBase *cfg, wxString path) wxString oldpath; wxString tmp; - if (path != wxEmptyString) + if (!path.empty()) { oldpath = cfg->GetPath(); cfg->SetPath(path); @@ -874,7 +874,7 @@ void wxHtmlWindow::WriteCustomization(wxConfigBase *cfg, wxString path) cfg->Write(tmp, (long) m_Parser->m_FontsSizes[i]); } - if (path != wxEmptyString) + if (!path.empty()) cfg->SetPath(oldpath); } #endif // wxUSE_CONFIG @@ -897,7 +897,7 @@ bool wxHtmlWindow::HistoryBack() a = (*m_History)[m_HistoryPos].GetAnchor(); m_HistoryOn = false; m_tmpCanDrawLocks++; - if (a == wxEmptyString) LoadPage(l); + if (a.empty()) LoadPage(l); else LoadPage(l + wxT("#") + a); m_HistoryOn = true; m_tmpCanDrawLocks--; @@ -927,7 +927,7 @@ bool wxHtmlWindow::HistoryForward() a = (*m_History)[m_HistoryPos].GetAnchor(); m_HistoryOn = false; m_tmpCanDrawLocks++; - if (a == wxEmptyString) LoadPage(l); + if (a.empty()) LoadPage(l); else LoadPage(l + wxT("#") + a); m_HistoryOn = true; m_tmpCanDrawLocks--; diff --git a/src/html/htmprint.cpp b/src/html/htmprint.cpp index 250e807b99..48f3364d3f 100644 --- a/src/html/htmprint.cpp +++ b/src/html/htmprint.cpp @@ -320,22 +320,22 @@ void wxHtmlPrintout::OnPreparePrinting() (double)ppiPrinterY / (double)ppiScreenY); m_RendererHdr->SetSize((int) (ppmm_h * (mm_w - m_MarginLeft - m_MarginRight)), (int) (ppmm_v * (mm_h - m_MarginTop - m_MarginBottom))); - if (m_Headers[0] != wxEmptyString) + if (!m_Headers[0].empty()) { m_RendererHdr->SetHtmlText(TranslateHeader(m_Headers[0], 1)); m_HeaderHeight = m_RendererHdr->GetTotalHeight(); } - else if (m_Headers[1] != wxEmptyString) + else if (!m_Headers[1].empty()) { m_RendererHdr->SetHtmlText(TranslateHeader(m_Headers[1], 1)); m_HeaderHeight = m_RendererHdr->GetTotalHeight(); } - if (m_Footers[0] != wxEmptyString) + if (!m_Footers[0].empty()) { m_RendererHdr->SetHtmlText(TranslateHeader(m_Footers[0], 1)); m_FooterHeight = m_RendererHdr->GetTotalHeight(); } - else if (m_Footers[1] != wxEmptyString) + else if (!m_Footers[1].empty()) { m_RendererHdr->SetHtmlText(TranslateHeader(m_Footers[1], 1)); m_FooterHeight = m_RendererHdr->GetTotalHeight(); @@ -543,12 +543,12 @@ void wxHtmlPrintout::RenderPage(wxDC *dc, int page) m_RendererHdr->SetDC(dc, (double)ppiPrinterY / TYPICAL_SCREEN_DPI, (double)ppiPrinterY / (double)ppiScreenY); - if (m_Headers[page % 2] != wxEmptyString) + if (!m_Headers[page % 2].empty()) { m_RendererHdr->SetHtmlText(TranslateHeader(m_Headers[page % 2], page)); m_RendererHdr->Render((int) (ppmm_h * m_MarginLeft), (int) (ppmm_v * m_MarginTop), m_PageBreaks); } - if (m_Footers[page % 2] != wxEmptyString) + if (!m_Footers[page % 2].empty()) { m_RendererHdr->SetHtmlText(TranslateHeader(m_Footers[page % 2], page)); m_RendererHdr->Render((int) (ppmm_h * m_MarginLeft), (int) (pageHeight - ppmm_v * m_MarginBottom - m_FooterHeight), m_PageBreaks); diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp index edc8ffe0f3..83a06fc123 100644 --- a/src/html/winpars.cpp +++ b/src/html/winpars.cpp @@ -631,7 +631,7 @@ wxFont* wxHtmlWinParser::CreateCurrentFont() void wxHtmlWinParser::SetLink(const wxHtmlLinkInfo& link) { m_Link = link; - m_UseLink = (link.GetHref() != wxEmptyString); + m_UseLink = !link.GetHref().empty(); } void wxHtmlWinParser::SetFontFace(const wxString& face) diff --git a/src/osx/choice_osx.cpp b/src/osx/choice_osx.cpp index 06d90f26ad..72449ab64d 100644 --- a/src/osx/choice_osx.cpp +++ b/src/osx/choice_osx.cpp @@ -131,7 +131,7 @@ int wxChoice::DoInsertItems(const wxArrayStringsAdapter & items, } wxString text = items[i]; - if (text == wxEmptyString) + if (text.empty()) text = " "; // menu items can't have empty labels m_popUpMenu->Insert( idx, i+1, text ); m_datas.Insert( NULL, idx );