[Cmake-commits] [cmake-commits] hoffman committed cmCursesCacheEntryComposite.cxx 1.8 1.9 cmCursesMainForm.cxx 1.72 1.73

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Mar 7 16:32:11 EST 2008


Update of /cvsroot/CMake/CMake/Source/CursesDialog
In directory public:/mounts/ram/cvs-serv31694

Modified Files:
	cmCursesCacheEntryComposite.cxx cmCursesMainForm.cxx 
Log Message:
ENH: fix it for working with an empty cache


Index: cmCursesCacheEntryComposite.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CursesDialog/cmCursesCacheEntryComposite.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -C 2 -d -r1.8 -r1.9
*** cmCursesCacheEntryComposite.cxx	16 Mar 2006 15:44:55 -0000	1.8
--- cmCursesCacheEntryComposite.cxx	7 Mar 2008 21:32:09 -0000	1.9
***************
*** 31,35 ****
    this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key);
    this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " ");
!   this->Entry = 0;
  }
  
--- 31,36 ----
    this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key);
    this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " ");
!   this->Entry = 0; 
!   this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1);
  }
  

Index: cmCursesMainForm.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CursesDialog/cmCursesMainForm.cxx,v
retrieving revision 1.72
retrieving revision 1.73
diff -C 2 -d -r1.72 -r1.73
*** cmCursesMainForm.cxx	12 Feb 2008 14:49:42 -0000	1.72
--- cmCursesMainForm.cxx	7 Mar 2008 21:32:09 -0000	1.73
***************
*** 219,223 ****
      }
    delete[] this->Fields;
- 
    if (this->AdvancedMode)
      {
--- 219,222 ----
***************
*** 240,244 ****
        }
      }
! 
    // Assign the fields: 3 for each entry: label, new entry marker
    // ('*' or ' ') and entry widget
--- 239,247 ----
        }
      }
!   // there is always one even if it is the dummy one
!   if(this->NumberOfVisibleEntries == 0)
!     {
!     this->NumberOfVisibleEntries = 1;
!     }
    // Assign the fields: 3 for each entry: label, new entry marker
    // ('*' or ' ') and entry widget
***************
*** 266,270 ****
      j++;
      }
! 
    // Has to be null terminated.
    this->Fields[3*this->NumberOfVisibleEntries] = 0;
--- 269,281 ----
      j++;
      }
!   // if no cache entries there should still be one dummy field
!   if(j == 0)
!     {
!     it = this->Entries->begin();
!     this->Fields[0]    = (*it)->Label->Field;
!     this->Fields[1]  = (*it)->IsNewLabel->Field;
!     this->Fields[2]  = (*it)->Entry->Field;
!     this->NumberOfVisibleEntries = 1;
!     }
    // Has to be null terminated.
    this->Fields[3*this->NumberOfVisibleEntries] = 0;



More information about the Cmake-commits mailing list