Use wxString's empty() when checking if the string is (non-)empty throughout wx.

Instead of constructs such as if "( s.length() )" and "if (s.length() > 0)" use "if ( !s.empty() )" instead. Similarly for "if (s.length() == 0)" or "if ( s.IsNull() )", use "if ( s.empty() )".
No code changes intended except for a few instances where a construct like "if ( s.length() && wxFileExists(s) )" was changed to not check the length of the string and let wxFileExists handle such cases.



git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66728 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Dimitri Schoolwerth
2011-01-22 14:38:36 +00:00
parent c9ed413ab4
commit 6636ef8ddf
47 changed files with 122 additions and 122 deletions

View File

@@ -114,7 +114,7 @@ bool wxDialog::Create( wxWindow* pParent,
//
// Must defer setting the title until after dialog is created and sized
//
if (!rsTitle.IsNull())
if ( !rsTitle.empty() )
SetTitle(rsTitle);
return true;
} // end of wxDialog::Create

View File

@@ -142,7 +142,7 @@ wxMetafileDCImpl::wxMetafileDCImpl(wxDC *owner, const wxString& file)
m_maxY = -10000;
// m_title = NULL;
if (!file.IsNull() && wxFileExists(file))
if ( wxFileExists(file) )
wxRemoveFile(file);
// TODO

View File

@@ -545,7 +545,7 @@ bool wxToolBar::Realize()
m_vLastY = m_yMargin;
}
pTool->m_vX = m_vLastX + pTool->GetWidth();
if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().IsNull())
if ( HasFlag(wxTB_TEXT) && !pTool->GetLabel().empty() )
pTool->m_vY = m_vLastY + (nMaxToolHeight - m_vTextY) + m_toolPacking;
else
pTool->m_vY = m_vLastY + (nMaxToolHeight - (int)(pTool->GetHeight()/2));
@@ -858,7 +858,7 @@ void wxToolBar::DrawTool( wxDC& rDc, wxToolBarToolBase* pToolBase )
{
RaiseTool(pTool);
}
if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().IsNull())
if ( HasFlag(wxTB_TEXT) && !pTool->GetLabel().empty() )
{
wxCoord vX;
wxCoord vY;
@@ -903,7 +903,7 @@ void wxToolBar::DrawTool( wxDC& rDc, wxToolBarToolBase* pToolBase )
,pTool->m_vY
,bUseMask
);
if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().IsNull())
if ( HasFlag(wxTB_TEXT) && !pTool->GetLabel().empty() )
{
wxCoord vX;
wxCoord vY;
@@ -953,7 +953,7 @@ wxToolBarToolBase* wxToolBar::FindToolForPosition(
{
wxToolBarTool* pTool = (wxToolBarTool *)node->GetData();
if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().IsNull())
if ( HasFlag(wxTB_TEXT) && !pTool->GetLabel().empty() )
{
if ((vX >= (pTool->m_vX - ((wxCoord)(pTool->GetWidth()/2) - 2))) &&
(vY >= (pTool->m_vY - 2)) &&