Refactor string manipulations in wxPropertyGrid::ExpandEscapeSequence and CreateEscapeSequences.
Share wxString::clear() method to initialize empty destination string.
This commit is contained in:
parent
efce9b2306
commit
3e3aaa33db
@ -1736,18 +1736,17 @@ wxPoint wxPropertyGrid::GetGoodEditorDialogPosition( wxPGProperty* p,
|
||||
|
||||
wxString& wxPropertyGrid::ExpandEscapeSequences( wxString& dst_str, wxString& src_str )
|
||||
{
|
||||
dst_str.clear();
|
||||
|
||||
if ( src_str.empty() )
|
||||
{
|
||||
dst_str = src_str;
|
||||
return src_str;
|
||||
return dst_str;
|
||||
}
|
||||
|
||||
bool prev_is_slash = false;
|
||||
|
||||
wxString::const_iterator i = src_str.begin();
|
||||
|
||||
dst_str.clear();
|
||||
|
||||
for ( ; i != src_str.end(); ++i )
|
||||
{
|
||||
wxUniChar a = *i;
|
||||
@ -1795,17 +1794,16 @@ wxString& wxPropertyGrid::ExpandEscapeSequences( wxString& dst_str, wxString& sr
|
||||
|
||||
wxString& wxPropertyGrid::CreateEscapeSequences( wxString& dst_str, wxString& src_str )
|
||||
{
|
||||
dst_str.clear();
|
||||
|
||||
if ( src_str.empty() )
|
||||
{
|
||||
dst_str = src_str;
|
||||
return src_str;
|
||||
return dst_str;
|
||||
}
|
||||
|
||||
wxString::const_iterator i = src_str.begin();
|
||||
wxUniChar prev_a = wxS('\0');
|
||||
|
||||
dst_str.clear();
|
||||
|
||||
for ( ; i != src_str.end(); ++i )
|
||||
{
|
||||
wxChar a = *i;
|
||||
|
Loading…
Reference in New Issue
Block a user