From c610230c431c264976c8b37f4f96adf4c33b7bd1 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Fri, 13 Jan 2017 15:57:02 +0100 Subject: [PATCH] #3054 BBTK Bug New Normal - package wx - combo box. crash with empty input --- packages/wx/src/bbwxComboBox.cxx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/wx/src/bbwxComboBox.cxx b/packages/wx/src/bbwxComboBox.cxx index 051cfea..3684725 100644 --- a/packages/wx/src/bbwxComboBox.cxx +++ b/packages/wx/src/bbwxComboBox.cxx @@ -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"); + } //===== -- 2.47.1