~ubuntu-branches/ubuntu/trusty/wxhexeditor/trusty

« back to all changes in this revision

Viewing changes to src/HexDialogs.cpp

  • Committer: Package Import Robot
  • Author(s): Andrew Shadura
  • Date: 2013-12-29 13:43:15 UTC
  • Revision ID: package-import@ubuntu.com-20131229134315-gvmj6bjv1t0zjkib
Tags: 0.22+repack-2
* Apply patch from upstream bug tracker fixing hex input.
* Fix some more typos.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
bool HexVerifyAndPrepare(wxString& hexval, wxString Value_Name, wxWindow* parent) {
64
64
   if( hexval.Len() < 2 )
65
65
      return false;
 
66
   //Remove all space chars and update the Search value
 
67
   while( hexval.find(' ') != -1 )
 
68
      hexval.Remove( hexval.find(' '),1);
 
69
 
66
70
 
67
71
   for( unsigned i = 0 ; i < hexval.Len() ; i++ )
68
72
      if( !isxdigit( hexval[i] ) or hexval == ' ' ) { //Not hexadecimal!
70
74
         wxBell();
71
75
         return false;
72
76
         }
73
 
   //Remove all space chars and update the Search value
74
 
   while( hexval.find(' ') != -1 )
75
 
      hexval.Remove( hexval.find(' '),1);
76
 
 
77
 
   //there is odd hex value, must be even digit for search!
 
77
      //there is odd hex value, must be even digit for search!
78
78
   if( hexval.Len() % 2 ) {
79
79
      OSXwxMessageBox( _("Value must be even digit!"), _("Format Error!"), wxOK, parent );
80
80
      wxBell();