Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TabCtrl » TabCtrl raises Assert in Array [BUG]
TabCtrl raises Assert in Array [BUG] [message #6259] Sun, 05 November 2006 00:41 Go to next message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
the following code of Accept in TabCtrl assumes that a Tab is present, but what if no tab was added to the TabCtrl?
bool TabCtrl::Accept() {
   int ii=Get(); //ii is -1 if no Tab is present
   if(accept_current)
      return !tab[ii].slave || tab[ii].slave->Accept(); //-1 in Array raises Assertion
   for(int i=0;i<tab.GetCount();i++) {
      //in here no Problems at all
   }
   Set(ii); //-1 will make troubles here, too
   return true;
}


so what about adding these lines before everything:
if(!tab.GetCount())
   return true;


Bas
Re: TabCtrl raises Assert in Array [BUG] [message #6266 is a reply to message #6259] Sun, 05 November 2006 09:59 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, this is very rare case, but you are right - correct is to test here. Applied.

Mirek
Re: TabCtrl raises Assert in Array [BUG] [message #6268 is a reply to message #6266] Sun, 05 November 2006 10:26 Go to previous message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
luzr wrote on Sun, 05 November 2006 09:59

Well, this is very rare case, but you are right - correct is to test here. Applied.


But I had that case Razz

Bas

Previous Topic: Sorry for bothering you with another question:)
Next Topic: Shortcuts on TabCtrl
Goto Forum:
  


Current Time: Thu Mar 28 10:26:27 CET 2024

Total time taken to generate the page: 0.01168 seconds