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:
@@ -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)) &&
|
||||
|
Reference in New Issue
Block a user