simplify code to return from the end of the function
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73068 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
40a66cfd6a
commit
88932ec82d
@ -540,15 +540,10 @@ wxString wxControlBase::Ellipsize(const wxString& label, const wxDC& dc,
|
||||
// add this (ellipsized) row to the rest of the label
|
||||
ret << curLine;
|
||||
if ( pc == label.end() )
|
||||
{
|
||||
// NOTE: this is the return which always exits the function
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret << *pc;
|
||||
curLine.clear();
|
||||
}
|
||||
break;
|
||||
|
||||
ret << *pc;
|
||||
curLine.clear();
|
||||
}
|
||||
// we need to remove mnemonics from the label for correct calculations
|
||||
else if ( *pc == wxS('&') && (flags & wxELLIPSIZE_FLAGS_PROCESS_MNEMONICS) )
|
||||
@ -571,14 +566,9 @@ wxString wxControlBase::Ellipsize(const wxString& label, const wxDC& dc,
|
||||
}
|
||||
}
|
||||
|
||||
// this return would generate a
|
||||
// warning C4702: unreachable code
|
||||
// with MSVC since the function always exits from inside the loop
|
||||
//return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStaticBitmap
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user