Mailinglist Archive: yast-commit (210 mails)
| < Previous | Next > |
[yast-commit] r63382 - /trunk/ncurses/src/NCMultiSelectionBox.cc
- From: gs@xxxxxxxxxxxxxxxxx
- Date: Wed, 09 Feb 2011 12:40:46 -0000
- Message-id: <20110209124047.095343256C@svn2.opensuse.org>
Author: gs
Date: Wed Feb 9 13:40:46 2011
New Revision: 63382
URL: http://svn.opensuse.org/viewcvs/yast?rev=63382&view=rev
Log:
add more pointer checks
Modified:
trunk/ncurses/src/NCMultiSelectionBox.cc
Modified: trunk/ncurses/src/NCMultiSelectionBox.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCMultiSelectionBox.cc?rev=63382&r1=63381&r2=63382&view=diff
==============================================================================
--- trunk/ncurses/src/NCMultiSelectionBox.cc (original)
+++ trunk/ncurses/src/NCMultiSelectionBox.cc Wed Feb 9 13:40:46 2011
@@ -138,22 +138,27 @@
bool NCMultiSelectionBox::isItemSelected( YItem *item )
{
- return item->selected();
+ if ( item )
+ return item->selected();
+ else
+ return false;
}
void NCMultiSelectionBox::selectItem( YItem *yitem, bool selected )
{
- YMultiSelectionBox::selectItem( yitem, selected );
-
- //retrieve pointer to the line tag associated with this item
- NCTableTag * tag = ( NCTableTag * )yitem->data();
- YUI_CHECK_PTR( tag );
+ if ( yitem )
+ {
+ YMultiSelectionBox::selectItem( yitem, selected );
- tag->SetSelected( selected );
+ //retrieve pointer to the line tag associated with this item
+ NCTableTag * tag = ( NCTableTag * )yitem->data();
+ YUI_CHECK_PTR( tag );
- DrawPad();
+ tag->SetSelected( selected );
+ DrawPad();
+ }
}
@@ -164,6 +169,8 @@
for ( unsigned int i = 0; i < getNumLines(); i++ )
{
NCTableTag *t = tagCell( i );
+ YUI_CHECK_PTR( t );
+
t->SetSelected( false );
}
@@ -178,8 +185,8 @@
void NCMultiSelectionBox::toggleCurrentItem()
{
YItem *it = currentItem();
- selectItem( it, !( it->selected() ) );
-
+ if ( it )
+ selectItem( it, !( it->selected() ) );
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
Date: Wed Feb 9 13:40:46 2011
New Revision: 63382
URL: http://svn.opensuse.org/viewcvs/yast?rev=63382&view=rev
Log:
add more pointer checks
Modified:
trunk/ncurses/src/NCMultiSelectionBox.cc
Modified: trunk/ncurses/src/NCMultiSelectionBox.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCMultiSelectionBox.cc?rev=63382&r1=63381&r2=63382&view=diff
==============================================================================
--- trunk/ncurses/src/NCMultiSelectionBox.cc (original)
+++ trunk/ncurses/src/NCMultiSelectionBox.cc Wed Feb 9 13:40:46 2011
@@ -138,22 +138,27 @@
bool NCMultiSelectionBox::isItemSelected( YItem *item )
{
- return item->selected();
+ if ( item )
+ return item->selected();
+ else
+ return false;
}
void NCMultiSelectionBox::selectItem( YItem *yitem, bool selected )
{
- YMultiSelectionBox::selectItem( yitem, selected );
-
- //retrieve pointer to the line tag associated with this item
- NCTableTag * tag = ( NCTableTag * )yitem->data();
- YUI_CHECK_PTR( tag );
+ if ( yitem )
+ {
+ YMultiSelectionBox::selectItem( yitem, selected );
- tag->SetSelected( selected );
+ //retrieve pointer to the line tag associated with this item
+ NCTableTag * tag = ( NCTableTag * )yitem->data();
+ YUI_CHECK_PTR( tag );
- DrawPad();
+ tag->SetSelected( selected );
+ DrawPad();
+ }
}
@@ -164,6 +169,8 @@
for ( unsigned int i = 0; i < getNumLines(); i++ )
{
NCTableTag *t = tagCell( i );
+ YUI_CHECK_PTR( t );
+
t->SetSelected( false );
}
@@ -178,8 +185,8 @@
void NCMultiSelectionBox::toggleCurrentItem()
{
YItem *it = currentItem();
- selectItem( it, !( it->selected() ) );
-
+ if ( it )
+ selectItem( it, !( it->selected() ) );
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
| < Previous | Next > |