equal
deleted
inserted
replaced
813 DrawItem(oldCurrentItemIndex); |
813 DrawItem(oldCurrentItemIndex); |
814 } |
814 } |
815 } |
815 } |
816 else // items will get redrawn anyway |
816 else // items will get redrawn anyway |
817 { |
817 { |
|
818 // As the iVerticalOffset is changed in CalcNewTopItemIndexSoItemIsVisible(), |
|
819 // and ScrollToMakeItemVisible() will call the CalcNewTopItemIndexSoItemIsVisible() again, |
|
820 // which will use iVerticalOffset to do some judgementes, |
|
821 // we must set iVerticalOffset back to original value. |
|
822 iVerticalOffset = oldVerticalOffset; |
818 ScrollToMakeItemVisible(iCurrentItemIndex); |
823 ScrollToMakeItemVisible(iCurrentItemIndex); |
819 } |
824 } |
820 UpdateSelectionL(aSelectionMode); |
825 UpdateSelectionL(aSelectionMode); |
821 iFlags &= ~EOffsetChanged; |
826 iFlags &= ~EOffsetChanged; |
822 } |
827 } |
1185 const TInt numItemsThatFitInRect=NumberOfItemsThatFitInRect(iViewRect); |
1190 const TInt numItemsThatFitInRect=NumberOfItemsThatFitInRect(iViewRect); |
1186 if (aItemIndex < iTopItemIndex || numItemsThatFitInRect == 0) |
1191 if (aItemIndex < iTopItemIndex || numItemsThatFitInRect == 0) |
1187 newTopItemIndex = aItemIndex; |
1192 newTopItemIndex = aItemIndex; |
1188 else if (aItemIndex > iBottomItemIndex) |
1193 else if (aItemIndex > iBottomItemIndex) |
1189 newTopItemIndex = aItemIndex - numItemsThatFitInRect + 1; |
1194 newTopItemIndex = aItemIndex - numItemsThatFitInRect + 1; |
|
1195 else if ( ( iVerticalOffset < 0 ) |
|
1196 && ( aItemIndex == iBottomItemIndex ) |
|
1197 && ( 0 == iViewRect.Height() % iItemHeight ) ) |
|
1198 { |
|
1199 newTopItemIndex += 1; |
|
1200 } |
1190 |
1201 |
1191 if (!ITEM_EXISTS_ONCE(newTopItemIndex) && newTopItemIndex != 0 ) |
1202 if (!ITEM_EXISTS_ONCE(newTopItemIndex) && newTopItemIndex != 0 ) |
1192 { // if application fails to call HandleItemAdditionL(), we might go here. |
1203 { // if application fails to call HandleItemAdditionL(), we might go here. |
1193 // we dont want our OfferKeyEventL() to panic in that case. |
1204 // we dont want our OfferKeyEventL() to panic in that case. |
1194 newTopItemIndex = iTopItemIndex; |
1205 newTopItemIndex = iTopItemIndex; |