--- a/menufw/menufwui/mmwidgets/src/mmgridview.cpp Tue Jan 26 11:48:23 2010 +0200
+++ b/menufw/menufwui/mmwidgets/src/mmgridview.cpp Tue Feb 02 00:04:13 2010 +0200
@@ -214,14 +214,7 @@
//
void CMmGridView::Draw(const TRect* aClipRect) const
{
- CMmListBoxItemDrawer* itemDrawer =
- STATIC_CAST( CMmListBoxItemDrawer*, ItemDrawer() );
- TSize size = itemDrawer->GetItemSize( 0, EFalse );
- if ( itemDrawer->ItemCellSize() != size )
- {
- const_cast<CMmGridView*>( this )->SetItemHeight( size.iHeight );
- const_cast<CMmGridView*>( this )->SetColumnWidth( size.iWidth );
- }
+ const_cast<CMmGridView*>( this )->UpdateItemHeightAndWidth();
DoDraw( aClipRect );
}
@@ -299,4 +292,23 @@
CAknGridView::SetItemHeight(aItemHeight);
}
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CMmGridView::UpdateItemHeightAndWidth()
+ {
+ if ( iModel && iModel->NumberOfItems() )
+ {
+ CMmListBoxItemDrawer* itemDrawer =
+ STATIC_CAST( CMmListBoxItemDrawer*, ItemDrawer() );
+ TSize size = itemDrawer->GetItemSize( 0, EFalse );
+ if ( itemDrawer->ItemCellSize() != size )
+ {
+ const_cast<CMmGridView*>( this )->SetItemHeight( size.iHeight );
+ const_cast<CMmGridView*>( this )->SetColumnWidth( size.iWidth );
+ }
+ }
+ }
+
//End of file