CComponentsForm: fix unnecessary try for scroll

This avoids unnecessary flicker effects, because no paint is required,
if page count = 1 and also ensures, that this page is defined as current page.


Origin commit data
------------------
Commit: 23c708b787
Author: Thilo Graf <dbt@novatux.de>
Date: 2014-10-05 (Sun, 05 Oct 2014)
This commit is contained in:
2014-10-05 17:20:05 +02:00
parent 85e2ac21f6
commit 2a12679ee6

View File

@@ -622,9 +622,14 @@ CComponentsItem* CComponentsForm::getSelectedItemObject()
void CComponentsForm::ScrollPage(int direction, bool do_paint)
{
if (getPageCount() == 1){
cur_page = 0;
return;
}
OnBeforeScrollPage();
int target_page_id = (int)getPageCount() - 1;
int target_page_id = (int)page_count - 1;
int target_page = (int)cur_page;
if (direction == SCROLL_P_DOWN)