]> Creatis software - bbtk.git/commitdiff
#3054 BBTK Bug New Normal - package wx - combo box. crash with empty input
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Fri, 13 Jan 2017 14:57:02 +0000 (15:57 +0100)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Fri, 13 Jan 2017 14:57:02 +0000 (15:57 +0100)
packages/wx/src/bbwxComboBox.cxx

index 051cfea7f811e319419dd19f680f106263040d0f..36847256d4b89b9c7c7fcf59bd7d6c19e4ccc8eb 100644 (file)
@@ -163,16 +163,32 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ComboBox,bbtk::WxBlackBox);
 //===== 
 void ComboBox::Process()
 {
+
+printf("EED ComboBox::Process start\n");
+
        int iSelection = bbGetInputSelection();
+printf("EED ComboBox::Process 0\n");
        if (bbGetInputSelection() >= bbGetInputIn().size()) { iSelection=bbGetInputIn().size()-1; }
+printf("EED ComboBox::Process 1\n");
        ComboBoxWidget *w = (ComboBoxWidget*)bbGetOutputWidget();
+printf("EED ComboBox::Process 2\n");
        w->FillItems( iSelection, bbGetInputIn() );
+printf("EED ComboBox::Process 3\n");
     bbSetInputSelection( iSelection );
+printf("EED ComboBox::Process 4\n");
     bbSetOutputOut( iSelection );
-    bbSetOutputOutString( bbGetInputIn()[ iSelection ] );
+printf("EED ComboBox::Process 5\n");
+
+    int size = bbGetInputIn().size();
+    if         (  (iSelection>0) && ( (size-1)<=iSelection) ) 
+    { 
+       bbSetOutputOutString( bbGetInputIn()[ iSelection ] );
+    }
 //    bbSignalOutputModification("Out");
 //    bbSignalOutputModification("OutString");
 
+printf("EED ComboBox::Process end\n");
+
 }
 
 //=====