Mailinglist Archive: yast-commit (687 mails)

< Previous Next >
[yast-commit] r43293 - /trunk/ncurses/src/NCComboBox.cc
  • From: kmachalkova@xxxxxxxxxxxxxxxx
  • Date: Mon, 07 Jan 2008 10:27:26 -0000
  • Message-id: <20080107102726.E35C2242B9@xxxxxxxxxxxxxxxx>
Author: kmachalkova
Date: Mon Jan 7 11:27:26 2008
New Revision: 43293

URL: http://svn.opensuse.org/viewcvs/yast?rev=43293&view=rev
Log:
Fixed adding and indexing combo-box items (#346862 related)

Modified:
trunk/ncurses/src/NCComboBox.cc

Modified: trunk/ncurses/src/NCComboBox.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCComboBox.cc?rev=43293&r1=43292&r2=43293&view=diff
==============================================================================
--- trunk/ncurses/src/NCComboBox.cc (original)
+++ trunk/ncurses/src/NCComboBox.cc Mon Jan 7 11:27:26 2008
@@ -200,8 +200,9 @@
YComboBox::addItem( item );

deflist.push_back( item->label() );
- if ( item->selected() || index == -1 )
+ if ( item->selected() )
{
+ index = item->index();
setText( item->label() );
}
}
@@ -220,13 +221,8 @@
YItem * newItem = new YItem( label, selected );
YUI_CHECK_NEW( newItem );

- YComboBox::addItem( newItem );
+ addItem(newItem);

- deflist.push_back( label );
- if ( selected || index == -1 )
- {
- setText( label );
- }
}

///////////////////////////////////////////////////////////////////
@@ -302,7 +298,6 @@
modified = false;
fldstart = 0;
curpos = mayedit ? buffer.length() : 0;
- index = -1;
setDefsze();
tUpdate();
Redraw();
@@ -319,17 +314,16 @@
string NCComboBox::text()
{
if ( modified )
- return NCstring( buffer ).Str();
-
- if ( index != -1 ) {
- int idx = 0;
- list<string>::const_iterator entry;
- for ( entry = deflist.begin(); entry != deflist.end(); ++entry, ++idx )
{
- if ( idx == index ) {
- return *entry;
- }
- }
- }
+ return NCstring( buffer ).Str();
+ //if ( index != -1 ) {
+ // int idx = 0;
+ // list<string>::const_iterator entry;
+ // for ( entry = deflist.begin(); entry != deflist.end(); ++entry,
++idx ) {
+ // if ( idx == index ) {
+ // return *entry;
+ // }
+ // }
+ //}

return privText.Str();
}
@@ -640,7 +634,7 @@
wpos at( ScreenPos() + wpos( win->height(), -1 ) );
NCPopupList * dialog = new NCPopupList( at, "", deflist, index );
YUI_CHECK_NEW( dialog );
- int idx = dialog->post();
+ int idx = dialog->post();
if ( idx != -1 )
setCurrentItem( idx );
YDialog::deleteTopmostDialog();

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages